buglwIP - A Lightweight TCP/IP stack - Bugs: bug #51135, etharp_query might under-allocate...

 
 

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

bug #51135: etharp_query might under-allocate when copying a volatile packet

Submitter:  Tim Cussins <tcussins>
Submitted:  Mon 29 May 2017 02:24:43 PM UTC
   
 
Category:  IPv4 Severity:  3 - Normal
Item Group:  Crash Error Status:  Fixed
Privacy:  Public Assigned to:  goldsimon
Open/Closed:  Closed Planned Release:  None
lwIP version:  git head

Mon 29 May 2017 07:49:35 PM UTC, comment #1: 

Wow, congrats on finding this! The bug exists since 2007 :-(

Pushed, thanks for the patch!

Simon Goldschmidt <goldsimon>
Group administrator
Mon 29 May 2017 02:24:43 PM UTC, original submission:  

Hi all,

If etharp_query() needs to queue a packet that involves volatile pbufs, it allocates a new pbuf from RAM, and copies the outgoing packet into the new pbuf, and enqueues the new pbuf in place of the outgoing packet.

The line that allocates the pbuf allocation uses a temporary struct pbuf* 'p', instead of the outgoing packet pbuf, 'q'. This can result in the allocation of a pbuf that is not large enough to allow the copy to take place :)

Attached patch has slightly fuller explanation & fix.

Thanks,
Tim

Tim Cussins <tcussins>

 

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

Attached Files

 

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 tcussins (Submitted the item)
  •  

    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 4 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2017-05-29 goldsimon StatusNone Fixed
        Assigned toNone goldsimon
        Open/ClosedOpen Closed
    2017-05-29 tcussins Attached File- Added 0001-etharp.c-Ensure-etharp_query-allocates-adequate-pbuf.patch, #40808

    Back to the top

    Powered by Savane 3.13-caa5.
    Corresponding source code