Hay
Date
July 10, 2025, 11:10 p.m.

Environment
qemu-arm64
qemu-x86_64

[   16.327388] ==================================================================
[   16.327461] BUG: KASAN: slab-use-after-free in workqueue_uaf+0x480/0x4a8
[   16.327877] Read of size 8 at addr fff00000c6437840 by task kunit_try_catch/200
[   16.327954] 
[   16.328003] CPU: 1 UID: 0 PID: 200 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc5 #1 PREEMPT 
[   16.328155] Tainted: [B]=BAD_PAGE, [N]=TEST
[   16.328182] Hardware name: linux,dummy-virt (DT)
[   16.328253] Call trace:
[   16.328279]  show_stack+0x20/0x38 (C)
[   16.328337]  dump_stack_lvl+0x8c/0xd0
[   16.328389]  print_report+0x118/0x608
[   16.328444]  kasan_report+0xdc/0x128
[   16.328499]  __asan_report_load8_noabort+0x20/0x30
[   16.328552]  workqueue_uaf+0x480/0x4a8
[   16.328597]  kunit_try_run_case+0x170/0x3f0
[   16.328648]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   16.328702]  kthread+0x328/0x630
[   16.328746]  ret_from_fork+0x10/0x20
[   16.328795] 
[   16.328814] Allocated by task 200:
[   16.328843]  kasan_save_stack+0x3c/0x68
[   16.328889]  kasan_save_track+0x20/0x40
[   16.328928]  kasan_save_alloc_info+0x40/0x58
[   16.329140]  __kasan_kmalloc+0xd4/0xd8
[   16.329208]  __kmalloc_cache_noprof+0x16c/0x3c0
[   16.329251]  workqueue_uaf+0x13c/0x4a8
[   16.329297]  kunit_try_run_case+0x170/0x3f0
[   16.329363]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   16.329408]  kthread+0x328/0x630
[   16.329457]  ret_from_fork+0x10/0x20
[   16.329503] 
[   16.329529] Freed by task 47:
[   16.329566]  kasan_save_stack+0x3c/0x68
[   16.329622]  kasan_save_track+0x20/0x40
[   16.329668]  kasan_save_free_info+0x4c/0x78
[   16.329725]  __kasan_slab_free+0x6c/0x98
[   16.329871]  kfree+0x214/0x3c8
[   16.329928]  workqueue_uaf_work+0x18/0x30
[   16.329966]  process_one_work+0x530/0xf98
[   16.330003]  worker_thread+0x618/0xf38
[   16.330061]  kthread+0x328/0x630
[   16.330104]  ret_from_fork+0x10/0x20
[   16.330141] 
[   16.330159] Last potentially related work creation:
[   16.330186]  kasan_save_stack+0x3c/0x68
[   16.330225]  kasan_record_aux_stack+0xb4/0xc8
[   16.330267]  __queue_work+0x65c/0x1008
[   16.330303]  queue_work_on+0xbc/0xf8
[   16.330339]  workqueue_uaf+0x210/0x4a8
[   16.330374]  kunit_try_run_case+0x170/0x3f0
[   16.330413]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   16.330455]  kthread+0x328/0x630
[   16.330488]  ret_from_fork+0x10/0x20
[   16.330668] 
[   16.330720] The buggy address belongs to the object at fff00000c6437840
[   16.330720]  which belongs to the cache kmalloc-32 of size 32
[   16.330813] The buggy address is located 0 bytes inside of
[   16.330813]  freed 32-byte region [fff00000c6437840, fff00000c6437860)
[   16.330913] 
[   16.330992] The buggy address belongs to the physical page:
[   16.331032] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x106437
[   16.331106] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   16.331159] page_type: f5(slab)
[   16.331199] raw: 0bfffe0000000000 fff00000c0001780 dead000000000122 0000000000000000
[   16.331249] raw: 0000000000000000 0000000080400040 00000000f5000000 0000000000000000
[   16.331290] page dumped because: kasan: bad access detected
[   16.331322] 
[   16.331340] Memory state around the buggy address:
[   16.331371]  fff00000c6437700: 00 00 00 fc fc fc fc fc 00 00 03 fc fc fc fc fc
[   16.331414]  fff00000c6437780: 00 00 07 fc fc fc fc fc 00 00 00 fc fc fc fc fc
[   16.331458] >fff00000c6437800: 00 00 00 07 fc fc fc fc fa fb fb fb fc fc fc fc
[   16.331496]                                            ^
[   16.331541]  fff00000c6437880: 00 00 00 fc fc fc fc fc fc fc fc fc fc fc fc fc
[   16.331598]  fff00000c6437900: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   16.331637] ==================================================================

