diff options
author | Andrey Konovalov <[email protected]> | 2023-12-26 23:51:21 +0100 |
---|---|---|
committer | Andrew Morton <[email protected]> | 2024-01-05 10:17:45 -0800 |
commit | 63b85ac56a6498476fb34402c10a3f431f62f35c (patch) | |
tree | e626cddb5fe5dc2f7d8a693b96e8cf8ffb54bbc2 /net/lapb/lapb_out.c | |
parent | 7eb2d01a1bea78310a83bdebc880625c03cb94f6 (diff) |
kasan: stop leaking stack trace handles
Commit 773688a6cb24 ("kasan: use stack_depot_put for Generic mode") added
support for stack trace eviction for Generic KASAN.
However, that commit didn't evict stack traces when the object is not put
into quarantine. As a result, some stack traces are never evicted from
the stack depot.
In addition, with the "kasan: save mempool stack traces" series, the free
stack traces for mempool objects are also not properly evicted from the
stack depot.
Fix both issues by:
1. Evicting all stack traces when an object if freed if it was not put
into quarantine;
2. Always evicting an existing free stack trace when a new one is saved.
Also do a few related clean-ups:
- Do not zero out free track when initializing/invalidating free meta:
set a value in shadow memory instead;
- Rename KASAN_SLAB_FREETRACK to KASAN_SLAB_FREE_META;
- Drop the kasan_init_cache_meta function as it's not used by KASAN;
- Add comments for the kasan_alloc_meta and kasan_free_meta structs.
[[email protected]: make release_free_meta() and release_alloc_meta() static]
Link: https://lkml.kernel.org/r/[email protected]
Fixes: 773688a6cb24 ("kasan: use stack_depot_put for Generic mode")
Signed-off-by: Andrey Konovalov <[email protected]>
Cc: Alexander Potapenko <[email protected]>
Cc: Andrey Ryabinin <[email protected]>
Cc: Dmitry Vyukov <[email protected]>
Cc: Marco Elver <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Diffstat (limited to 'net/lapb/lapb_out.c')
0 files changed, 0 insertions, 0 deletions