Hay
Date
July 1, 2025, 3:08 p.m.

Environment
qemu-arm64
qemu-x86_64

[   17.548233] ==================================================================
[   17.548328] BUG: KASAN: slab-use-after-free in workqueue_uaf+0x480/0x4a8
[   17.549077] Read of size 8 at addr fff00000c57d1880 by task kunit_try_catch/201
[   17.549730] 
[   17.549889] CPU: 1 UID: 0 PID: 201 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc4 #1 PREEMPT 
[   17.550072] Tainted: [B]=BAD_PAGE, [N]=TEST
[   17.550099] Hardware name: linux,dummy-virt (DT)
[   17.550676] Call trace:
[   17.550801]  show_stack+0x20/0x38 (C)
[   17.551225]  dump_stack_lvl+0x8c/0xd0
[   17.551521]  print_report+0x118/0x608
[   17.551583]  kasan_report+0xdc/0x128
[   17.552660]  __asan_report_load8_noabort+0x20/0x30
[   17.552876]  workqueue_uaf+0x480/0x4a8
[   17.553388]  kunit_try_run_case+0x170/0x3f0
[   17.553486]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   17.553712]  kthread+0x328/0x630
[   17.554020]  ret_from_fork+0x10/0x20
[   17.554397] 
[   17.554620] Allocated by task 201:
[   17.554656]  kasan_save_stack+0x3c/0x68
[   17.555010]  kasan_save_track+0x20/0x40
[   17.555391]  kasan_save_alloc_info+0x40/0x58
[   17.555458]  __kasan_kmalloc+0xd4/0xd8
[   17.555691]  __kmalloc_cache_noprof+0x16c/0x3c0
[   17.555772]  workqueue_uaf+0x13c/0x4a8
[   17.556478]  kunit_try_run_case+0x170/0x3f0
[   17.556953]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   17.557001]  kthread+0x328/0x630
[   17.557034]  ret_from_fork+0x10/0x20
[   17.557071] 
[   17.557091] Freed by task 54:
[   17.557117]  kasan_save_stack+0x3c/0x68
[   17.557157]  kasan_save_track+0x20/0x40
[   17.557558]  kasan_save_free_info+0x4c/0x78
[   17.557618]  __kasan_slab_free+0x6c/0x98
[   17.558602]  kfree+0x214/0x3c8
[   17.558813]  workqueue_uaf_work+0x18/0x30
[   17.559181]  process_one_work+0x530/0xf98
[   17.559387]  worker_thread+0x618/0xf38
[   17.559463]  kthread+0x328/0x630
[   17.559497]  ret_from_fork+0x10/0x20
[   17.559540] 
[   17.559756] Last potentially related work creation:
[   17.560132]  kasan_save_stack+0x3c/0x68
[   17.560705]  kasan_record_aux_stack+0xb4/0xc8
[   17.560910]  __queue_work+0x65c/0x1008
[   17.560952]  queue_work_on+0xbc/0xf8
[   17.561279]  workqueue_uaf+0x210/0x4a8
[   17.561512]  kunit_try_run_case+0x170/0x3f0
[   17.561582]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   17.562004]  kthread+0x328/0x630
[   17.562220]  ret_from_fork+0x10/0x20
[   17.562284] 
[   17.562305] The buggy address belongs to the object at fff00000c57d1880
[   17.562305]  which belongs to the cache kmalloc-32 of size 32
[   17.563284] The buggy address is located 0 bytes inside of
[   17.563284]  freed 32-byte region [fff00000c57d1880, fff00000c57d18a0)
[   17.563507] 
[   17.563548] The buggy address belongs to the physical page:
[   17.563767] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1057d1
[   17.564358] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   17.564655] page_type: f5(slab)
[   17.564700] raw: 0bfffe0000000000 fff00000c0001780 dead000000000122 0000000000000000
[   17.564751] raw: 0000000000000000 0000000080400040 00000000f5000000 0000000000000000
[   17.564794] page dumped because: kasan: bad access detected
[   17.564829] 
[   17.564847] Memory state around the buggy address:
[   17.564885]  fff00000c57d1780: 00 00 03 fc fc fc fc fc 00 00 07 fc fc fc fc fc
[   17.564930]  fff00000c57d1800: 00 00 00 fc fc fc fc fc 00 00 00 07 fc fc fc fc
[   17.565344] >fff00000c57d1880: fa fb fb fb fc fc fc fc 00 00 00 fc fc fc fc fc
[   17.566212]                    ^
[   17.566255]  fff00000c57d1900: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   17.566823]  fff00000c57d1980: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   17.567522] ==================================================================

