The patch titled Subject: ubsan: disable object-size sanitizer under GCC has been added to the -mm tree. Its filename is ubsan-disable-object-size-sanitizer-under-gcc.patch This patch should soon appear at https://ozlabs.org/~akpm/mmots/broken-out/ubsan-disable-object-size-sanitizer-under-gcc.patch and later at https://ozlabs.org/~akpm/mmotm/broken-out/ubsan-disable-object-size-sanitizer-under-gcc.patch Before you just go and hit "reply", please: a) Consider who else should be cc'ed b) Prefer to cc a suitable mailing list as well c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's *** Remember to use Documentation/process/submit-checklist.rst when testing your code *** The -mm tree is included into linux-next and is updated there every 3-4 working days ------------------------------------------------------ From: Kees Cook <keescook@xxxxxxxxxxxx> Subject: ubsan: disable object-size sanitizer under GCC GCC's -fsanitize=object-size (as part of CONFIG_UBSAN_MISC) greatly increases stack utilization. Do not allow this under GCC. Link: https://lkml.kernel.org/r/20201203004437.389959-4-keescook@xxxxxxxxxxxx Link: https://lore.kernel.org/lkml/CAHk-=wjPasyJrDuwDnpHJS2TuQfExwe=px-SzLeN8GFMAQJPmQ@xxxxxxxxxxxxxx/ Signed-off-by: Kees Cook <keescook@xxxxxxxxxxxx> Reviewed-by: Nathan Chancellor <natechancellor@xxxxxxxxx> Suggested-by: Linus Torvalds <torvalds@xxxxxxxxxxxxxxxxxxxx> Cc: Andrey Ryabinin <aryabinin@xxxxxxxxxxxxx> Cc: Ard Biesheuvel <ardb@xxxxxxxxxx> Cc: Arnd Bergmann <arnd@xxxxxxxx> Cc: Dmitry Vyukov <dvyukov@xxxxxxxxxx> Cc: George Popescu <georgepope@xxxxxxxxxxx> Cc: Herbert Xu <herbert@xxxxxxxxxxxxxxxxxxx> Cc: Marco Elver <elver@xxxxxxxxxx> Cc: Masahiro Yamada <masahiroy@xxxxxxxxxx> Cc: Michal Marek <michal.lkml@xxxxxxxxxxx> Cc: Nick Desaulniers <ndesaulniers@xxxxxxxxxx> Cc: Peter Oberparleiter <oberpar@xxxxxxxxxxxxx> Cc: Randy Dunlap <rdunlap@xxxxxxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- lib/Kconfig.ubsan | 3 +++ 1 file changed, 3 insertions(+) --- a/lib/Kconfig.ubsan~ubsan-disable-object-size-sanitizer-under-gcc +++ a/lib/Kconfig.ubsan @@ -113,6 +113,9 @@ config UBSAN_UNSIGNED_OVERFLOW config UBSAN_OBJECT_SIZE def_bool UBSAN_MISC + # gcc hugely expands stack usage with -fsanitize=object-size + # https://lore.kernel.org/lkml/CAHk-=wjPasyJrDuwDnpHJS2TuQfExwe=px-SzLeN8GFMAQJPmQ@xxxxxxxxxxxxxx/ + depends on !CC_IS_GCC depends on $(cc-option,-fsanitize=object-size) config UBSAN_BOOL _ Patches currently in -mm which might be from keescook@xxxxxxxxxxxx are ubsan-remove-redundant-wno-maybe-uninitialized.patch ubsan-move-cc-option-tests-into-kconfig.patch ubsan-disable-object-size-sanitizer-under-gcc.patch ubsan-disable-ubsan_trap-for-allconfig.patch ubsan-enable-for-allconfig-builds.patch ubsan-remove-ubsan_misc-in-favor-of-individual-options.patch ubsan-expand-tests-and-reporting.patch