lists.openwall.net | lists / announce owl-users owl-dev john-users john-dev passwdqc-users yescrypt popa3d-users / oss-security kernel-hardening musl sabotage tlsify passwords / crypt-dev xvendor / Bugtraq Full-Disclosure linux-kernel linux-netdev linux-ext4 linux-hardening linux-cve-announce PHC | |
Open Source and information security mailing list archives
| ||
|
Date: Thu, 9 Sep 2021 09:53:35 -0700 From: Linus Torvalds <torvalds@...ux-foundation.org> To: Marco Elver <elver@...gle.com> Cc: Arnd Bergmann <arnd@...nel.org>, Christoph Hellwig <hch@...radead.org>, Guenter Roeck <linux@...ck-us.net>, Nathan Chancellor <nathan@...nel.org>, Linux Kernel Mailing List <linux-kernel@...r.kernel.org>, llvm@...ts.linux.dev, Nick Desaulniers <ndesaulniers@...gle.com>, Paul Walmsley <paul.walmsley@...ive.com>, Palmer Dabbelt <palmer@...belt.com>, Albert Ou <aou@...s.berkeley.edu>, linux-riscv <linux-riscv@...ts.infradead.org>, Andrey Ryabinin <ryabinin.a.a@...il.com>, Alexander Potapenko <glider@...gle.com>, Dmitry Vyukov <dvyukov@...gle.com>, Andrey Konovalov <andreyknvl@...il.com>, kasan-dev <kasan-dev@...glegroups.com>, Christian König <christian.koenig@....com>, "Pan, Xinhui" <Xinhui.Pan@....com>, amd-gfx list <amd-gfx@...ts.freedesktop.org> Subject: Re: [PATCH] Enable '-Werror' by default for all kernel builds On Thu, Sep 9, 2021 at 4:43 AM Marco Elver <elver@...gle.com> wrote: > > Sure, but the reality is that the real stack size is already doubled > for KASAN. And that should be reflected in Wframe-larger-than. I don't think that's true. Quite the reverse, in fact. Yes, the *dynamic* stack size is doubled due to KASAN, because it will cause much deeper callchains. But the individual frames don't grow that much apart from compilers doing stupid things (ie apparently clang and KASAN_STACK), and if anything, the deeper dynamic call chains means that the individual frame size being small is even *more* important, but we do compensate for the deeper stacks by making THREAD_SIZE_ORDER bigger at least on x86. Honestly, I am not even happy with the current "2048 bytes for 64-bit". The excuse has been that 64-bit needs more stack, but all it ever did was clearly to just allow people to just do bad things. Because a 1kB stack frame is horrendous even in 64-bit. That's not "spill some registers" kind of stack frame. That's "put a big structure on the stack" kind of stack frame regardless of any other issues. And no, "but we have 16kB of stack and we'll switch stacks on interrupts" is not an excuse for one single level to use up 1kB, much less 2kB. Does anybody seriously believe that we don't quite normally have stacks that are easily tens of frames deep? Without having some true "this is the full callchain" information, the best we can do is just limit individual stack frames. And 2kB is *excessive*. Linus
Powered by blists - more mailing lists