tech-kern archive

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

Re: kernel stack usage



On 04.07.2020 14:00, Jaromír Doleček wrote:
> Can anybody using clang please confirm kernel build with
> -Wframe-larger-than=3584?
> 

NetBSD-current from today, amd64 GENERIC builds for me.

> Kamil - what's the difference in gcc between -Wframe-larger-than= and
> -Wstack-size= ?
> 

-Wstack-size doesn't exist?

> I see according to gcc documentation -Wframe-larger-than doesn't count
> size for alloca() and variable-length arrays, which makes it much less
> useful than -Wstack-usage.
> 

It's not a problem.

Whenever alloca or VLA is in use, it's already breaking the stack
protector. There are a few exceptions registered in sys/conf/ssp.mk.

We could add -Walloca -Wvla for USE_SSP=yes builds to catch quickly
inappropriate usage (frequently violated by code optimizer).


On 04.07.2020 14:10, Martin Husemann wrote:
> On Sat, Jul 04, 2020 at 02:00:04PM +0200, Jaromír Dole?ek wrote:
>> Can anybody using clang please confirm kernel build with
>> -Wframe-larger-than=3584?
>
> Side note: 3584 is inacceptably large, we need to trim it down to ~1k.
>

Setting it to 3584 is a good start, it can be lowered later to 1024.

Attachment: signature.asc
Description: OpenPGP digital signature



Home | Main Index | Thread Index | Old Index