Hay
Date
July 10, 2025, 9:07 a.m.

Environment
qemu-arm64
qemu-x86_64

[   29.926630] ==================================================================
[   29.926727] BUG: KASAN: slab-use-after-free in workqueue_uaf+0x480/0x4a8
[   29.926811] Read of size 8 at addr fff00000c999de80 by task kunit_try_catch/231
[   29.926932] 
[   29.926991] CPU: 0 UID: 0 PID: 231 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc5-next-20250710 #1 PREEMPT 
[   29.927182] Tainted: [B]=BAD_PAGE, [N]=TEST
[   29.927244] Hardware name: linux,dummy-virt (DT)
[   29.927322] Call trace:
[   29.927380]  show_stack+0x20/0x38 (C)
[   29.927433]  dump_stack_lvl+0x8c/0xd0
[   29.927479]  print_report+0x118/0x5d0
[   29.927528]  kasan_report+0xdc/0x128
[   29.927571]  __asan_report_load8_noabort+0x20/0x30
[   29.927878]  workqueue_uaf+0x480/0x4a8
[   29.928008]  kunit_try_run_case+0x170/0x3f0
[   29.928106]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   29.928252]  kthread+0x328/0x630
[   29.928320]  ret_from_fork+0x10/0x20
[   29.928416] 
[   29.928523] Allocated by task 231:
[   29.928601]  kasan_save_stack+0x3c/0x68
[   29.928699]  kasan_save_track+0x20/0x40
[   29.928793]  kasan_save_alloc_info+0x40/0x58
[   29.928869]  __kasan_kmalloc+0xd4/0xd8
[   29.928910]  __kmalloc_cache_noprof+0x16c/0x3c0
[   29.929169]  workqueue_uaf+0x13c/0x4a8
[   29.929292]  kunit_try_run_case+0x170/0x3f0
[   29.929384]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   29.929507]  kthread+0x328/0x630
[   29.929577]  ret_from_fork+0x10/0x20
[   29.929616] 
[   29.929637] Freed by task 75:
[   29.929673]  kasan_save_stack+0x3c/0x68
[   29.929713]  kasan_save_track+0x20/0x40
[   29.929751]  kasan_save_free_info+0x4c/0x78
[   29.929789]  __kasan_slab_free+0x6c/0x98
[   29.929826]  kfree+0x214/0x3c8
[   29.929861]  workqueue_uaf_work+0x18/0x30
[   29.929900]  process_one_work+0x530/0xf98
[   29.929939]  worker_thread+0x618/0xf38
[   29.929975]  kthread+0x328/0x630
[   29.930008]  ret_from_fork+0x10/0x20
[   29.930054] 
[   29.930073] Last potentially related work creation:
[   29.930101]  kasan_save_stack+0x3c/0x68
[   29.930160]  kasan_record_aux_stack+0xb4/0xc8
[   29.930209]  __queue_work+0x65c/0xfe0
[   29.930249]  queue_work_on+0xbc/0xf8
[   29.930285]  workqueue_uaf+0x210/0x4a8
[   29.930321]  kunit_try_run_case+0x170/0x3f0
[   29.930369]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   29.930422]  kthread+0x328/0x630
[   29.930469]  ret_from_fork+0x10/0x20
[   29.930514] 
[   29.930533] The buggy address belongs to the object at fff00000c999de80
[   29.930533]  which belongs to the cache kmalloc-32 of size 32
[   29.930598] The buggy address is located 0 bytes inside of
[   29.930598]  freed 32-byte region [fff00000c999de80, fff00000c999dea0)
[   29.930681] 
[   29.930701] The buggy address belongs to the physical page:
[   29.930734] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x10999d
[   29.930785] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   29.930833] page_type: f5(slab)
[   29.930877] raw: 0bfffe0000000000 fff00000c0001780 dead000000000122 0000000000000000
[   29.930933] raw: 0000000000000000 0000000080400040 00000000f5000000 0000000000000000
[   29.930981] page dumped because: kasan: bad access detected
[   29.931023] 
[   29.931043] Memory state around the buggy address:
[   29.931083]  fff00000c999dd80: 00 00 03 fc fc fc fc fc 00 00 07 fc fc fc fc fc
[   29.931607]  fff00000c999de00: 00 00 00 fc fc fc fc fc 00 00 00 07 fc fc fc fc
[   29.931666] >fff00000c999de80: fa fb fb fb fc fc fc fc 00 00 00 fc fc fc fc fc
[   29.931706]                    ^
[   29.931735]  fff00000c999df00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   29.931780]  fff00000c999df80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   29.931820] ==================================================================

