Hay
Date
July 23, 2025, 2:10 a.m.

Environment
qemu-arm64
qemu-x86_64

[   15.960989] ==================================================================
[   15.961068] BUG: KASAN: slab-use-after-free in workqueue_uaf+0x480/0x4a8
[   15.961128] Read of size 8 at addr fff00000c3f937c0 by task kunit_try_catch/200
[   15.961180] 
[   15.961216] CPU: 1 UID: 0 PID: 200 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc7 #1 PREEMPT 
[   15.963027] Tainted: [B]=BAD_PAGE, [N]=TEST
[   15.963073] Hardware name: linux,dummy-virt (DT)
[   15.963156] Call trace:
[   15.963183]  show_stack+0x20/0x38 (C)
[   15.963240]  dump_stack_lvl+0x8c/0xd0
[   15.963287]  print_report+0x118/0x5d0
[   15.963333]  kasan_report+0xdc/0x128
[   15.963378]  __asan_report_load8_noabort+0x20/0x30
[   15.963431]  workqueue_uaf+0x480/0x4a8
[   15.963474]  kunit_try_run_case+0x170/0x3f0
[   15.963521]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   15.963574]  kthread+0x328/0x630
[   15.963616]  ret_from_fork+0x10/0x20
[   15.963712] 
[   15.963810] Allocated by task 200:
[   15.963842]  kasan_save_stack+0x3c/0x68
[   15.964702]  kasan_save_track+0x20/0x40
[   15.965108]  kasan_save_alloc_info+0x40/0x58
[   15.965202]  __kasan_kmalloc+0xd4/0xd8
[   15.965240]  __kmalloc_cache_noprof+0x16c/0x3c0
[   15.965282]  workqueue_uaf+0x13c/0x4a8
[   15.966159]  kunit_try_run_case+0x170/0x3f0
[   15.966217]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   15.966263]  kthread+0x328/0x630
[   15.966691]  ret_from_fork+0x10/0x20
[   15.966883] 
[   15.966906] Freed by task 57:
[   15.967086]  kasan_save_stack+0x3c/0x68
[   15.967297]  kasan_save_track+0x20/0x40
[   15.967376]  kasan_save_free_info+0x4c/0x78
[   15.967417]  __kasan_slab_free+0x6c/0x98
[   15.967876]  kfree+0x214/0x3c8
[   15.967923]  workqueue_uaf_work+0x18/0x30
[   15.968293]  process_one_work+0x530/0xf98
[   15.968345]  worker_thread+0x618/0xf38
[   15.968729]  kthread+0x328/0x630
[   15.968774]  ret_from_fork+0x10/0x20
[   15.969117] 
[   15.969146] Last potentially related work creation:
[   15.969208]  kasan_save_stack+0x3c/0x68
[   15.969597]  kasan_record_aux_stack+0xb4/0xc8
[   15.969964]  __queue_work+0x65c/0x1008
[   15.970297]  queue_work_on+0xbc/0xf8
[   15.970776]  workqueue_uaf+0x210/0x4a8
[   15.970826]  kunit_try_run_case+0x170/0x3f0
[   15.971102]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   15.971150]  kthread+0x328/0x630
[   15.971358]  ret_from_fork+0x10/0x20
[   15.971416] 
[   15.971650] The buggy address belongs to the object at fff00000c3f937c0
[   15.971650]  which belongs to the cache kmalloc-32 of size 32
[   15.971972] The buggy address is located 0 bytes inside of
[   15.971972]  freed 32-byte region [fff00000c3f937c0, fff00000c3f937e0)
[   15.972575] 
[   15.972719] The buggy address belongs to the physical page:
[   15.973028] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x103f93
[   15.973306] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   15.973671] page_type: f5(slab)
[   15.973779] raw: 0bfffe0000000000 fff00000c0001780 dead000000000122 0000000000000000
[   15.974014] raw: 0000000000000000 0000000080400040 00000000f5000000 0000000000000000
[   15.974060] page dumped because: kasan: bad access detected
[   15.974094] 
[   15.974112] Memory state around the buggy address:
[   15.974287]  fff00000c3f93680: 00 00 00 fc fc fc fc fc 00 00 00 fc fc fc fc fc
[   15.974412]  fff00000c3f93700: 00 00 03 fc fc fc fc fc 00 00 07 fc fc fc fc fc
[   15.974604] >fff00000c3f93780: 00 00 00 07 fc fc fc fc fa fb fb fb fc fc fc fc
[   15.974699]                                            ^
[   15.974934]  fff00000c3f93800: 00 00 00 fc fc fc fc fc fc fc fc fc fc fc fc fc
[   15.975186]  fff00000c3f93880: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   15.975513] ==================================================================

