Hay
Date
July 22, 2025, 2:40 p.m.

Environment
qemu-arm64
qemu-x86_64

[   17.398006] ==================================================================
[   17.398074] BUG: KASAN: slab-use-after-free in kmalloc_double_kzfree+0x168/0x308
[   17.398343] Read of size 1 at addr fff00000c16d06e0 by task kunit_try_catch/194
[   17.398652] 
[   17.398711] CPU: 0 UID: 0 PID: 194 Comm: kunit_try_catch Tainted: G    B            N  6.15.8-rc1 #1 PREEMPT 
[   17.398980] Tainted: [B]=BAD_PAGE, [N]=TEST
[   17.399087] Hardware name: linux,dummy-virt (DT)
[   17.399156] Call trace:
[   17.399258]  show_stack+0x20/0x38 (C)
[   17.399397]  dump_stack_lvl+0x8c/0xd0
[   17.399449]  print_report+0x118/0x5d0
[   17.399492]  kasan_report+0xdc/0x128
[   17.399822]  __kasan_check_byte+0x54/0x70
[   17.399898]  kfree_sensitive+0x30/0xb0
[   17.400035]  kmalloc_double_kzfree+0x168/0x308
[   17.400086]  kunit_try_run_case+0x170/0x3f0
[   17.400136]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   17.400194]  kthread+0x328/0x630
[   17.400257]  ret_from_fork+0x10/0x20
[   17.400316] 
[   17.400336] Allocated by task 194:
[   17.400365]  kasan_save_stack+0x3c/0x68
[   17.400403]  kasan_save_track+0x20/0x40
[   17.400440]  kasan_save_alloc_info+0x40/0x58
[   17.400478]  __kasan_kmalloc+0xd4/0xd8
[   17.400514]  __kmalloc_cache_noprof+0x16c/0x3c0
[   17.400550]  kmalloc_double_kzfree+0xb8/0x308
[   17.400590]  kunit_try_run_case+0x170/0x3f0
[   17.400637]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   17.400694]  kthread+0x328/0x630
[   17.400729]  ret_from_fork+0x10/0x20
[   17.400766] 
[   17.400793] Freed by task 194:
[   17.400817]  kasan_save_stack+0x3c/0x68
[   17.400858]  kasan_save_track+0x20/0x40
[   17.400902]  kasan_save_free_info+0x4c/0x78
[   17.400941]  __kasan_slab_free+0x6c/0x98
[   17.400977]  kfree+0x214/0x3c8
[   17.401015]  kfree_sensitive+0x80/0xb0
[   17.401062]  kmalloc_double_kzfree+0x11c/0x308
[   17.401108]  kunit_try_run_case+0x170/0x3f0
[   17.401155]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   17.401202]  kthread+0x328/0x630
[   17.401244]  ret_from_fork+0x10/0x20
[   17.401278] 
[   17.401588] The buggy address belongs to the object at fff00000c16d06e0
[   17.401588]  which belongs to the cache kmalloc-16 of size 16
[   17.401889] The buggy address is located 0 bytes inside of
[   17.401889]  freed 16-byte region [fff00000c16d06e0, fff00000c16d06f0)
[   17.401960] 
[   17.402396] The buggy address belongs to the physical page:
[   17.402509] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1016d0
[   17.402670] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   17.402758] page_type: f5(slab)
[   17.402870] raw: 0bfffe0000000000 fff00000c0001640 dead000000000122 0000000000000000
[   17.402939] raw: 0000000000000000 0000000080800080 00000000f5000000 0000000000000000
[   17.402980] page dumped because: kasan: bad access detected
[   17.403011] 
[   17.403029] Memory state around the buggy address:
[   17.403237]  fff00000c16d0580: 00 05 fc fc 00 05 fc fc fa fb fc fc fa fb fc fc
[   17.403540]  fff00000c16d0600: fa fb fc fc fa fb fc fc fa fb fc fc fa fb fc fc
[   17.403646] >fff00000c16d0680: fa fb fc fc fa fb fc fc fa fb fc fc fa fb fc fc
[   17.403759]                                                        ^
[   17.403918]  fff00000c16d0700: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   17.404236]  fff00000c16d0780: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   17.404566] ==================================================================

