Hay
Date
July 16, 2025, 12:11 p.m.

Environment
qemu-arm64
qemu-x86_64

[   31.013428] ==================================================================
[   31.013489] BUG: KASAN: slab-use-after-free in workqueue_uaf+0x480/0x4a8
[   31.013601] Read of size 8 at addr fff00000c9a5f000 by task kunit_try_catch/231
[   31.013654] 
[   31.013748] CPU: 0 UID: 0 PID: 231 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc6-next-20250716 #1 PREEMPT 
[   31.013837] Tainted: [B]=BAD_PAGE, [N]=TEST
[   31.013864] Hardware name: linux,dummy-virt (DT)
[   31.013897] Call trace:
[   31.013972]  show_stack+0x20/0x38 (C)
[   31.014048]  dump_stack_lvl+0x8c/0xd0
[   31.014129]  print_report+0x118/0x5d0
[   31.014181]  kasan_report+0xdc/0x128
[   31.014224]  __asan_report_load8_noabort+0x20/0x30
[   31.014274]  workqueue_uaf+0x480/0x4a8
[   31.014325]  kunit_try_run_case+0x170/0x3f0
[   31.014477]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   31.014543]  kthread+0x328/0x630
[   31.014585]  ret_from_fork+0x10/0x20
[   31.014642] 
[   31.014704] Allocated by task 231:
[   31.014763]  kasan_save_stack+0x3c/0x68
[   31.014803]  kasan_save_track+0x20/0x40
[   31.014866]  kasan_save_alloc_info+0x40/0x58
[   31.014912]  __kasan_kmalloc+0xd4/0xd8
[   31.014958]  __kmalloc_cache_noprof+0x16c/0x3c0
[   31.015033]  workqueue_uaf+0x13c/0x4a8
[   31.015109]  kunit_try_run_case+0x170/0x3f0
[   31.015164]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   31.015250]  kthread+0x328/0x630
[   31.015308]  ret_from_fork+0x10/0x20
[   31.015344] 
[   31.015362] Freed by task 75:
[   31.015459]  kasan_save_stack+0x3c/0x68
[   31.015531]  kasan_save_track+0x20/0x40
[   31.015566]  kasan_save_free_info+0x4c/0x78
[   31.015604]  __kasan_slab_free+0x6c/0x98
[   31.015653]  kfree+0x214/0x3c8
[   31.015697]  workqueue_uaf_work+0x18/0x30
[   31.015734]  process_one_work+0x530/0xf98
[   31.015782]  worker_thread+0x618/0xf38
[   31.015837]  kthread+0x328/0x630
[   31.015872]  ret_from_fork+0x10/0x20
[   31.015908] 
[   31.015926] Last potentially related work creation:
[   31.016127]  kasan_save_stack+0x3c/0x68
[   31.016267]  kasan_record_aux_stack+0xb4/0xc8
[   31.016331]  __queue_work+0x65c/0xfe0
[   31.016492]  queue_work_on+0xbc/0xf8
[   31.016626]  workqueue_uaf+0x210/0x4a8
[   31.016712]  kunit_try_run_case+0x170/0x3f0
[   31.016770]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   31.016950]  kthread+0x328/0x630
[   31.016983]  ret_from_fork+0x10/0x20
[   31.017019] 
[   31.017037] The buggy address belongs to the object at fff00000c9a5f000
[   31.017037]  which belongs to the cache kmalloc-32 of size 32
[   31.017098] The buggy address is located 0 bytes inside of
[   31.017098]  freed 32-byte region [fff00000c9a5f000, fff00000c9a5f020)
[   31.017176] 
[   31.017196] The buggy address belongs to the physical page:
[   31.017228] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x109a5f
[   31.017280] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   31.017330] page_type: f5(slab)
[   31.017368] raw: 0bfffe0000000000 fff00000c0001780 dead000000000122 0000000000000000
[   31.017476] raw: 0000000000000000 0000000080400040 00000000f5000000 0000000000000000
[   31.017655] page dumped because: kasan: bad access detected
[   31.017732] 
[   31.017920] Memory state around the buggy address:
[   31.018031]  fff00000c9a5ef00: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
[   31.018140]  fff00000c9a5ef80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
[   31.018258] >fff00000c9a5f000: fa fb fb fb fc fc fc fc 00 00 00 fc fc fc fc fc
[   31.018370]                    ^
[   31.018397]  fff00000c9a5f080: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   31.018450]  fff00000c9a5f100: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   31.018498] ==================================================================