[   13.318502] ==================================================================
[   13.319113] BUG: KASAN: slab-use-after-free in workqueue_uaf+0x4d6/0x560
[   13.319352] Read of size 8 at addr ffff888102d710c0 by task kunit_try_catch/217
[   13.319675] 
[   13.319833] CPU: 1 UID: 0 PID: 217 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc5 #1 PREEMPT(voluntary) 
[   13.319878] Tainted: [B]=BAD_PAGE, [N]=TEST
[   13.319889] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   13.319909] Call Trace:
[   13.319922]  <TASK>
[   13.319939]  dump_stack_lvl+0x73/0xb0
[   13.319970]  print_report+0xd1/0x650
[   13.320017]  ? __virt_addr_valid+0x1db/0x2d0
[   13.320041]  ? workqueue_uaf+0x4d6/0x560
[   13.320061]  ? kasan_complete_mode_report_info+0x64/0x200
[   13.320084]  ? workqueue_uaf+0x4d6/0x560
[   13.320105]  kasan_report+0x141/0x180
[   13.320126]  ? workqueue_uaf+0x4d6/0x560
[   13.320151]  __asan_report_load8_noabort+0x18/0x20
[   13.320201]  workqueue_uaf+0x4d6/0x560
[   13.320224]  ? __pfx_workqueue_uaf+0x10/0x10
[   13.320246]  ? __schedule+0x10cc/0x2b60
[   13.320269]  ? __pfx_read_tsc+0x10/0x10
[   13.320291]  ? ktime_get_ts64+0x86/0x230
[   13.320315]  kunit_try_run_case+0x1a5/0x480
[   13.320340]  ? __pfx_kunit_try_run_case+0x10/0x10
[   13.320383]  ? _raw_spin_lock_irqsave+0xa1/0x100
[   13.320407]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   13.320431]  ? __kthread_parkme+0x82/0x180
[   13.320513]  ? preempt_count_sub+0x50/0x80
[   13.320538]  ? __pfx_kunit_try_run_case+0x10/0x10
[   13.320562]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   13.320586]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   13.320611]  kthread+0x337/0x6f0
[   13.320629]  ? trace_preempt_on+0x20/0xc0
[   13.320653]  ? __pfx_kthread+0x10/0x10
[   13.320673]  ? _raw_spin_unlock_irq+0x47/0x80
[   13.320695]  ? calculate_sigpending+0x7b/0xa0
[   13.320718]  ? __pfx_kthread+0x10/0x10
[   13.320739]  ret_from_fork+0x116/0x1d0
[   13.320757]  ? __pfx_kthread+0x10/0x10
[   13.320777]  ret_from_fork_asm+0x1a/0x30
[   13.320807]  </TASK>
[   13.320817] 
[   13.332997] Allocated by task 217:
[   13.333327]  kasan_save_stack+0x45/0x70
[   13.333866]  kasan_save_track+0x18/0x40
[   13.334230]  kasan_save_alloc_info+0x3b/0x50
[   13.334717]  __kasan_kmalloc+0xb7/0xc0
[   13.335184]  __kmalloc_cache_noprof+0x189/0x420
[   13.335788]  workqueue_uaf+0x152/0x560
[   13.336150]  kunit_try_run_case+0x1a5/0x480
[   13.336449]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   13.336994]  kthread+0x337/0x6f0
[   13.337121]  ret_from_fork+0x116/0x1d0
[   13.337253]  ret_from_fork_asm+0x1a/0x30
[   13.337457] 
[   13.337675] Freed by task 44:
[   13.337960]  kasan_save_stack+0x45/0x70
[   13.338334]  kasan_save_track+0x18/0x40
[   13.338790]  kasan_save_free_info+0x3f/0x60
[   13.339184]  __kasan_slab_free+0x56/0x70
[   13.339677]  kfree+0x222/0x3f0
[   13.339982]  workqueue_uaf_work+0x12/0x20
[   13.340233]  process_one_work+0x5ee/0xf60
[   13.340474]  worker_thread+0x758/0x1220
[   13.340856]  kthread+0x337/0x6f0
[   13.341163]  ret_from_fork+0x116/0x1d0
[   13.341560]  ret_from_fork_asm+0x1a/0x30
[   13.341835] 
[   13.341909] Last potentially related work creation:
[   13.342063]  kasan_save_stack+0x45/0x70
[   13.342200]  kasan_record_aux_stack+0xb2/0xc0
[   13.342419]  __queue_work+0x626/0xeb0
[   13.342842]  queue_work_on+0xb6/0xc0
[   13.343257]  workqueue_uaf+0x26d/0x560
[   13.343711]  kunit_try_run_case+0x1a5/0x480
[   13.344243]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   13.344890]  kthread+0x337/0x6f0
[   13.345212]  ret_from_fork+0x116/0x1d0
[   13.345598]  ret_from_fork_asm+0x1a/0x30
[   13.346102] 
[   13.346263] The buggy address belongs to the object at ffff888102d710c0
[   13.346263]  which belongs to the cache kmalloc-32 of size 32
[   13.346757] The buggy address is located 0 bytes inside of
[   13.346757]  freed 32-byte region [ffff888102d710c0, ffff888102d710e0)
[   13.347094] 
[   13.347165] The buggy address belongs to the physical page:
[   13.347331] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x102d71
[   13.347580] flags: 0x200000000000000(node=0|zone=2)
[   13.347917] page_type: f5(slab)
[   13.348040] raw: 0200000000000000 ffff888100041780 dead000000000122 0000000000000000
[   13.348269] raw: 0000000000000000 0000000080400040 00000000f5000000 0000000000000000
[   13.348562] page dumped because: kasan: bad access detected
[   13.348840] 
[   13.348937] Memory state around the buggy address:
[   13.349172]  ffff888102d70f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   13.349513]  ffff888102d71000: 00 00 03 fc fc fc fc fc 00 00 07 fc fc fc fc fc
[   13.349803] >ffff888102d71080: 00 00 00 07 fc fc fc fc fa fb fb fb fc fc fc fc
[   13.350114]                                            ^
[   13.350376]  ffff888102d71100: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   13.350736]  ffff888102d71180: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   13.351045] ==================================================================