[SLOF] [PATCH v2 07/11] libnet: Wire up pxelinux.cfg network booting

Thomas Huth thuth at redhat.com
Fri May 25 14:42:04 AEST 2018


On 25.05.2018 04:44, Alexey Kardashevskiy wrote:
> On 25/5/18 12:39 am, Thomas Huth wrote:
>> On 24.05.2018 11:01, Alexey Kardashevskiy wrote:
[...]
>>>  And why static?
>>
>> Allocating big buffers on the stack is always critical within paflof,
>> we've seen more than enough buffer overruns in the past already. But I
>> could malloc() the buffer instead if you prefer that.
> 
> It is just 2KB, is it still too much for slof? And when it is static - this
> space is always taken even if pxelinux is not used so malloc seems
> appropriate here.

Yeah, stack size is very, very sensitive, since a lot of code is calling
engine() recursively, and this uses quite some bit of stack space each
time. See commits 8c41240bc4e9, 271fd45605c11, baa834884c90, ... for
example.

So I'll try to switch to malloc here instead.

 Thomas


PS:
By the way, something for our TODO lists: We really should add some
logic to the libc free() function to merge freed memory blocks again if
possible...


More information about the SLOF mailing list