Hay
Date
July 17, 2025, 11:10 a.m.

Environment
qemu-arm64
qemu-x86_64

[   15.851789] ==================================================================
[   15.851966] BUG: KASAN: slab-use-after-free in workqueue_uaf+0x480/0x4a8
[   15.852153] Read of size 8 at addr fff00000c789a5c0 by task kunit_try_catch/201
[   15.852262] 
[   15.852318] CPU: 0 UID: 0 PID: 201 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc6 #1 PREEMPT 
[   15.852426] Tainted: [B]=BAD_PAGE, [N]=TEST
[   15.852511] Hardware name: linux,dummy-virt (DT)
[   15.852581] Call trace:
[   15.852619]  show_stack+0x20/0x38 (C)
[   15.852669]  dump_stack_lvl+0x8c/0xd0
[   15.852752]  print_report+0x118/0x5d0
[   15.852814]  kasan_report+0xdc/0x128
[   15.852909]  __asan_report_load8_noabort+0x20/0x30
[   15.853414]  workqueue_uaf+0x480/0x4a8
[   15.853472]  kunit_try_run_case+0x170/0x3f0
[   15.853524]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   15.853578]  kthread+0x328/0x630
[   15.853619]  ret_from_fork+0x10/0x20
[   15.853667] 
[   15.853685] Allocated by task 201:
[   15.853714]  kasan_save_stack+0x3c/0x68
[   15.853756]  kasan_save_track+0x20/0x40
[   15.853793]  kasan_save_alloc_info+0x40/0x58
[   15.853832]  __kasan_kmalloc+0xd4/0xd8
[   15.853869]  __kmalloc_cache_noprof+0x16c/0x3c0
[   15.853908]  workqueue_uaf+0x13c/0x4a8
[   15.853944]  kunit_try_run_case+0x170/0x3f0
[   15.853993]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   15.854037]  kthread+0x328/0x630
[   15.854071]  ret_from_fork+0x10/0x20
[   15.854105] 
[   15.854123] Freed by task 119:
[   15.854171]  kasan_save_stack+0x3c/0x68
[   15.854218]  kasan_save_track+0x20/0x40
[   15.854254]  kasan_save_free_info+0x4c/0x78
[   15.854292]  __kasan_slab_free+0x6c/0x98
[   15.854339]  kfree+0x214/0x3c8
[   15.854379]  workqueue_uaf_work+0x18/0x30
[   15.854415]  process_one_work+0x530/0xf98
[   15.854451]  worker_thread+0x618/0xf38
[   15.854499]  kthread+0x328/0x630
[   15.854547]  ret_from_fork+0x10/0x20
[   15.854581] 
[   15.854601] Last potentially related work creation:
[   15.854635]  kasan_save_stack+0x3c/0x68
[   15.854672]  kasan_record_aux_stack+0xb4/0xc8
[   15.854713]  __queue_work+0x65c/0x1008
[   15.854748]  queue_work_on+0xbc/0xf8
[   15.854784]  workqueue_uaf+0x210/0x4a8
[   15.854829]  kunit_try_run_case+0x170/0x3f0
[   15.854867]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   15.854912]  kthread+0x328/0x630
[   15.854943]  ret_from_fork+0x10/0x20
[   15.854988] 
[   15.855005] The buggy address belongs to the object at fff00000c789a5c0
[   15.855005]  which belongs to the cache kmalloc-32 of size 32
[   15.855066] The buggy address is located 0 bytes inside of
[   15.855066]  freed 32-byte region [fff00000c789a5c0, fff00000c789a5e0)
[   15.855137] 
[   15.855156] The buggy address belongs to the physical page:
[   15.855197] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x10789a
[   15.855258] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   15.855308] page_type: f5(slab)
[   15.855356] raw: 0bfffe0000000000 fff00000c0001780 dead000000000122 0000000000000000
[   15.855406] raw: 0000000000000000 0000000080400040 00000000f5000000 0000000000000000
[   15.855465] page dumped because: kasan: bad access detected
[   15.855507] 
[   15.855532] Memory state around the buggy address:
[   15.855570]  fff00000c789a480: 00 00 00 fc fc fc fc fc 00 00 03 fc fc fc fc fc
[   15.855624]  fff00000c789a500: 00 00 07 fc fc fc fc fc 00 00 00 fc fc fc fc fc
[   15.855668] >fff00000c789a580: 00 00 00 07 fc fc fc fc fa fb fb fb fc fc fc fc
[   15.855708]                                            ^
[   15.855743]  fff00000c789a600: 00 00 00 fc fc fc fc fc fc fc fc fc fc fc fc fc
[   15.855787]  fff00000c789a680: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   15.855834] ==================================================================

