patchlwIP - A Lightweight TCP/IP stack - Patches: patch #10163, Fix failing fuzzer if compiling...

 
 

You are not allowed to post comments on this tracker with your current authentication level.

patch #10163: Fix failing fuzzer if compiling with ubsan

Submitter:  Wouter van Gulik <wouter>
Submitted:  Wed 22 Dec 2021 11:41:00 AM UTC
   
 
Category:  Contrib Priority:  5 - Normal
Status:  Done Privacy:  Public
Assigned to:  goldsimon Open/Closed:  Closed
Planned Release:  None

Thu 30 Dec 2021 09:06:28 PM UTC, comment #1: 

I would have thought the cast from s32_t to uint64_t is missing a "& 0xffffffff" to prevent undefined behaviour when multiplying 0xffffffffdeadbeef in the first iteration. I'm not sure why you didn't need that, but I've added it.

Simon Goldschmidt <goldsimon>
Group administrator
Wed 22 Dec 2021 11:41:00 AM UTC, original submission:  

The "random" generator uses a 32 bit multiply that overflows.
When building with "undefined behavior sanitizer" enabled the fuzzer stops before even parsing the packet.
This make it impossible to use AFLPlusPlus (the 'successor' of AFL).
The fix is trivial; make the intermediate variable 'val' 64bit and use it instead of state[0] in the multiplication. See attached patch.

Wouter van Gulik <wouter>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attached Files
file #52554:  fuzz_common.patch added by wouter (577B - text/x-patch)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by goldsimon (Posted a comment)
  • -email is unavailable- added by wouter (Submitted the item)
  • -email is unavailable- added by wouter
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

     

    Follow 5 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2021-12-30 goldsimon StatusNone Done
        Assigned toNone goldsimon
        Open/ClosedOpen Closed
    2021-12-22 wouter Attached File- Added fuzz_common.patch, #52554
        Carbon-Copy- Added wouter

    Back to the top

    Powered by Savane 3.13-f8d8.
    Corresponding source code