lwip-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [lwip-devel] [EXTERNAL] [bug #61126] ram_end write outside heap...


From: Dag Midling Larsen
Subject: Re: [lwip-devel] [EXTERNAL] [bug #61126] ram_end write outside heap...
Date: Thu, 9 Sep 2021 06:05:52 +0000

Hi

Now I have read the lines [373, 381] in mem.c and understand what you mean.
So I could agree that it's not a bug, but it's an implementation which invites 
for unstable code for the users.
Problem is that (many) users normally don't read .c files/implementation unless 
there is a problem or issue.

An example of how an issue sneaks in:
St, a microcontroller provider has this lots of example projects. E.g. this:
STM32Cube\Repository\STM32Cube_FW_H7_V1.8.0\Projects\NUCLEO-H743ZI\Applications\LwIP\LwIP_HTTP_Server_Netconn_RTOS
This example project lwipopts.h has these lines:
-----
/* MEM_SIZE: the size of the heap memory. If the application will send
a lot of data that needs to be copied, this should be set high. */
#define MEM_SIZE                (10*1024)

/* Relocate the LwIP RAM heap pointer */
#define LWIP_RAM_HEAP_POINTER    (0x30044000)
-----

Now lwip mem.c implementation writes outside the memory range indicated above.
Which is a big, big surprise.

In my opinion it would be better to spend a few bytes of the memory range 
specified by the user for the mem-struct's.

Regards,
Dag




-----Original Message-----
From: Simon Goldschmidt <INVALID.NOREPLY@gnu.org> 
Sent: Wednesday, September 8, 2021 7:31 PM
To: Simon Goldschmidt <goldsimon@gmx.de>; Dag Midling Larsen 
<DLarsen@shearwatergeo.com>; lwip-devel@nongnu.org; lwip-members@nongnu.org
Subject: [EXTERNAL] [bug #61126] ram_end write outside heap...

CAUTION:  This email originated from outside your organization. Exercise 
caution when opening attachments or clicking links, especially from unknown 
senders.

Update of bug #61126 (project lwip):

                  Status:                    None => Invalid                
             Assigned to:                    None => goldsimon              
             Open/Closed:                    Open => Closed                 

    _______________________________________________________

Follow-up Comment #1:

Why do you think so? 'ram_heap' is allocated like this:

uint8_t ram_heap[MEM_SIZE_ALIGNED + (2U * SIZEOF_STRUCT_MEM)];

so writing to a struct mem * which is calculated by 
'ram_heap[MEM_SIZE_ALIGNED]' should surely work, no?

I'll close this as invalid, but you can still respond here if you think 
otherwise. Or if I'm missing something.

    _______________________________________________________

Reply to this item at:

  
<https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Furldefense.com%2Fv3%2F__https%3A%2F%2Fsavannah.nongnu.org%2Fbugs%2F%3F61126__%3B!!BgN1JKhRo9Eh4Q!EViCV5DD23NUD3rhnNdk_y8TOfviNuperQH3qv-iD9Q39BDXNNT4i2sE3ZrBwF00cjg%24&amp;data=04%7C01%7Cdlarsen%40shearwatergeo.com%7C6219ee1c25f34a9c996e08d972ee7700%7C9209ee24f11743b385d986cc9263c8a4%7C1%7C0%7C637667190831880975%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&amp;sdata=LFoYwpDmN2EW%2BuEm%2FFeU0dvx4Xd7zyoxXD7Z4Sjtank%3D&amp;reserved=0
 >

_______________________________________________
  Message sent via Savannah
  
https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Furldefense.com%2Fv3%2F__https%3A%2F%2Fsavannah.nongnu.org%2F__%3B!!BgN1JKhRo9Eh4Q!EViCV5DD23NUD3rhnNdk_y8TOfviNuperQH3qv-iD9Q39BDXNNT4i2sE3ZrBmx0jveA%24&amp;data=04%7C01%7Cdlarsen%40shearwatergeo.com%7C6219ee1c25f34a9c996e08d972ee7700%7C9209ee24f11743b385d986cc9263c8a4%7C1%7C0%7C637667190831880975%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&amp;sdata=j85fLKtUycVJ7aWtSZ7sZzqDoMfB%2BY6v47kD%2F79ojOQ%3D&amp;reserved=0
 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]