tech-kern archive

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

alloca() in kernel code



Hello

I recently encountered a situation where I had to deal with variable
length structure at a time where kernel dynamic allocator was not
initialized. 

Using alloca() to have the data allocated on stack seemed attractive,
but unfortunately kernel build infrastructure ban that:

error: stack protector not protecting local variables: variable length
buffer [-Werror=stack-protector]

As a result, I have to rely on a fixed-size buffer big enough so that I
can hope data will fit, and miserabily fail otherwise.

Is it possible to relax the protection on some code section? Or is there
an alternative way of dealing with that?

-- 
Emmanuel Dreyfus
http://hcpnet.free.fr/pubz
manu%netbsd.org@localhost


Home | Main Index | Thread Index | Old Index