Hay
Date
May 15, 2025, 10:38 a.m.

Environment
qemu-arm64
qemu-x86_64

[   18.221352] ==================================================================
[   18.221471] BUG: KASAN: slab-use-after-free in kmalloc_double_kzfree+0x168/0x308
[   18.221541] Read of size 1 at addr fff00000c5ccd320 by task kunit_try_catch/192
[   18.221590] 
[   18.222037] CPU: 1 UID: 0 PID: 192 Comm: kunit_try_catch Tainted: G    B            N  6.15.0-rc6-next-20250515 #1 PREEMPT 
[   18.222425] Tainted: [B]=BAD_PAGE, [N]=TEST
[   18.222636] Hardware name: linux,dummy-virt (DT)
[   18.222777] Call trace:
[   18.222801]  show_stack+0x20/0x38 (C)
[   18.223212]  dump_stack_lvl+0x8c/0xd0
[   18.223674]  print_report+0x118/0x608
[   18.223799]  kasan_report+0xdc/0x128
[   18.223952]  __kasan_check_byte+0x54/0x70
[   18.224172]  kfree_sensitive+0x30/0xb0
[   18.224402]  kmalloc_double_kzfree+0x168/0x308
[   18.224612]  kunit_try_run_case+0x170/0x3f0
[   18.224901]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   18.224973]  kthread+0x328/0x630
[   18.225466]  ret_from_fork+0x10/0x20
[   18.225943] 
[   18.225996] Allocated by task 192:
[   18.226070]  kasan_save_stack+0x3c/0x68
[   18.226131]  kasan_save_track+0x20/0x40
[   18.226199]  kasan_save_alloc_info+0x40/0x58
[   18.226603]  __kasan_kmalloc+0xd4/0xd8
[   18.226710]  __kmalloc_cache_noprof+0x15c/0x3c0
[   18.227002]  kmalloc_double_kzfree+0xb8/0x308
[   18.227194]  kunit_try_run_case+0x170/0x3f0
[   18.227345]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   18.227608]  kthread+0x328/0x630
[   18.228145]  ret_from_fork+0x10/0x20
[   18.228362] 
[   18.228596] Freed by task 192:
[   18.228695]  kasan_save_stack+0x3c/0x68
[   18.228834]  kasan_save_track+0x20/0x40
[   18.228932]  kasan_save_free_info+0x4c/0x78
[   18.229052]  __kasan_slab_free+0x6c/0x98
[   18.229209]  kfree+0x214/0x3c8
[   18.229592]  kfree_sensitive+0x80/0xb0
[   18.229860]  kmalloc_double_kzfree+0x11c/0x308
[   18.230171]  kunit_try_run_case+0x170/0x3f0
[   18.230411]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   18.230643]  kthread+0x328/0x630
[   18.230780]  ret_from_fork+0x10/0x20
[   18.230866] 
[   18.230936] The buggy address belongs to the object at fff00000c5ccd320
[   18.230936]  which belongs to the cache kmalloc-16 of size 16
[   18.231406] The buggy address is located 0 bytes inside of
[   18.231406]  freed 16-byte region [fff00000c5ccd320, fff00000c5ccd330)
[   18.231516] 
[   18.231562] The buggy address belongs to the physical page:
[   18.231793] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x105ccd
[   18.231940] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   18.232270] page_type: f5(slab)
[   18.232469] raw: 0bfffe0000000000 fff00000c0001640 dead000000000122 0000000000000000
[   18.232550] raw: 0000000000000000 0000000080800080 00000000f5000000 0000000000000000
[   18.232678] page dumped because: kasan: bad access detected
[   18.232864] 
[   18.232955] Memory state around the buggy address:
[   18.233305]  fff00000c5ccd200: fa fb fc fc fa fb fc fc 00 04 fc fc fa fb fc fc
[   18.233421]  fff00000c5ccd280: fa fb fc fc fa fb fc fc fa fb fc fc fa fb fc fc
[   18.233581] >fff00000c5ccd300: fa fb fc fc fa fb fc fc fc fc fc fc fc fc fc fc
[   18.233658]                                ^
[   18.233801]  fff00000c5ccd380: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   18.234099]  fff00000c5ccd400: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   18.234305] ==================================================================


