Skip to content

Commit 08d7c94

Browse files
xairyakpm00
authored andcommitted
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: 773688a ("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]>
1 parent a414d42 commit 08d7c94

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

mm/kasan/quarantine.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ static void qlink_free(struct qlist_node *qlink, struct kmem_cache *cache)
157157
if (free_meta &&
158158
*(u8 *)kasan_mem_to_shadow(object) == KASAN_SLAB_FREETRACK) {
159159
stack_depot_put(free_meta->free_track.stack);
160-
free_meta->free_track.stack = 0;
160+
__memset(&free_meta->free_track, 0, sizeof(free_meta->free_track));
161161
}
162162

163163
/*

0 commit comments

Comments
 (0)