diff options
author | Andrey Konovalov <[email protected]> | 2023-12-19 22:19:52 +0100 |
---|---|---|
committer | Andrew Morton <[email protected]> | 2023-12-29 11:58:42 -0800 |
commit | 08d7c94d9635cf3fdffcab5f066d857efbad9507 (patch) | |
tree | 8db561e6483e3c397d585d4ef4e65b581581ef91 | |
parent | a414d4286f3400aa05631c4931eb3feba83e29e8 (diff) |
kasan: memset free track in qlink_free
Instead of only zeroing out the stack depot handle when evicting the
free stack trace in qlink_free, zero out the whole track.
Do this just to produce a similar effect for alloc and free meta. The
other fields of the free track besides the stack trace handle are
considered invalid at this point anyway, so no harm in zeroing them out.
Link: https://lkml.kernel.org/r/db987c1cd011547e85353b0b9997de190c97e3e6.1703020707.git.andreyknvl@google.com
Fixes: 773688a6cb24 ("kasan: use stack_depot_put for Generic mode")
Signed-off-by: Andrey Konovalov <[email protected]>
Reviewed-by: Marco Elver <[email protected]>
Cc: Alexander Potapenko <[email protected]>
Cc: Dmitry Vyukov <[email protected]>
Cc: Evgenii Stepanov <[email protected]>
Cc: Tetsuo Handa <[email protected]>
Cc: Vlastimil Babka <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
-rw-r--r-- | mm/kasan/quarantine.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/mm/kasan/quarantine.c b/mm/kasan/quarantine.c index 265ca2bbe2dd..782e045da911 100644 --- a/mm/kasan/quarantine.c +++ b/mm/kasan/quarantine.c @@ -157,7 +157,7 @@ static void qlink_free(struct qlist_node *qlink, struct kmem_cache *cache) if (free_meta && *(u8 *)kasan_mem_to_shadow(object) == KASAN_SLAB_FREETRACK) { stack_depot_put(free_meta->free_track.stack); - free_meta->free_track.stack = 0; + __memset(&free_meta->free_track, 0, sizeof(free_meta->free_track)); } /* |