mirror of
https://github.com/torvalds/linux.git
synced 2024-11-22 20:22:09 +00:00
2597c9947b
release_free_meta() accesses the shadow directly through the path
kasan_slab_free
__kasan_slab_free
kasan_release_object_meta
release_free_meta
kasan_mem_to_shadow
There are no kasan_arch_is_ready() guards here, allowing an oops when the
shadow is not initialized. The oops can be seen on a Power8 KVM guest.
This patch adds the guard to release_free_meta(), as it's the first level
that specifically requires the shadow.
It is safe to put the guard at the start of this function, before the
stack put: only kasan_save_free_info() can initialize the saved stack,
which itself is guarded with kasan_arch_is_ready() by its caller
poison_slab_object(). If the arch becomes ready before
release_free_meta() then we will not observe KASAN_SLAB_FREE_META in the
object's shadow, so we will not put an uninitialized stack either.
Link: https://lkml.kernel.org/r/20240213033958.139383-1-bgray@linux.ibm.com
Fixes:
|
||
---|---|---|
.. | ||
common.c | ||
generic.c | ||
hw_tags.c | ||
init.c | ||
kasan_test_module.c | ||
kasan_test.c | ||
kasan.h | ||
Makefile | ||
quarantine.c | ||
report_generic.c | ||
report_hw_tags.c | ||
report_sw_tags.c | ||
report_tags.c | ||
report.c | ||
shadow.c | ||
sw_tags.c | ||
tags.c |