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

Submitter:  Simon Goldschmidt <goldsimon>
Submitted:  Fri 10 Jan 2014 03:23:52 PM UTC
   
 
Category:  pbufs Severity:  3 - Normal
Item Group:  Crash Error Status:  Fixed
Privacy:  Public Assigned to:  goldsimon
Open/Closed:  Closed Planned 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>
Group administrator

 

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

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by uwe (Posted a comment)
  • -email is unavailable- added by goldsimon (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 3 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2014-01-10 goldsimon StatusNone Fixed
        Assigned toNone goldsimon
        Open/ClosedOpen Closed

    Back to the top

    Powered by Savane 3.13-caa5.
    Corresponding source code