]> git.dujemihanovic.xyz Git - linux.git/commit
kasan: rust: Add KASAN smoke test via UAF
authorMatthew Maurer <mmaurer@google.com>
Tue, 20 Aug 2024 19:48:59 +0000 (19:48 +0000)
committerMiguel Ojeda <ojeda@kernel.org>
Mon, 16 Sep 2024 16:04:37 +0000 (18:04 +0200)
commita2f11547052001bd448ccec81dd1e68409078fbb
tree8b877782043c1e767f6ecf12fe429ebe138d8ca6
parente3117404b41124c88a4d834fc3222669a880addc
kasan: rust: Add KASAN smoke test via UAF

Adds a smoke test to ensure that KASAN in Rust is actually detecting a
Rust-native UAF. There is significant room to expand this test suite,
but this will at least ensure that flags are having the intended effect.

The rename from kasan_test.c to kasan_test_c.c is in order to allow the
single kasan_test.ko test suite to contain both a .o file produced
by the C compiler and one produced by rustc.

Signed-off-by: Matthew Maurer <mmaurer@google.com>
Reviewed-by: Andrey Konovalov <andreyknvl@gmail.com>
Link: https://lore.kernel.org/r/20240820194910.187826-5-mmaurer@google.com
[ Applied empty line nit, removed double empty line,
  applied `rustfmt` and formatted crate comment. - Miguel ]
Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
mm/kasan/Makefile
mm/kasan/kasan.h
mm/kasan/kasan_test_c.c [moved from mm/kasan/kasan_test.c with 99% similarity]
mm/kasan/kasan_test_rust.rs [new file with mode: 0644]