Hay
Date
July 12, 2025, 11:09 a.m.

Environment
qemu-arm64

[   19.727968] ==================================================================
[   19.728038] BUG: KASAN: slab-use-after-free in kmalloc_double_kzfree+0x168/0x308
[   19.728100] Read of size 1 at addr fff00000c4561b20 by task kunit_try_catch/193
[   19.728151] 
[   19.728186] CPU: 0 UID: 0 PID: 193 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc5 #1 PREEMPT 
[   19.728272] Tainted: [B]=BAD_PAGE, [N]=TEST
[   19.728298] Hardware name: linux,dummy-virt (DT)
[   19.728331] Call trace:
[   19.728353]  show_stack+0x20/0x38 (C)
[   19.728406]  dump_stack_lvl+0x8c/0xd0
[   19.728453]  print_report+0x118/0x608
[   19.728501]  kasan_report+0xdc/0x128
[   19.728545]  __kasan_check_byte+0x54/0x70
[   19.728593]  kfree_sensitive+0x30/0xb0
[   19.728640]  kmalloc_double_kzfree+0x168/0x308
[   19.728686]  kunit_try_run_case+0x170/0x3f0
[   19.728751]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   19.728801]  kthread+0x328/0x630
[   19.729005]  ret_from_fork+0x10/0x20
[   19.729126] 
[   19.729252] Allocated by task 193:
[   19.729445]  kasan_save_stack+0x3c/0x68
[   19.729784]  kasan_save_track+0x20/0x40
[   19.730207]  kasan_save_alloc_info+0x40/0x58
[   19.730400]  __kasan_kmalloc+0xd4/0xd8
[   19.731106]  __kmalloc_cache_noprof+0x16c/0x3c0
[   19.731630]  kmalloc_double_kzfree+0xb8/0x308
[   19.731726]  kunit_try_run_case+0x170/0x3f0
[   19.732466]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   19.732979]  kthread+0x328/0x630
[   19.733074]  ret_from_fork+0x10/0x20
[   19.733355] 
[   19.733701] Freed by task 193:
[   19.733786]  kasan_save_stack+0x3c/0x68
[   19.734214]  kasan_save_track+0x20/0x40
[   19.734686]  kasan_save_free_info+0x4c/0x78
[   19.734944]  __kasan_slab_free+0x6c/0x98
[   19.735128]  kfree+0x214/0x3c8
[   19.735218]  kfree_sensitive+0x80/0xb0
[   19.735310]  kmalloc_double_kzfree+0x11c/0x308
[   19.735403]  kunit_try_run_case+0x170/0x3f0
[   19.735502]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   19.735606]  kthread+0x328/0x630
[   19.736566]  ret_from_fork+0x10/0x20
[   19.737182] 
[   19.737691] The buggy address belongs to the object at fff00000c4561b20
[   19.737691]  which belongs to the cache kmalloc-16 of size 16
[   19.738189] The buggy address is located 0 bytes inside of
[   19.738189]  freed 16-byte region [fff00000c4561b20, fff00000c4561b30)
[   19.738446] 
[   19.738491] The buggy address belongs to the physical page:
[   19.738569] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x104561
[   19.738702] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   19.739591] page_type: f5(slab)
[   19.739817] raw: 0bfffe0000000000 fff00000c0001640 dead000000000122 0000000000000000
[   19.740177] raw: 0000000000000000 0000000080800080 00000000f5000000 0000000000000000
[   19.740628] page dumped because: kasan: bad access detected
[   19.740858] 
[   19.740988] Memory state around the buggy address:
[   19.741106]  fff00000c4561a00: fa fb fc fc 00 05 fc fc fa fb fc fc fa fb fc fc
[   19.741200]  fff00000c4561a80: fa fb fc fc fa fb fc fc fa fb fc fc fa fb fc fc
[   19.741283] >fff00000c4561b00: fa fb fc fc fa fb fc fc fc fc fc fc fc fc fc fc
[   19.741351]                                ^
[   19.742063]  fff00000c4561b80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   19.742305]  fff00000c4561c00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   19.742407] ==================================================================