The patch titled Subject: compiler-attributes-add-__alloc_size-for-better-bounds-checking-fix has been added to the -mm tree. Its filename is compiler-attributes-add-__alloc_size-for-better-bounds-checking-fix.patch This patch should soon appear at https://ozlabs.org/~akpm/mmots/broken-out/compiler-attributes-add-__alloc_size-for-better-bounds-checking-fix.patch and later at https://ozlabs.org/~akpm/mmotm/broken-out/compiler-attributes-add-__alloc_size-for-better-bounds-checking-fix.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: compiler-attributes-add-__alloc_size-for-better-bounds-checking-fix fix warning cc1: warning: unrecognized command line option '-Wno-alloc-size-larger-than' Ew. Thanks for letting me know. I thought I'd verified this existed in gcc going back to 4.9, but it looks like I did something wrong in that test. Link: https://lkml.kernel.org/r/202108202248.921E8C66@keescook Reported-by: Randy Dunlap <rdunlap@xxxxxxxxxxxxx> Cc: Stephen Rothwell <sfr@xxxxxxxxxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/Makefile~compiler-attributes-add-__alloc_size-for-better-bounds-checking-fix +++ a/Makefile @@ -1081,7 +1081,7 @@ KBUILD_CFLAGS += $(call cc-disable-warni ifdef CONFIG_CC_IS_GCC # The allocators already balk at large sizes, so silence the compiler # warnings for bounds checks involving those possible values. -KBUILD_CFLAGS += -Wno-alloc-size-larger-than +KBUILD_CFLAGS += $(call cc-option, -Wno-alloc-size-larger-than) endif # disable invalid "can't wrap" optimizations for signed / pointers _ Patches currently in -mm which might be from keescook@xxxxxxxxxxxx are compiler-attributes-add-__alloc_size-for-better-bounds-checking.patch compiler-attributes-add-__alloc_size-for-better-bounds-checking-fix.patch checkpatch-add-__alloc_size-to-known-attribute.patch slab-clean-up-function-declarations.patch slab-add-__alloc_size-attributes-for-better-bounds-checking.patch mm-page_alloc-add-__alloc_size-attributes-for-better-bounds-checking.patch percpu-add-__alloc_size-attributes-for-better-bounds-checking.patch