mm/kasan: fix kasan_is_poisoned check error
When size is less than or equal to KASAN_SHADOW_SCALE, no check will be performed We need to check whether the memory is accessible based on bit Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
This commit is contained in:
parent
13a0682340
commit
1771d233c9
@ -211,6 +211,11 @@ bool kasan_is_poisoned(FAR const void *addr, size_t size)
|
||||
return false;
|
||||
}
|
||||
|
||||
if (size <= KASAN_SHADOW_SCALE)
|
||||
{
|
||||
return ((*p >> bit) & 1);
|
||||
}
|
||||
|
||||
nbit = KASAN_BITS_PER_WORD - bit % KASAN_BITS_PER_WORD;
|
||||
mask = KASAN_FIRST_WORD_MASK(bit);
|
||||
size /= KASAN_SHADOW_SCALE;
|
||||
|
Loading…
Reference in New Issue
Block a user