[   14.450150] ==================================================================
[   14.451403] BUG: KASAN: slab-use-after-free in kmalloc_double_kzfree+0x19c/0x350
[   14.451962] Read of size 1 at addr ffff888102817b60 by task kunit_try_catch/210
[   14.452682] 
[   14.452853] CPU: 0 UID: 0 PID: 210 Comm: kunit_try_catch Tainted: G    B            N  6.15.0-rc6-next-20250515 #1 PREEMPT(voluntary) 
[   14.452964] Tainted: [B]=BAD_PAGE, [N]=TEST
[   14.452987] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   14.453025] Call Trace:
[   14.453052]  <TASK>
[   14.453092]  dump_stack_lvl+0x73/0xb0
[   14.453168]  print_report+0xd1/0x650
[   14.453216]  ? __virt_addr_valid+0x1db/0x2d0
[   14.453271]  ? kmalloc_double_kzfree+0x19c/0x350
[   14.453298]  ? kasan_complete_mode_report_info+0x64/0x200
[   14.453322]  ? kmalloc_double_kzfree+0x19c/0x350
[   14.453346]  kasan_report+0x141/0x180
[   14.453369]  ? kmalloc_double_kzfree+0x19c/0x350
[   14.453396]  ? kmalloc_double_kzfree+0x19c/0x350
[   14.453420]  __kasan_check_byte+0x3d/0x50
[   14.453443]  kfree_sensitive+0x22/0x90
[   14.453467]  kmalloc_double_kzfree+0x19c/0x350
[   14.453490]  ? __pfx_kmalloc_double_kzfree+0x10/0x10
[   14.453515]  ? __schedule+0x10cc/0x2b60
[   14.453537]  ? __pfx_read_tsc+0x10/0x10
[   14.453559]  ? ktime_get_ts64+0x86/0x230
[   14.453584]  kunit_try_run_case+0x1a5/0x480
[   14.453610]  ? __pfx_kunit_try_run_case+0x10/0x10
[   14.453632]  ? _raw_spin_lock_irqsave+0xa1/0x100
[   14.453656]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   14.453679]  ? __kthread_parkme+0x82/0x180
[   14.453702]  ? preempt_count_sub+0x50/0x80
[   14.453726]  ? __pfx_kunit_try_run_case+0x10/0x10
[   14.453750]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   14.453773]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   14.453796]  kthread+0x337/0x6f0
[   14.453815]  ? trace_preempt_on+0x20/0xc0
[   14.453839]  ? __pfx_kthread+0x10/0x10
[   14.453860]  ? _raw_spin_unlock_irq+0x47/0x80
[   14.453880]  ? calculate_sigpending+0x7b/0xa0
[   14.453906]  ? __pfx_kthread+0x10/0x10
[   14.453928]  ret_from_fork+0x116/0x1d0
[   14.453946]  ? __pfx_kthread+0x10/0x10
[   14.453967]  ret_from_fork_asm+0x1a/0x30
[   14.453999]  </TASK>
[   14.454011] 
[   14.462562] Allocated by task 210:
[   14.462896]  kasan_save_stack+0x45/0x70
[   14.463253]  kasan_save_track+0x18/0x40
[   14.463563]  kasan_save_alloc_info+0x3b/0x50
[   14.463914]  __kasan_kmalloc+0xb7/0xc0
[   14.464241]  __kmalloc_cache_noprof+0x189/0x420
[   14.464484]  kmalloc_double_kzfree+0xa9/0x350
[   14.464682]  kunit_try_run_case+0x1a5/0x480
[   14.465032]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   14.465461]  kthread+0x337/0x6f0
[   14.465699]  ret_from_fork+0x116/0x1d0
[   14.465910]  ret_from_fork_asm+0x1a/0x30
[   14.466216] 
[   14.466407] Freed by task 210:
[   14.466600]  kasan_save_stack+0x45/0x70
[   14.466784]  kasan_save_track+0x18/0x40
[   14.466962]  kasan_save_free_info+0x3f/0x60
[   14.467143]  __kasan_slab_free+0x56/0x70
[   14.467452]  kfree+0x222/0x3f0
[   14.467735]  kfree_sensitive+0x67/0x90
[   14.468049]  kmalloc_double_kzfree+0x12b/0x350
[   14.468409]  kunit_try_run_case+0x1a5/0x480
[   14.468747]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   14.469163]  kthread+0x337/0x6f0
[   14.469461]  ret_from_fork+0x116/0x1d0
[   14.469725]  ret_from_fork_asm+0x1a/0x30
[   14.469916] 
[   14.470027] The buggy address belongs to the object at ffff888102817b60
[   14.470027]  which belongs to the cache kmalloc-16 of size 16
[   14.470855] The buggy address is located 0 bytes inside of
[   14.470855]  freed 16-byte region [ffff888102817b60, ffff888102817b70)
[   14.471530] 
[   14.471722] The buggy address belongs to the physical page:
[   14.471949] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x102817
[   14.472507] flags: 0x200000000000000(node=0|zone=2)
[   14.472871] page_type: f5(slab)
[   14.473074] raw: 0200000000000000 ffff888100041640 dead000000000122 0000000000000000
[   14.473492] raw: 0000000000000000 0000000080800080 00000000f5000000 0000000000000000
[   14.473905] page dumped because: kasan: bad access detected
[   14.474254] 
[   14.474423] Memory state around the buggy address:
[   14.474729]  ffff888102817a00: 00 02 fc fc 00 05 fc fc 00 02 fc fc 00 02 fc fc
[   14.475095]  ffff888102817a80: 00 02 fc fc 00 02 fc fc fa fb fc fc fa fb fc fc
[   14.475543] >ffff888102817b00: fa fb fc fc fa fb fc fc fa fb fc fc fa fb fc fc
[   14.475840]                                                        ^
[   14.476263]  ffff888102817b80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   14.476630]  ffff888102817c00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   14.476927] ==================================================================