[   23.893209] ==================================================================
[   23.894032] BUG: KASAN: slab-use-after-free in workqueue_uaf+0x4d6/0x560
[   23.894331] Read of size 8 at addr ffff8881053ad6c0 by task kunit_try_catch/249
[   23.894598] 
[   23.894717] CPU: 0 UID: 0 PID: 249 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc6-next-20250716 #1 PREEMPT(voluntary) 
[   23.894771] Tainted: [B]=BAD_PAGE, [N]=TEST
[   23.894783] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   23.894806] Call Trace:
[   23.894821]  <TASK>
[   23.894841]  dump_stack_lvl+0x73/0xb0
[   23.894947]  print_report+0xd1/0x610
[   23.894972]  ? __virt_addr_valid+0x1db/0x2d0
[   23.894999]  ? workqueue_uaf+0x4d6/0x560
[   23.895019]  ? kasan_complete_mode_report_info+0x64/0x200
[   23.895044]  ? workqueue_uaf+0x4d6/0x560
[   23.895066]  kasan_report+0x141/0x180
[   23.895087]  ? workqueue_uaf+0x4d6/0x560
[   23.895112]  __asan_report_load8_noabort+0x18/0x20
[   23.895136]  workqueue_uaf+0x4d6/0x560
[   23.895158]  ? __pfx_workqueue_uaf+0x10/0x10
[   23.895180]  ? __schedule+0x10c6/0x2b60
[   23.895204]  ? __pfx_read_tsc+0x10/0x10
[   23.895227]  ? ktime_get_ts64+0x86/0x230
[   23.895253]  kunit_try_run_case+0x1a5/0x480
[   23.895292]  ? __pfx_kunit_try_run_case+0x10/0x10
[   23.895314]  ? _raw_spin_lock_irqsave+0xa1/0x100
[   23.895337]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   23.895360]  ? __kthread_parkme+0x82/0x180
[   23.895381]  ? preempt_count_sub+0x50/0x80
[   23.895405]  ? __pfx_kunit_try_run_case+0x10/0x10
[   23.895428]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   23.895454]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   23.895481]  kthread+0x337/0x6f0
[   23.895501]  ? trace_preempt_on+0x20/0xc0
[   23.895527]  ? __pfx_kthread+0x10/0x10
[   23.895547]  ? _raw_spin_unlock_irq+0x47/0x80
[   23.895567]  ? calculate_sigpending+0x7b/0xa0
[   23.895591]  ? __pfx_kthread+0x10/0x10
[   23.895612]  ret_from_fork+0x116/0x1d0
[   23.895631]  ? __pfx_kthread+0x10/0x10
[   23.895650]  ret_from_fork_asm+0x1a/0x30
[   23.895682]  </TASK>
[   23.895693] 
[   23.912692] Allocated by task 249:
[   23.913251]  kasan_save_stack+0x45/0x70
[   23.913471]  kasan_save_track+0x18/0x40
[   23.913841]  kasan_save_alloc_info+0x3b/0x50
[   23.914101]  __kasan_kmalloc+0xb7/0xc0
[   23.914237]  __kmalloc_cache_noprof+0x189/0x420
[   23.914470]  workqueue_uaf+0x152/0x560
[   23.914824]  kunit_try_run_case+0x1a5/0x480
[   23.915082]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   23.915492]  kthread+0x337/0x6f0
[   23.915670]  ret_from_fork+0x116/0x1d0
[   23.915851]  ret_from_fork_asm+0x1a/0x30
[   23.916252] 
[   23.916348] Freed by task 9:
[   23.916491]  kasan_save_stack+0x45/0x70
[   23.916679]  kasan_save_track+0x18/0x40
[   23.917108]  kasan_save_free_info+0x3f/0x60
[   23.917297]  __kasan_slab_free+0x56/0x70
[   23.917485]  kfree+0x222/0x3f0
[   23.917627]  workqueue_uaf_work+0x12/0x20
[   23.917876]  process_one_work+0x5ee/0xf60
[   23.918480]  worker_thread+0x758/0x1220
[   23.918672]  kthread+0x337/0x6f0
[   23.919125]  ret_from_fork+0x116/0x1d0
[   23.919292]  ret_from_fork_asm+0x1a/0x30
[   23.919668] 
[   23.919771] Last potentially related work creation:
[   23.920192]  kasan_save_stack+0x45/0x70
[   23.920358]  kasan_record_aux_stack+0xb2/0xc0
[   23.920579]  __queue_work+0x61a/0xe70
[   23.920724]  queue_work_on+0xb6/0xc0
[   23.920932]  workqueue_uaf+0x26d/0x560
[   23.921371]  kunit_try_run_case+0x1a5/0x480
[   23.921577]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   23.921989]  kthread+0x337/0x6f0
[   23.922273]  ret_from_fork+0x116/0x1d0
[   23.922425]  ret_from_fork_asm+0x1a/0x30
[   23.922562] 
[   23.922628] The buggy address belongs to the object at ffff8881053ad6c0
[   23.922628]  which belongs to the cache kmalloc-32 of size 32
[   23.923004] The buggy address is located 0 bytes inside of
[   23.923004]  freed 32-byte region [ffff8881053ad6c0, ffff8881053ad6e0)
[   23.923824] 
[   23.924338] The buggy address belongs to the physical page:
[   23.924551] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1053ad
[   23.924869] flags: 0x200000000000000(node=0|zone=2)
[   23.925217] page_type: f5(slab)
[   23.925383] raw: 0200000000000000 ffff888100041780 dead000000000122 0000000000000000
[   23.925867] raw: 0000000000000000 0000000080400040 00000000f5000000 0000000000000000
[   23.926362] page dumped because: kasan: bad access detected
[   23.926558] 
[   23.926842] Memory state around the buggy address:
[   23.927081]  ffff8881053ad580: 00 00 00 fc fc fc fc fc 00 00 00 fc fc fc fc fc
[   23.927578]  ffff8881053ad600: 00 00 03 fc fc fc fc fc 00 00 07 fc fc fc fc fc
[   23.928191] >ffff8881053ad680: 00 00 00 fc fc fc fc fc fa fb fb fb fc fc fc fc
[   23.928494]                                            ^
[   23.928804]  ffff8881053ad700: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   23.929203]  ffff8881053ad780: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   23.929531] ==================================================================