kasan: Fix assert judgment condition to correctly detect out-of-bounds causing trampling.
Signed-off-by: cuiziwei <cuiziwei@xiaomi.com>
This commit is contained in:
parent
aead1981a7
commit
4de718f98f
2 changed files with 2 additions and 2 deletions
|
|
@ -248,7 +248,7 @@ void kasan_register(FAR void *addr, FAR size_t *size)
|
|||
|
||||
flags = spin_lock_irqsave(&g_lock);
|
||||
|
||||
DEBUGASSERT(g_region_count <= CONFIG_MM_KASAN_REGIONS);
|
||||
DEBUGASSERT(g_region_count < CONFIG_MM_KASAN_REGIONS);
|
||||
g_region[g_region_count++] = region;
|
||||
|
||||
spin_unlock_irqrestore(&g_lock, flags);
|
||||
|
|
|
|||
|
|
@ -197,7 +197,7 @@ void kasan_register(FAR void *addr, FAR size_t *size)
|
|||
|
||||
flags = spin_lock_irqsave(&g_lock);
|
||||
|
||||
DEBUGASSERT(g_region_count <= CONFIG_MM_KASAN_REGIONS);
|
||||
DEBUGASSERT(g_region_count < CONFIG_MM_KASAN_REGIONS);
|
||||
g_region[g_region_count++] = region;
|
||||
|
||||
spin_unlock_irqrestore(&g_lock, flags);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue