mirror of
https://github.com/opnsense/src.git
synced 2026-06-08 16:22:46 -04:00
kasan: disable kasan_mark() after a violation
Specifically, when we receive a violation and we're configured to panic, kasan_enabled gets unset before we descend into panic(). At this point, there's no longer any reason to allow marking as kasan_shadow_check() is disabled -- we have some inherent risk of faulting or panicking if the system's in a bad enough state with no benefit. Reviewed by: markj Sponsored by: Juniper Networks, Inc. Sponsored by: Klara, Inc. Differential Revision: https://reviews.freebsd.org/D36742
This commit is contained in:
parent
27d673fbbb
commit
f2963b530e
1 changed files with 3 additions and 0 deletions
|
|
@ -257,6 +257,9 @@ kasan_mark(const void *addr, size_t size, size_t redzsize, uint8_t code)
|
|||
size_t i, n, redz;
|
||||
int8_t *shad;
|
||||
|
||||
if (__predict_false(!kasan_enabled))
|
||||
return;
|
||||
|
||||
if ((vm_offset_t)addr >= DMAP_MIN_ADDRESS &&
|
||||
(vm_offset_t)addr < DMAP_MAX_ADDRESS)
|
||||
return;
|
||||
|
|
|
|||
Loading…
Reference in a new issue