patchlwIP - A Lightweight TCP/IP stack - Patches: patch #10121, bug: httpd creates circular linked...

 
 

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

patch #10121: bug: httpd creates circular linked list that causes an infinite loop

Submitter:  Peter Lawrence <majbthrd>
Submitted:  Wed 13 Oct 2021 09:52:03 PM UTC
   
 
Category:  Contrib Priority:  6
Status:  Works For Me Privacy:  Public
Assigned to:  goldsimon Open/Closed:  Closed
Planned Release:  None

Thu 12 Oct 2023 07:36:50 PM UTC, comment #1: 

I don't get the same problem you observed when connecting via telnet and pressing enter twice: I get two distinct pbufs. I guess you have a problem somewhere with your netif driver that results in getting the same pbuf twice here.

To detect such problems, I've added an assert to pbuf_cat() that h and t are not the same: although that doesn't every loop, it might detect this bug here.

Good luck with finding your actual bug! ;-)

Simon Goldschmidt <goldsimon>
Group administrator
Wed 13 Oct 2021 09:52:03 PM UTC, original submission:  

This pertains to the httpd service in ./src/apps/http/httpd.c

Unless the user has specifically overridden the normally enabled LWIP_HTTPD_SUPPORT_REQUESTLIST, the right input sequence will cause httpd to go into an infinite loop.

To reproduce, telnet to the httpd service port and press the ENTER key twice.

What I observe is that this test procedure results in two calls to the httpd handler with the same pbuf pointer.  In the code below the comment "enqueue the pbuf", there is a call to pbuf_cat() to concatenate the existing pbuf to itself, and in the later pbuf_len() call will then proceed to count this circular linked list for the rest of time.

Peter Lawrence <majbthrd>

 

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

Attached Files
file #52096:  httpd.diff added by majbthrd (483B - 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 majbthrd (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
    2023-10-12 goldsimon StatusNone Works For Me
        Assigned toNone goldsimon
        Open/ClosedOpen Closed
    2021-10-13 majbthrd Attached File- Added httpd.diff, #52096

    Back to the top

    Powered by Savane 3.13-3230.
    Corresponding source code