buglwIP - A Lightweight TCP/IP stack - Bugs: bug #51507, Keep uses of...

 
 

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

bug #51507: Keep uses of SYS_ARCH_PROTECT/UNPROTECT in alloc_socket nested.

Submitted by:  Douglas <ourairquality>
Submitted on:  Wed 19 Jul 2017 01:26:03 PM UTC  
 
Category: sockets/netconnSeverity: 3 - Normal
Item Group: Faulty BehaviourStatus: Fixed
Privacy: PublicAssigned to: Simon Goldschmidt <goldsimon>
Open/Closed: ClosedPlanned Release: None
lwIP version: git head

Thu 20 Jul 2017 07:19:26 PM UTC, comment #1:

Well spotted! However, your patch is suboptimal in that it doesn't unlock/lock for each iteration, resulting in a possibly long time of locked interrupts (depending on NUM_SOCKETS).

Fixed in a different way. Thanks for reporting!

Simon Goldschmidt <goldsimon>
Project AdministratorIn charge of this item.
Wed 19 Jul 2017 01:26:03 PM UTC, original submission:

When the LWIP_NETCONN_FULLDUPLEX feature is enabled the loop was calling SYS_ARCH_PROTECT at the start and it appears that it was possible to 'continue' and repeat that loop with going via SYS_ARCH_UNPROTECT. So there could be multiple calls to SYS_ARCH_PROTECT without matching calls to SYS_ARCH_UNPROTECT.

The patch simply hoists this out of the loop, but if that were not considered fine enough then an alternative would be to call SYS_ARCH_UNPROTECT before 'continue'.

Douglas <ourairquality>

 

 

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 ourairquality (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 4 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Thu 20 Jul 2017 07:19:26 PM UTCgoldsimonStatusNone=>Fixed
      Assigned toNone=>goldsimon
      Open/ClosedOpen=>Closed
    Wed 19 Jul 2017 01:26:03 PM UTCourairqualityAttached File-=>Added 0001-Keep-uses-SYS_ARCH_PROTECT-UNPROTECT-in-alloc_socket.patch, #41243

    Back to the top


    Powered by Savane 3.1-cleanup1