The patch titled Subject: kasan: memset free track in qlink_free has been added to the -mm mm-nonmm-unstable branch. Its filename is kasan-memset-free-track-in-qlink_free.patch This patch will shortly appear at https://git.kernel.org/pub/scm/linux/kernel/git/akpm/25-new.git/tree/patches/kasan-memset-free-track-in-qlink_free.patch This patch will later appear in the mm-nonmm-unstable branch at git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm Before you just go and hit "reply", please: a) Consider who else should be cc'ed b) Prefer to cc a suitable mailing list as well c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's *** Remember to use Documentation/process/submit-checklist.rst when testing your code *** The -mm tree is included into linux-next via the mm-everything branch at git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm and is updated there every 2-3 working days ------------------------------------------------------ From: Andrey Konovalov <andreyknvl@xxxxxxxxxx> Subject: kasan: memset free track in qlink_free Date: Tue, 19 Dec 2023 22:19:52 +0100 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@xxxxxxxxxx Fixes: 773688a6cb24 ("kasan: use stack_depot_put for Generic mode") Signed-off-by: Andrey Konovalov <andreyknvl@xxxxxxxxxx> Reviewed-by: Marco Elver <elver@xxxxxxxxxx> Cc: Alexander Potapenko <glider@xxxxxxxxxx> Cc: Dmitry Vyukov <dvyukov@xxxxxxxxxx> Cc: Evgenii Stepanov <eugenis@xxxxxxxxxx> Cc: Tetsuo Handa <penguin-kernel@xxxxxxxxxxxxxxxxxxx> Cc: Vlastimil Babka <vbabka@xxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- mm/kasan/quarantine.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/mm/kasan/quarantine.c~kasan-memset-free-track-in-qlink_free +++ a/mm/kasan/quarantine.c @@ -157,7 +157,7 @@ static void qlink_free(struct qlist_node 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)); } /* _ Patches currently in -mm which might be from andreyknvl@xxxxxxxxxx are kasan-rename-kasan_slab_free_mempool-to-kasan_mempool_poison_object.patch kasan-move-kasan_mempool_poison_object.patch kasan-document-kasan_mempool_poison_object.patch kasan-add-return-value-for-kasan_mempool_poison_object.patch kasan-introduce-kasan_mempool_unpoison_object.patch kasan-introduce-kasan_mempool_poison_pages.patch kasan-introduce-kasan_mempool_unpoison_pages.patch kasan-clean-up-__kasan_mempool_poison_object.patch kasan-save-free-stack-traces-for-slab-mempools.patch kasan-clean-up-and-rename-____kasan_kmalloc.patch kasan-introduce-poison_kmalloc_large_redzone.patch kasan-save-alloc-stack-traces-for-mempool.patch mempool-skip-slub_debug-poisoning-when-kasan-is-enabled.patch mempool-use-new-mempool-kasan-hooks.patch mempool-introduce-mempool_use_prealloc_only.patch kasan-add-mempool-tests.patch kasan-rename-pagealloc-tests.patch kasan-reorder-tests.patch kasan-rename-and-document-kasan_unpoison_object_data.patch skbuff-use-mempool-kasan-hooks.patch io_uring-use-mempool-kasan-hook.patch lib-stackdepot-add-printk_deferred_enter-exit-guards.patch kasan-handle-concurrent-kasan_record_aux_stack-calls.patch kasan-memset-free-track-in-qlink_free.patch lib-stackdepot-fix-comment-in-include-linux-stackdepoth.patch