lwip-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[lwip-devel] [patch #9890] Memory leak in netif_loop_output if tcpip_try


From: Nick Ballhorn-Wagner
Subject: [lwip-devel] [patch #9890] Memory leak in netif_loop_output if tcpip_try_callback fails
Date: Wed, 19 Feb 2020 15:22:16 -0500 (EST)
User-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.106 Safari/537.36

URL:
  <https://savannah.nongnu.org/patch/?9890>

                 Summary: Memory leak in netif_loop_output if
tcpip_try_callback fails
                 Project: lwIP - A Lightweight TCP/IP stack
            Submitted by: nickbw
            Submitted on: Wed 19 Feb 2020 08:22:14 PM UTC
                Category: pbufs
                Priority: 5 - Normal
                  Status: None
                 Privacy: Public
             Assigned to: None
        Originator Email: 
             Open/Closed: Open
         Discussion Lock: Any
         Planned Release: None

    _______________________________________________________

Details:

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.



    _______________________________________________________

File Attachments:


-------------------------------------------------------
Date: Wed 19 Feb 2020 08:22:14 PM UTC  Name: lwip_patch  Size: 3KiB   By:
nickbw

<http://savannah.nongnu.org/patch/download.php?file_id=48452>

    _______________________________________________________

Reply to this item at:

  <https://savannah.nongnu.org/patch/?9890>

_______________________________________________
  Message sent via Savannah
  https://savannah.nongnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]