[   13.192028] ==================================================================
[   13.192538] BUG: KASAN: slab-use-after-free in workqueue_uaf+0x4d6/0x560
[   13.192768] Read of size 8 at addr ffff888102b05b80 by task kunit_try_catch/217
[   13.194403] 
[   13.194894] CPU: 0 UID: 0 PID: 217 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc7 #1 PREEMPT(voluntary) 
[   13.194947] Tainted: [B]=BAD_PAGE, [N]=TEST
[   13.194960] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   13.194981] Call Trace:
[   13.194995]  <TASK>
[   13.195011]  dump_stack_lvl+0x73/0xb0
[   13.195045]  print_report+0xd1/0x610
[   13.195068]  ? __virt_addr_valid+0x1db/0x2d0
[   13.195090]  ? workqueue_uaf+0x4d6/0x560
[   13.195112]  ? kasan_complete_mode_report_info+0x64/0x200
[   13.195135]  ? workqueue_uaf+0x4d6/0x560
[   13.195157]  kasan_report+0x141/0x180
[   13.195180]  ? workqueue_uaf+0x4d6/0x560
[   13.195206]  __asan_report_load8_noabort+0x18/0x20
[   13.195231]  workqueue_uaf+0x4d6/0x560
[   13.195253]  ? __pfx_workqueue_uaf+0x10/0x10
[   13.195276]  ? __schedule+0x10c6/0x2b60
[   13.195299]  ? __pfx_read_tsc+0x10/0x10
[   13.195321]  ? ktime_get_ts64+0x86/0x230
[   13.195347]  kunit_try_run_case+0x1a5/0x480
[   13.195373]  ? __pfx_kunit_try_run_case+0x10/0x10
[   13.195397]  ? _raw_spin_lock_irqsave+0xa1/0x100
[   13.195422]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   13.195446]  ? __kthread_parkme+0x82/0x180
[   13.195468]  ? preempt_count_sub+0x50/0x80
[   13.195492]  ? __pfx_kunit_try_run_case+0x10/0x10
[   13.195516]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   13.195540]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   13.195565]  kthread+0x337/0x6f0
[   13.195585]  ? trace_preempt_on+0x20/0xc0
[   13.195608]  ? __pfx_kthread+0x10/0x10
[   13.195629]  ? _raw_spin_unlock_irq+0x47/0x80
[   13.195651]  ? calculate_sigpending+0x7b/0xa0
[   13.195675]  ? __pfx_kthread+0x10/0x10
[   13.195697]  ret_from_fork+0x116/0x1d0
[   13.195716]  ? __pfx_kthread+0x10/0x10
[   13.195737]  ret_from_fork_asm+0x1a/0x30
[   13.195768]  </TASK>
[   13.195779] 
[   13.209059] Allocated by task 217:
[   13.209414]  kasan_save_stack+0x45/0x70
[   13.209898]  kasan_save_track+0x18/0x40
[   13.210409]  kasan_save_alloc_info+0x3b/0x50
[   13.210632]  __kasan_kmalloc+0xb7/0xc0
[   13.211008]  __kmalloc_cache_noprof+0x189/0x420
[   13.211231]  workqueue_uaf+0x152/0x560
[   13.211682]  kunit_try_run_case+0x1a5/0x480
[   13.212143]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   13.212650]  kthread+0x337/0x6f0
[   13.212976]  ret_from_fork+0x116/0x1d0
[   13.213145]  ret_from_fork_asm+0x1a/0x30
[   13.213623] 
[   13.213826] Freed by task 9:
[   13.214114]  kasan_save_stack+0x45/0x70
[   13.214414]  kasan_save_track+0x18/0x40
[   13.214681]  kasan_save_free_info+0x3f/0x60
[   13.214841]  __kasan_slab_free+0x56/0x70
[   13.214978]  kfree+0x222/0x3f0
[   13.215104]  workqueue_uaf_work+0x12/0x20
[   13.215497]  process_one_work+0x5ee/0xf60
[   13.215936]  worker_thread+0x758/0x1220
[   13.216399]  kthread+0x337/0x6f0
[   13.216771]  ret_from_fork+0x116/0x1d0
[   13.217179]  ret_from_fork_asm+0x1a/0x30
[   13.217796] 
[   13.218007] Last potentially related work creation:
[   13.218491]  kasan_save_stack+0x45/0x70
[   13.218633]  kasan_record_aux_stack+0xb2/0xc0
[   13.218781]  __queue_work+0x626/0xeb0
[   13.218928]  queue_work_on+0xb6/0xc0
[   13.219058]  workqueue_uaf+0x26d/0x560
[   13.219429]  kunit_try_run_case+0x1a5/0x480
[   13.219879]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   13.220491]  kthread+0x337/0x6f0
[   13.220918]  ret_from_fork+0x116/0x1d0
[   13.221353]  ret_from_fork_asm+0x1a/0x30
[   13.221794] 
[   13.222071] The buggy address belongs to the object at ffff888102b05b80
[   13.222071]  which belongs to the cache kmalloc-32 of size 32
[   13.223695] The buggy address is located 0 bytes inside of
[   13.223695]  freed 32-byte region [ffff888102b05b80, ffff888102b05ba0)
[   13.224070] 
[   13.224242] The buggy address belongs to the physical page:
[   13.224838] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x102b05
[   13.225600] flags: 0x200000000000000(node=0|zone=2)
[   13.226068] page_type: f5(slab)
[   13.226437] raw: 0200000000000000 ffff888100041780 dead000000000122 0000000000000000
[   13.226958] raw: 0000000000000000 0000000080400040 00000000f5000000 0000000000000000
[   13.227437] page dumped because: kasan: bad access detected
[   13.228069] 
[   13.228238] Memory state around the buggy address:
[   13.228781]  ffff888102b05a80: 00 00 05 fc fc fc fc fc 00 00 07 fc fc fc fc fc
[   13.229263]  ffff888102b05b00: fa fb fb fb fc fc fc fc 00 00 00 fc fc fc fc fc
[   13.229856] >ffff888102b05b80: fa fb fb fb fc fc fc fc fc fc fc fc fc fc fc fc
[   13.230077]                    ^
[   13.230198]  ffff888102b05c00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   13.230417]  ffff888102b05c80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   13.230633] ==================================================================