[   25.678858] ==================================================================
[   25.679253] BUG: KASAN: slab-use-after-free in workqueue_uaf+0x4d6/0x560
[   25.679556] Read of size 8 at addr ffff8881043c0600 by task kunit_try_catch/248
[   25.680028] 
[   25.680155] CPU: 1 UID: 0 PID: 248 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc5-next-20250710 #1 PREEMPT(voluntary) 
[   25.680206] Tainted: [B]=BAD_PAGE, [N]=TEST
[   25.680219] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   25.680241] Call Trace:
[   25.680255]  <TASK>
[   25.680274]  dump_stack_lvl+0x73/0xb0
[   25.680304]  print_report+0xd1/0x610
[   25.680327]  ? __virt_addr_valid+0x1db/0x2d0
[   25.680353]  ? workqueue_uaf+0x4d6/0x560
[   25.680374]  ? kasan_complete_mode_report_info+0x64/0x200
[   25.680399]  ? workqueue_uaf+0x4d6/0x560
[   25.680420]  kasan_report+0x141/0x180
[   25.680442]  ? workqueue_uaf+0x4d6/0x560
[   25.680467]  __asan_report_load8_noabort+0x18/0x20
[   25.680505]  workqueue_uaf+0x4d6/0x560
[   25.680527]  ? __pfx_workqueue_uaf+0x10/0x10
[   25.680549]  ? __schedule+0x10cc/0x2b60
[   25.680571]  ? __pfx_read_tsc+0x10/0x10
[   25.680593]  ? ktime_get_ts64+0x86/0x230
[   25.680618]  kunit_try_run_case+0x1a5/0x480
[   25.680640]  ? __pfx_kunit_try_run_case+0x10/0x10
[   25.680660]  ? _raw_spin_lock_irqsave+0xa1/0x100
[   25.680683]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   25.680718]  ? __kthread_parkme+0x82/0x180
[   25.680739]  ? preempt_count_sub+0x50/0x80
[   25.680763]  ? __pfx_kunit_try_run_case+0x10/0x10
[   25.680820]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   25.680846]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   25.680871]  kthread+0x337/0x6f0
[   25.680890]  ? trace_preempt_on+0x20/0xc0
[   25.680913]  ? __pfx_kthread+0x10/0x10
[   25.680934]  ? _raw_spin_unlock_irq+0x47/0x80
[   25.680955]  ? calculate_sigpending+0x7b/0xa0
[   25.680979]  ? __pfx_kthread+0x10/0x10
[   25.681000]  ret_from_fork+0x116/0x1d0
[   25.681019]  ? __pfx_kthread+0x10/0x10
[   25.681039]  ret_from_fork_asm+0x1a/0x30
[   25.681069]  </TASK>
[   25.681081] 
[   25.690963] Allocated by task 248:
[   25.691134]  kasan_save_stack+0x45/0x70
[   25.691324]  kasan_save_track+0x18/0x40
[   25.691778]  kasan_save_alloc_info+0x3b/0x50
[   25.692037]  __kasan_kmalloc+0xb7/0xc0
[   25.692362]  __kmalloc_cache_noprof+0x189/0x420
[   25.692716]  workqueue_uaf+0x152/0x560
[   25.693072]  kunit_try_run_case+0x1a5/0x480
[   25.693277]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   25.693733]  kthread+0x337/0x6f0
[   25.694190]  ret_from_fork+0x116/0x1d0
[   25.694380]  ret_from_fork_asm+0x1a/0x30
[   25.694945] 
[   25.695121] Freed by task 44:
[   25.695265]  kasan_save_stack+0x45/0x70
[   25.695448]  kasan_save_track+0x18/0x40
[   25.695993]  kasan_save_free_info+0x3f/0x60
[   25.696268]  __kasan_slab_free+0x56/0x70
[   25.696757]  kfree+0x222/0x3f0
[   25.697136]  workqueue_uaf_work+0x12/0x20
[   25.697336]  process_one_work+0x5ee/0xf60
[   25.697660]  worker_thread+0x758/0x1220
[   25.697973]  kthread+0x337/0x6f0
[   25.698260]  ret_from_fork+0x116/0x1d0
[   25.698456]  ret_from_fork_asm+0x1a/0x30
[   25.698780] 
[   25.698899] Last potentially related work creation:
[   25.699275]  kasan_save_stack+0x45/0x70
[   25.699648]  kasan_record_aux_stack+0xb2/0xc0
[   25.699999]  __queue_work+0x61a/0xe70
[   25.700328]  queue_work_on+0xb6/0xc0
[   25.700644]  workqueue_uaf+0x26d/0x560
[   25.700985]  kunit_try_run_case+0x1a5/0x480
[   25.701189]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   25.701419]  kthread+0x337/0x6f0
[   25.701879]  ret_from_fork+0x116/0x1d0
[   25.702262]  ret_from_fork_asm+0x1a/0x30
[   25.702611] 
[   25.702723] The buggy address belongs to the object at ffff8881043c0600
[   25.702723]  which belongs to the cache kmalloc-32 of size 32
[   25.703920] The buggy address is located 0 bytes inside of
[   25.703920]  freed 32-byte region [ffff8881043c0600, ffff8881043c0620)
[   25.704637] 
[   25.704933] The buggy address belongs to the physical page:
[   25.705370] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1043c0
[   25.706168] flags: 0x200000000000000(node=0|zone=2)
[   25.706474] page_type: f5(slab)
[   25.706655] raw: 0200000000000000 ffff888100041780 dead000000000122 0000000000000000
[   25.707183] raw: 0000000000000000 0000000080400040 00000000f5000000 0000000000000000
[   25.707659] page dumped because: kasan: bad access detected
[   25.708064] 
[   25.708292] Memory state around the buggy address:
[   25.708693]  ffff8881043c0500: 00 00 00 fc fc fc fc fc 00 00 03 fc fc fc fc fc
[   25.709461]  ffff8881043c0580: 00 00 07 fc fc fc fc fc 00 00 00 fc fc fc fc fc
[   25.709797] >ffff8881043c0600: fa fb fb fb fc fc fc fc fc fc fc fc fc fc fc fc
[   25.710147]                    ^
[   25.710298]  ffff8881043c0680: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   25.711024]  ffff8881043c0700: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   25.711476] ==================================================================