[   13.621931] ==================================================================
[   13.622515] BUG: KASAN: slab-use-after-free in workqueue_uaf+0x4d6/0x560
[   13.623268] Read of size 8 at addr ffff888102a11780 by task kunit_try_catch/217
[   13.624015] 
[   13.624183] CPU: 0 UID: 0 PID: 217 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc6 #1 PREEMPT(voluntary) 
[   13.624246] Tainted: [B]=BAD_PAGE, [N]=TEST
[   13.624258] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   13.624279] Call Trace:
[   13.624291]  <TASK>
[   13.624306]  dump_stack_lvl+0x73/0xb0
[   13.624335]  print_report+0xd1/0x610
[   13.624386]  ? __virt_addr_valid+0x1db/0x2d0
[   13.624426]  ? workqueue_uaf+0x4d6/0x560
[   13.624447]  ? kasan_complete_mode_report_info+0x64/0x200
[   13.624471]  ? workqueue_uaf+0x4d6/0x560
[   13.624493]  kasan_report+0x141/0x180
[   13.624514]  ? workqueue_uaf+0x4d6/0x560
[   13.624540]  __asan_report_load8_noabort+0x18/0x20
[   13.624575]  workqueue_uaf+0x4d6/0x560
[   13.624597]  ? __pfx_workqueue_uaf+0x10/0x10
[   13.624620]  ? __schedule+0x10cc/0x2b60
[   13.624642]  ? __pfx_read_tsc+0x10/0x10
[   13.624663]  ? ktime_get_ts64+0x86/0x230
[   13.624687]  kunit_try_run_case+0x1a5/0x480
[   13.624711]  ? __pfx_kunit_try_run_case+0x10/0x10
[   13.624756]  ? _raw_spin_lock_irqsave+0xa1/0x100
[   13.624781]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   13.624816]  ? __kthread_parkme+0x82/0x180
[   13.624837]  ? preempt_count_sub+0x50/0x80
[   13.624860]  ? __pfx_kunit_try_run_case+0x10/0x10
[   13.624884]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   13.624909]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   13.624935]  kthread+0x337/0x6f0
[   13.624953]  ? trace_preempt_on+0x20/0xc0
[   13.624977]  ? __pfx_kthread+0x10/0x10
[   13.624997]  ? _raw_spin_unlock_irq+0x47/0x80
[   13.625019]  ? calculate_sigpending+0x7b/0xa0
[   13.625044]  ? __pfx_kthread+0x10/0x10
[   13.625065]  ret_from_fork+0x116/0x1d0
[   13.625084]  ? __pfx_kthread+0x10/0x10
[   13.625104]  ret_from_fork_asm+0x1a/0x30
[   13.625135]  </TASK>
[   13.625145] 
[   13.636140] Allocated by task 217:
[   13.636274]  kasan_save_stack+0x45/0x70
[   13.636423]  kasan_save_track+0x18/0x40
[   13.636597]  kasan_save_alloc_info+0x3b/0x50
[   13.636996]  __kasan_kmalloc+0xb7/0xc0
[   13.637353]  __kmalloc_cache_noprof+0x189/0x420
[   13.637804]  workqueue_uaf+0x152/0x560
[   13.638138]  kunit_try_run_case+0x1a5/0x480
[   13.638620]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   13.639132]  kthread+0x337/0x6f0
[   13.639492]  ret_from_fork+0x116/0x1d0
[   13.639979]  ret_from_fork_asm+0x1a/0x30
[   13.640363] 
[   13.640574] Freed by task 9:
[   13.640924]  kasan_save_stack+0x45/0x70
[   13.641358]  kasan_save_track+0x18/0x40
[   13.641754]  kasan_save_free_info+0x3f/0x60
[   13.642147]  __kasan_slab_free+0x56/0x70
[   13.642636]  kfree+0x222/0x3f0
[   13.642957]  workqueue_uaf_work+0x12/0x20
[   13.643371]  process_one_work+0x5ee/0xf60
[   13.643808]  worker_thread+0x758/0x1220
[   13.644180]  kthread+0x337/0x6f0
[   13.644577]  ret_from_fork+0x116/0x1d0
[   13.644973]  ret_from_fork_asm+0x1a/0x30
[   13.645401] 
[   13.645587] Last potentially related work creation:
[   13.646017]  kasan_save_stack+0x45/0x70
[   13.646409]  kasan_record_aux_stack+0xb2/0xc0
[   13.646892]  __queue_work+0x626/0xeb0
[   13.647244]  queue_work_on+0xb6/0xc0
[   13.647664]  workqueue_uaf+0x26d/0x560
[   13.648066]  kunit_try_run_case+0x1a5/0x480
[   13.648534]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   13.649053]  kthread+0x337/0x6f0
[   13.649438]  ret_from_fork+0x116/0x1d0
[   13.649816]  ret_from_fork_asm+0x1a/0x30
[   13.650206] 
[   13.650438] The buggy address belongs to the object at ffff888102a11780
[   13.650438]  which belongs to the cache kmalloc-32 of size 32
[   13.651445] The buggy address is located 0 bytes inside of
[   13.651445]  freed 32-byte region [ffff888102a11780, ffff888102a117a0)
[   13.652104] 
[   13.652179] The buggy address belongs to the physical page:
[   13.652355] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x102a11
[   13.653174] flags: 0x200000000000000(node=0|zone=2)
[   13.653780] page_type: f5(slab)
[   13.654160] raw: 0200000000000000 ffff888100041780 dead000000000122 0000000000000000
[   13.654925] raw: 0000000000000000 0000000080400040 00000000f5000000 0000000000000000
[   13.655427] page dumped because: kasan: bad access detected
[   13.655834] 
[   13.656014] Memory state around the buggy address:
[   13.656526]  ffff888102a11680: fa fb fb fb fc fc fc fc 00 00 07 fc fc fc fc fc
[   13.657297]  ffff888102a11700: 00 00 00 fc fc fc fc fc 00 00 00 07 fc fc fc fc
[   13.657978] >ffff888102a11780: fa fb fb fb fc fc fc fc fc fc fc fc fc fc fc fc
[   13.658506]                    ^
[   13.658684]  ffff888102a11800: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   13.659344]  ffff888102a11880: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   13.659971] ==================================================================