• Linus Torvalds's avatar
    kbuild: add '-fno-stack-check' to kernel build options · 3ce120b1
    Linus Torvalds authored
    It appears that hardened gentoo enables "-fstack-check" by default for
    gcc.
    
    That doesn't work _at_all_ for the kernel, because the kernel stack
    doesn't act like a user stack at all: it's much smaller, and it doesn't
    auto-expand on use.  So the extra "probe one page below the stack" code
    generated by -fstack-check just breaks the kernel in horrible ways,
    causing infinite double faults etc.
    
    [ I have to say, that the particular code gcc generates looks very
      stupid even for user space where it works, but that's a separate
      issue.  ]
    Reported-and-tested-by: default avatarAlexander Tsoy <alexander@tsoy.me>
    Reported-and-tested-by: default avatarToralf Förster <toralf.foerster@gmx.de>
    Cc: stable@kernel.org
    Cc: Dave Hansen <dave.hansen@intel.com>
    Cc: Jiri Kosina <jikos@kernel.org>
    Cc: Andy Lutomirski <luto@amacapital.net>
    Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
    3ce120b1
Makefile 58.5 KB