[   12.210840] ==================================================================
[   12.211569] BUG: KASAN: slab-use-after-free in workqueue_uaf+0x4d6/0x560
[   12.212192] Read of size 8 at addr ffff8881027cfc40 by task kunit_try_catch/217
[   12.212998] 
[   12.213135] CPU: 1 UID: 0 PID: 217 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc4 #1 PREEMPT(voluntary) 
[   12.213185] Tainted: [B]=BAD_PAGE, [N]=TEST
[   12.213197] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   12.213218] Call Trace:
[   12.213231]  <TASK>
[   12.213249]  dump_stack_lvl+0x73/0xb0
[   12.213280]  print_report+0xd1/0x650
[   12.213302]  ? __virt_addr_valid+0x1db/0x2d0
[   12.213325]  ? workqueue_uaf+0x4d6/0x560
[   12.213345]  ? kasan_complete_mode_report_info+0x64/0x200
[   12.213365]  ? workqueue_uaf+0x4d6/0x560
[   12.213385]  kasan_report+0x141/0x180
[   12.213406]  ? workqueue_uaf+0x4d6/0x560
[   12.213430]  __asan_report_load8_noabort+0x18/0x20
[   12.213453]  workqueue_uaf+0x4d6/0x560
[   12.213474]  ? __pfx_workqueue_uaf+0x10/0x10
[   12.213495]  ? __schedule+0x10cc/0x2b60
[   12.213516]  ? __pfx_read_tsc+0x10/0x10
[   12.213535]  ? ktime_get_ts64+0x86/0x230
[   12.213558]  kunit_try_run_case+0x1a5/0x480
[   12.213581]  ? __pfx_kunit_try_run_case+0x10/0x10
[   12.213602]  ? _raw_spin_lock_irqsave+0xa1/0x100
[   12.213625]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   12.213646]  ? __kthread_parkme+0x82/0x180
[   12.213667]  ? preempt_count_sub+0x50/0x80
[   12.213796]  ? __pfx_kunit_try_run_case+0x10/0x10
[   12.213826]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   12.213849]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   12.213871]  kthread+0x337/0x6f0
[   12.213890]  ? trace_preempt_on+0x20/0xc0
[   12.213913]  ? __pfx_kthread+0x10/0x10
[   12.213974]  ? _raw_spin_unlock_irq+0x47/0x80
[   12.213997]  ? calculate_sigpending+0x7b/0xa0
[   12.214019]  ? __pfx_kthread+0x10/0x10
[   12.214048]  ret_from_fork+0x116/0x1d0
[   12.214066]  ? __pfx_kthread+0x10/0x10
[   12.214085]  ret_from_fork_asm+0x1a/0x30
[   12.214116]  </TASK>
[   12.214128] 
[   12.225920] Allocated by task 217:
[   12.226223]  kasan_save_stack+0x45/0x70
[   12.226552]  kasan_save_track+0x18/0x40
[   12.226895]  kasan_save_alloc_info+0x3b/0x50
[   12.227095]  __kasan_kmalloc+0xb7/0xc0
[   12.227273]  __kmalloc_cache_noprof+0x189/0x420
[   12.227480]  workqueue_uaf+0x152/0x560
[   12.227972]  kunit_try_run_case+0x1a5/0x480
[   12.228317]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   12.228572]  kthread+0x337/0x6f0
[   12.228911]  ret_from_fork+0x116/0x1d0
[   12.229111]  ret_from_fork_asm+0x1a/0x30
[   12.229298] 
[   12.229388] Freed by task 41:
[   12.229530]  kasan_save_stack+0x45/0x70
[   12.230340]  kasan_save_track+0x18/0x40
[   12.230539]  kasan_save_free_info+0x3f/0x60
[   12.230879]  __kasan_slab_free+0x56/0x70
[   12.231090]  kfree+0x222/0x3f0
[   12.231243]  workqueue_uaf_work+0x12/0x20
[   12.231425]  process_one_work+0x5ee/0xf60
[   12.231610]  worker_thread+0x758/0x1220
[   12.232145]  kthread+0x337/0x6f0
[   12.232325]  ret_from_fork+0x116/0x1d0
[   12.232470]  ret_from_fork_asm+0x1a/0x30
[   12.232611] 
[   12.232720] Last potentially related work creation:
[   12.233068]  kasan_save_stack+0x45/0x70
[   12.233487]  kasan_record_aux_stack+0xb2/0xc0
[   12.233737]  __queue_work+0x626/0xeb0
[   12.233942]  queue_work_on+0xb6/0xc0
[   12.234120]  workqueue_uaf+0x26d/0x560
[   12.234308]  kunit_try_run_case+0x1a5/0x480
[   12.234499]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   12.234905]  kthread+0x337/0x6f0
[   12.235098]  ret_from_fork+0x116/0x1d0
[   12.235254]  ret_from_fork_asm+0x1a/0x30
[   12.235433] 
[   12.235526] The buggy address belongs to the object at ffff8881027cfc40
[   12.235526]  which belongs to the cache kmalloc-32 of size 32
[   12.236737] The buggy address is located 0 bytes inside of
[   12.236737]  freed 32-byte region [ffff8881027cfc40, ffff8881027cfc60)
[   12.237304] 
[   12.237402] The buggy address belongs to the physical page:
[   12.237638] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1027cf
[   12.238264] flags: 0x200000000000000(node=0|zone=2)
[   12.238505] page_type: f5(slab)
[   12.238657] raw: 0200000000000000 ffff888100041780 dead000000000122 0000000000000000
[   12.239115] raw: 0000000000000000 0000000080400040 00000000f5000000 0000000000000000
[   12.239430] page dumped because: kasan: bad access detected
[   12.239664] 
[   12.239952] Memory state around the buggy address:
[   12.240205]  ffff8881027cfb00: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc
[   12.240514]  ffff8881027cfb80: fa fb fb fb fc fc fc fc 00 00 00 fc fc fc fc fc
[   12.240926] >ffff8881027cfc00: 00 00 00 07 fc fc fc fc fa fb fb fb fc fc fc fc
[   12.241181]                                            ^
[   12.241435]  ffff8881027cfc80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   12.242385]  ffff8881027cfd00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   12.242682] ==================================================================