buglwIP - A Lightweight TCP/IP stack - Bugs: bug #48503, tcp_abandon() on CLOSED unbound...

 
 

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

bug #48503: tcp_abandon() on CLOSED unbound PCB tries to remove it from tcp_active_pcbs

Submitted by:  Ambroz Bizjak <abizjak>
Submitted on:  Wed 13 Jul 2016 09:15:56 PM UTC  
 
Category: TCPSeverity: 3 - Normal
Item Group: Crash ErrorStatus: Fixed
Privacy: PublicAssigned to: Simon Goldschmidt <goldsimon>
Open/Closed: ClosedPlanned Release: None
lwIP version: git head

Tue 19 Jul 2016 07:10:13 AM UTC, comment #3:

gub -> bug :-)

Simon Goldschmidt <goldsimon>
Project AdministratorIn charge of this item.
Tue 19 Jul 2016 07:07:05 AM UTC, comment #2:

The RST thing was actually a regression gub. Fixed, thanks for reporting.

Simon Goldschmidt <goldsimon>
Project AdministratorIn charge of this item.
Thu 14 Jul 2016 07:30:32 AM UTC, comment #1:

Okay probably not a crash because TCP_RMV is implemented such that it doesn't crash if the PCB is not on the list. But still looks like a bug, also the possible sending of a RST :)

Ambroz Bizjak <abizjak>
Wed 13 Jul 2016 09:15:56 PM UTC, original submission:

Well that should be clear enough. I'm assuming this is a crash but I'm reporting this based having read the code only.

The faulty code is this:

if ((pcb->state == CLOSED) && (pcb->local_port != 0)) {
/* bound, not yet opened */
TCP_RMV(&tcp_bound_pcbs, pcb);
} else {
send_rst = reset;
local_port = pcb->local_port;
TCP_PCB_REMOVE_ACTIVE(pcb);
}

I'm not sure how relevant this is, but I suspect it can happen if you leave around such a PCB and lwIP decides to recycle it for a new connection (through tcp_kill_state).

Possible fix:

if (pcb->state == CLOSED) {
if (pcb->local_port != 0) {
/* bound, not yet opened */
TCP_RMV(&tcp_bound_pcbs, pcb);
}
} else {
send_rst = reset;
local_port = pcb->local_port;
TCP_PCB_REMOVE_ACTIVE(pcb);
}

Ambroz Bizjak <abizjak>

 

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

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

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 3 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Tue 19 Jul 2016 07:07:05 AM UTCgoldsimonStatusNone=>Fixed
      Assigned toNone=>goldsimon
      Open/ClosedOpen=>Closed

    Back to the top


    Powered by Savane 3.1-cleanup1