diff --git a/mm/kasan/generic.c b/mm/kasan/generic.c index de5a5e3476..fc2bb98820 100644 --- a/mm/kasan/generic.c +++ b/mm/kasan/generic.c @@ -24,6 +24,7 @@ * Included Files ****************************************************************************/ +#include #include #include @@ -210,6 +211,7 @@ bool kasan_is_poisoned(FAR const void *addr, size_t size) nbit = KASAN_BITS_PER_WORD - bit % KASAN_BITS_PER_WORD; mask = KASAN_FIRST_WORD_MASK(bit); + size = ALIGN_UP(size, KASAN_SHADOW_SCALE); size /= KASAN_SHADOW_SCALE; while (size >= nbit)