patchlwIP - A Lightweight TCP/IP stack - Patches: patch #9890, Memory leak in netif_loop_output...

 
 

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

patch #9890: Memory leak in netif_loop_output if tcpip_try_callback fails

Submitter:  Nick Ballhorn-Wagner <nickbw>
Submitted:  Wed 19 Feb 2020 08:22:14 PM UTC
   
 
Category:  pbufs Priority:  5 - Normal
Status:  Done Privacy:  Public
Assigned to:  goldsimon Open/Closed:  Closed
Planned Release:  None

Fri 21 Feb 2020 04:27:09 PM UTC, comment #1: 

Applied, thanks for the patch.

Simon Goldschmidt <goldsimon>
Group administrator
Wed 19 Feb 2020 08:22:14 PM UTC, original submission:  

If the tcpip_try_callback() call fails in the existing netif_loop_output function(), it never schedules another call to netif_poll(), causing a memory leak.  We discovered this on a device that had a small tcpip_mbox, causing the underlying sys_mbox_trypost to fail with an ERR_MEM.

We are making the assumption that the goal of the existing code is to keep the packet, rather than dropping it.  Looking at other places where tcpip_try_callback was called, we noticed a variety of techniques used to deal with the errors.

We also kept the existing logic of returning ERR_OK when this condition occurs, since the linked list is cleaned up on the next packet/tcpip_try_callback() call.

Nick Ballhorn-Wagner <nickbw>

 

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

Attached Files
file #48452:  lwip_patch added by nickbw (3KiB - application/octet-stream)

 

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 nickbw (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
    2020-02-21 goldsimon StatusNone Done
        Assigned toNone goldsimon
        Open/ClosedOpen Closed
    2020-02-19 nickbw Attached File- Added lwip_patch, #48452

    Back to the top

    Powered by Savane 3.13-4448.
    Corresponding source code