buglwIP - A Lightweight TCP/IP stack - Bugs: bug #41188, Alignment error in memp_init()...

 
 

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

bug #41188: Alignment error in memp_init() when MEMP_SEPARATE_POOLS==1

Submitted by:  Simon Goldschmidt <goldsimon>
Submitted on:  Fri 10 Jan 2014 03:23:52 PM UTC  
 
Category: pbufsSeverity: 3 - Normal
Item Group: Crash ErrorStatus: Fixed
Privacy: PublicAssigned to: Simon Goldschmidt <goldsimon>
Open/Closed: ClosedPlanned Release: None
lwIP version: git head

Thu 23 Jan 2014 04:32:21 AM UTC, comment #2:

Actually, don't separate pools need the same MEM_ALIGNMENT-1 padding
at the beginning as memp_memory has to compensate for potential
misalignment?

From a quick look - consider a trivial case of a pool with 1 element
that is 8 bytes large and with alignment of 8. It's memory base will
be declared of size 8. If the base ends up allocated, say, only
4-aligned, but not 8-aligned, LWIP_MEM_ALIGN will offset 4 bytes into
the array and the returned object will be outside the bounds of the
pool memory.

Valery Ushakov <uwe>
Thu 23 Jan 2014 04:03:36 AM UTC, comment #1:

The fix in commit 75f2c56558aee0f3476f170d2ccd96a28eeba710 applies
alignment only in memp_init(). It should also be applied in
memp_overflow_init() and memp_overflow_check_all(), I guess.

Valery Ushakov <uwe>
Fri 10 Jan 2014 03:23:52 PM UTC, original submission:

In memp_init(), when MEMP_SEPARATE_POOLS==1, memp_bases[i] are used without aligning the buffer through LWIP_MEM_ALIGN()

Simon Goldschmidt <goldsimon>
Project AdministratorIn charge of this item.

 

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 uwe (Posted a comment)
  • -unavailable- added by goldsimon (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 10 Jan 2014 08:26:52 PM UTCgoldsimonStatusNone=>Fixed
      Assigned toNone=>goldsimon
      Open/ClosedOpen=>Closed

    Back to the top


    Powered by Savane 3.1-cleanup1