summaryrefslogtreecommitdiff
path: root/mm/slab_common.c
diff options
context:
space:
mode:
authorMarco Elver <elver@google.com>2022-01-15 01:04:51 +0300
committerLinus Torvalds <torvalds@linux-foundation.org>2022-01-15 17:30:26 +0300
commite5f4728767d2ec9e3eb122c74e224242d21ee650 (patch)
treedde1ea2b05366e1f485fbc629af770c37bb1d7ba /mm/slab_common.c
parent14606001efb48a17be31a5bec626c13ca49d783a (diff)
downloadlinux-e5f4728767d2ec9e3eb122c74e224242d21ee650.tar.xz
kasan: test: add globals left-out-of-bounds test
Add a test checking that KASAN generic can also detect out-of-bounds accesses to the left of globals. Unfortunately it seems that GCC doesn't catch this (tested GCC 10, 11). The main difference between GCC's globals redzoning and Clang's is that GCC relies on using increased alignment to producing padding, where Clang's redzoning implementation actually adds real data after the global and doesn't rely on alignment to produce padding. I believe this is the main reason why GCC can't reliably catch globals out-of-bounds in this case. Given this is now a known issue, to avoid failing the whole test suite, skip this test case with GCC. Link: https://lkml.kernel.org/r/20211117130714.135656-1-elver@google.com Signed-off-by: Marco Elver <elver@google.com> Reported-by: Kaiwan N Billimoria <kaiwan.billimoria@gmail.com> Reviewed-by: Andrey Konovalov <andreyknvl@gmail.com> Cc: Alexander Potapenko <glider@google.com> Cc: Andrey Ryabinin <ryabinin.a.a@gmail.com> Cc: Dmitry Vyukov <dvyukov@google.com> Cc: Kaiwan N Billimoria <kaiwan.billimoria@gmail.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm/slab_common.c')
0 files changed, 0 insertions, 0 deletions