[   11.438607] ==================================================================
[   11.439249] BUG: KASAN: slab-use-after-free in kmalloc_double_kzfree+0x19c/0x350
[   11.439655] Read of size 1 at addr ffff8881014ec8e0 by task kunit_try_catch/212
[   11.440163] 
[   11.440343] CPU: 0 UID: 0 PID: 212 Comm: kunit_try_catch Tainted: G    B            N  6.15.8-rc1 #1 PREEMPT(voluntary) 
[   11.440395] Tainted: [B]=BAD_PAGE, [N]=TEST
[   11.440407] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   11.440429] Call Trace:
[   11.440441]  <TASK>
[   11.440489]  dump_stack_lvl+0x73/0xb0
[   11.440518]  print_report+0xd1/0x610
[   11.440542]  ? __virt_addr_valid+0x1db/0x2d0
[   11.440563]  ? kmalloc_double_kzfree+0x19c/0x350
[   11.440582]  ? kasan_complete_mode_report_info+0x64/0x200
[   11.440603]  ? kmalloc_double_kzfree+0x19c/0x350
[   11.440622]  kasan_report+0x141/0x180
[   11.440644]  ? kmalloc_double_kzfree+0x19c/0x350
[   11.440729]  ? kmalloc_double_kzfree+0x19c/0x350
[   11.440754]  __kasan_check_byte+0x3d/0x50
[   11.440777]  kfree_sensitive+0x22/0x90
[   11.440800]  kmalloc_double_kzfree+0x19c/0x350
[   11.440819]  ? __pfx_kmalloc_double_kzfree+0x10/0x10
[   11.440839]  ? __schedule+0x10c6/0x2b60
[   11.440864]  ? __pfx_read_tsc+0x10/0x10
[   11.440884]  ? ktime_get_ts64+0x86/0x230
[   11.440910]  kunit_try_run_case+0x1a5/0x480
[   11.440936]  ? __pfx_kunit_try_run_case+0x10/0x10
[   11.440955]  ? _raw_spin_lock_irqsave+0xa1/0x100
[   11.440975]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   11.440999]  ? __kthread_parkme+0x82/0x180
[   11.441020]  ? preempt_count_sub+0x50/0x80
[   11.441045]  ? __pfx_kunit_try_run_case+0x10/0x10
[   11.441065]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   11.441087]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   11.441109]  kthread+0x337/0x6f0
[   11.441125]  ? trace_preempt_on+0x20/0xc0
[   11.441148]  ? __pfx_kthread+0x10/0x10
[   11.441165]  ? _raw_spin_unlock_irq+0x47/0x80
[   11.441187]  ? calculate_sigpending+0x7b/0xa0
[   11.441208]  ? __pfx_kthread+0x10/0x10
[   11.441236]  ret_from_fork+0x41/0x80
[   11.441257]  ? __pfx_kthread+0x10/0x10
[   11.441274]  ret_from_fork_asm+0x1a/0x30
[   11.441305]  </TASK>
[   11.441316] 
[   11.450051] Allocated by task 212:
[   11.450279]  kasan_save_stack+0x45/0x70
[   11.450501]  kasan_save_track+0x18/0x40
[   11.450758]  kasan_save_alloc_info+0x3b/0x50
[   11.450971]  __kasan_kmalloc+0xb7/0xc0
[   11.451188]  __kmalloc_cache_noprof+0x189/0x420
[   11.451437]  kmalloc_double_kzfree+0xa9/0x350
[   11.451646]  kunit_try_run_case+0x1a5/0x480
[   11.451791]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   11.451993]  kthread+0x337/0x6f0
[   11.452305]  ret_from_fork+0x41/0x80
[   11.452493]  ret_from_fork_asm+0x1a/0x30
[   11.452691] 
[   11.452790] Freed by task 212:
[   11.452950]  kasan_save_stack+0x45/0x70
[   11.453118]  kasan_save_track+0x18/0x40
[   11.453318]  kasan_save_free_info+0x3f/0x60
[   11.453838]  __kasan_slab_free+0x56/0x70
[   11.454007]  kfree+0x222/0x3f0
[   11.454119]  kfree_sensitive+0x67/0x90
[   11.454262]  kmalloc_double_kzfree+0x12b/0x350
[   11.454554]  kunit_try_run_case+0x1a5/0x480
[   11.454997]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   11.455278]  kthread+0x337/0x6f0
[   11.455495]  ret_from_fork+0x41/0x80
[   11.455654]  ret_from_fork_asm+0x1a/0x30
[   11.455914] 
[   11.456075] The buggy address belongs to the object at ffff8881014ec8e0
[   11.456075]  which belongs to the cache kmalloc-16 of size 16
[   11.456675] The buggy address is located 0 bytes inside of
[   11.456675]  freed 16-byte region [ffff8881014ec8e0, ffff8881014ec8f0)
[   11.457360] 
[   11.457472] The buggy address belongs to the physical page:
[   11.457701] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1014ec
[   11.457936] flags: 0x200000000000000(node=0|zone=2)
[   11.458095] page_type: f5(slab)
[   11.458215] raw: 0200000000000000 ffff888100041640 dead000000000122 0000000000000000
[   11.458930] raw: 0000000000000000 0000000080800080 00000000f5000000 0000000000000000
[   11.459319] page dumped because: kasan: bad access detected
[   11.459833] 
[   11.459923] Memory state around the buggy address:
[   11.460185]  ffff8881014ec780: fa fb fc fc 00 02 fc fc 00 05 fc fc 00 02 fc fc
[   11.460571]  ffff8881014ec800: 00 02 fc fc 00 02 fc fc 00 02 fc fc fa fb fc fc
[   11.460853] >ffff8881014ec880: fa fb fc fc fa fb fc fc fa fb fc fc fa fb fc fc
[   11.461062]                                                        ^
[   11.461275]  ffff8881014ec900: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   11.462088]  ffff8881014ec980: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   11.462750] ==================================================================