Re: KASAN vs realloc
From: Maciej Żenczykowski
Date: Fri Feb 06 2026 - 14:10:19 EST
While looking at:
https://android-review.git.corp.google.com/c/kernel/common/+/3939998
UPSTREAM: mm/kasan: fix KASAN poisoning in vrealloc()
I noticed a lack of symmetry - I'm not sure if it's a problem or not...
but I'd have expected kasan_poison_last_granule() to be called
regardless of whether the size shrunk or increased.
It is of course possible this is handled automatically by
__kasan_unpoison_vmalloc() - I haven't traced that deep,
in general these functions seem to have a terrible api surface full of
razors... with hidden assumptions about what is and is not granule
aligned.