buglwIP - A Lightweight TCP/IP stack - Bugs: bug #51597, ip4_reass: Last fragment is...

 
 

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

bug #51597: ip4_reass: Last fragment is assumed to have arrived even if it was discarded

Submitted by:  Ambroz Bizjak <abizjak>
Submitted on:  Thu 27 Jul 2017 11:24:28 PM UTC  
 
Category: IPv4Severity: 3 - Normal
Item Group: Faulty BehaviourStatus: Fixed
Privacy: PublicAssigned to: Simon Goldschmidt <goldsimon>
Open/Closed: ClosedPlanned Release: None
lwIP version: git head

Fri 28 Jul 2017 07:47:18 AM UTC, comment #1:

Fixed, thanks for reporting.

Simon Goldschmidt <goldsimon>
Project AdministratorIn charge of this item.
Thu 27 Jul 2017 11:24:28 PM UTC, original submission:

When a fragment with MF=0 is received, IP_REASS_FLAG_LASTFRAG is set:

http://git.savannah.gnu.org/cgit/lwip.git/tree/src/core/ipv4/ip4_frag.c?id=925f3944d3d9de6e730f6d0738844f339ce9e35c#n591

Then the same fragment may be discarded in various places within ip_reass_chain_frag_into_datagram_and_validate (goto freepbuf), for example because it overlaps with existing fragments.

Later another fragment with MF=1, be inserted to the end, the reassembly may be considered completed because there are no gaps at the start and between fragments and the last fragment has supposedly arrived (IP_REASS_FLAG_LASTFRAG was set). Then the assert at line 468 would fail since the end of the last fragment in the chain would not match the datagram_len remembered.

There is a similar issue if a fragment with MF=0 is received which has smaller end than a previously received fragment with MF=0. Then datagram_len would be lowered and the mentioned assert would fail when reassembly is considered complete since the former fragment (which now has end greater than datagram_len) would still be in the chain.

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
    Fri 28 Jul 2017 07:47:18 AM UTCgoldsimonStatusNone=>Fixed
      Assigned toNone=>goldsimon
      Open/ClosedOpen=>Closed

    Back to the top


    Powered by Savane 3.1-cleanup1