Compiler Attributes: Add __alloc_size for better bounds checking fix
Adjust the warning logic to deal with pre-9.1 gcc behaviors.
Link: https://lkml.kernel.org/r/20210827151327.2729736-1-keescook@chromium.org
Signed-off-by: Kees Cook <keescook@chromium.org>
Reported-by: Randy Dunlap <rdunlap@infradead.org>
Tested-by: Randy Dunlap <rdunlap@infradead.org>
Cc: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>