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

Environment
qemu-arm64
qemu-x86_64

[   31.510717] ==================================================================
[   31.510809] BUG: KASAN: slab-use-after-free in workqueue_uaf+0x480/0x4a8
[   31.510880] Read of size 8 at addr fff00000c9a6bf80 by task kunit_try_catch/233
[   31.510945] 
[   31.510989] CPU: 0 UID: 0 PID: 233 Comm: kunit_try_catch Tainted: G    B   W        N  6.16.0-rc7-next-20250723 #1 PREEMPT 
[   31.511082] Tainted: [B]=BAD_PAGE, [W]=WARN, [N]=TEST
[   31.511111] Hardware name: linux,dummy-virt (DT)
[   31.511143] Call trace:
[   31.511170]  show_stack+0x20/0x38 (C)
[   31.511222]  dump_stack_lvl+0x8c/0xd0
[   31.511269]  print_report+0x118/0x5e8
[   31.511415]  kasan_report+0xdc/0x128
[   31.511563]  __asan_report_load8_noabort+0x20/0x30
[   31.512030]  workqueue_uaf+0x480/0x4a8
[   31.512090]  kunit_try_run_case+0x170/0x3f0
[   31.512247]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   31.512411]  kthread+0x328/0x630
[   31.512504]  ret_from_fork+0x10/0x20
[   31.512558] 
[   31.512577] Allocated by task 233:
[   31.512607]  kasan_save_stack+0x3c/0x68
[   31.512648]  kasan_save_track+0x20/0x40
[   31.512683]  kasan_save_alloc_info+0x40/0x58
[   31.512722]  __kasan_kmalloc+0xd4/0xd8
[   31.513085]  __kmalloc_cache_noprof+0x16c/0x3c0
[   31.513131]  workqueue_uaf+0x13c/0x4a8
[   31.513202]  kunit_try_run_case+0x170/0x3f0
[   31.513249]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   31.513292]  kthread+0x328/0x630
[   31.513326]  ret_from_fork+0x10/0x20
[   31.513438] 
[   31.513459] Freed by task 9:
[   31.513535]  kasan_save_stack+0x3c/0x68
[   31.513574]  kasan_save_track+0x20/0x40
[   31.513609]  kasan_save_free_info+0x4c/0x78
[   31.513646]  __kasan_slab_free+0x6c/0x98
[   31.513682]  kfree+0x214/0x3c8
[   31.513716]  workqueue_uaf_work+0x18/0x30
[   31.513752]  process_one_work+0x530/0xf88
[   31.513792]  worker_thread+0x618/0xf38
[   31.513862]  kthread+0x328/0x630
[   31.513906]  ret_from_fork+0x10/0x20
[   31.513948] 
[   31.513966] Last potentially related work creation:
[   31.513993]  kasan_save_stack+0x3c/0x68
[   31.514029]  kasan_record_aux_stack+0xb4/0xc8
[   31.514068]  __queue_work+0x65c/0xfe0
[   31.514105]  queue_work_on+0xbc/0xf8
[   31.514406]  workqueue_uaf+0x210/0x4a8
[   31.514501]  kunit_try_run_case+0x170/0x3f0
[   31.514555]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   31.514648]  kthread+0x328/0x630
[   31.514681]  ret_from_fork+0x10/0x20
[   31.514717] 
[   31.514735] The buggy address belongs to the object at fff00000c9a6bf80
[   31.514735]  which belongs to the cache kmalloc-32 of size 32
[   31.514967] The buggy address is located 0 bytes inside of
[   31.514967]  freed 32-byte region [fff00000c9a6bf80, fff00000c9a6bfa0)
[   31.515176] 
[   31.515199] The buggy address belongs to the physical page:
[   31.515238] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x109a6b
[   31.515296] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   31.515574] page_type: f5(slab)
[   31.515691] raw: 0bfffe0000000000 fff00000c0001780 dead000000000122 0000000000000000
[   31.515808] raw: 0000000000000000 0000000080400040 00000000f5000000 0000000000000000
[   31.515894] page dumped because: kasan: bad access detected
[   31.516007] 
[   31.516064] Memory state around the buggy address:
[   31.516126]  fff00000c9a6be80: 00 00 03 fc fc fc fc fc 00 00 07 fc fc fc fc fc
[   31.516177]  fff00000c9a6bf00: 00 00 00 fc fc fc fc fc 00 00 00 07 fc fc fc fc
[   31.516277] >fff00000c9a6bf80: fa fb fb fb fc fc fc fc 00 00 00 fc fc fc fc fc
[   31.516449]                    ^
[   31.516490]  fff00000c9a6c000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   31.516583]  fff00000c9a6c080: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   31.516622] ==================================================================

[   25.811447] ==================================================================
[   25.812532] BUG: KASAN: slab-use-after-free in workqueue_uaf+0x4d6/0x560
[   25.812777] Read of size 8 at addr ffff888106110ac0 by task kunit_try_catch/249
[   25.813020] 
[   25.813110] CPU: 0 UID: 0 PID: 249 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc7-next-20250723 #1 PREEMPT(voluntary) 
[   25.813172] Tainted: [B]=BAD_PAGE, [N]=TEST
[   25.813229] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   25.813252] Call Trace:
[   25.813290]  <TASK>
[   25.813350]  dump_stack_lvl+0x73/0xb0
[   25.813383]  print_report+0xd1/0x640
[   25.813419]  ? __virt_addr_valid+0x1db/0x2d0
[   25.813445]  ? workqueue_uaf+0x4d6/0x560
[   25.813466]  ? kasan_complete_mode_report_info+0x64/0x200
[   25.813492]  ? workqueue_uaf+0x4d6/0x560
[   25.813513]  kasan_report+0x141/0x180
[   25.813534]  ? workqueue_uaf+0x4d6/0x560
[   25.813560]  __asan_report_load8_noabort+0x18/0x20
[   25.813584]  workqueue_uaf+0x4d6/0x560
[   25.813606]  ? __pfx_workqueue_uaf+0x10/0x10
[   25.813628]  ? __schedule+0x10da/0x2b60
[   25.813654]  ? __pfx_read_tsc+0x10/0x10
[   25.813676]  ? ktime_get_ts64+0x86/0x230
[   25.813702]  kunit_try_run_case+0x1a5/0x480
[   25.813729]  ? __pfx_kunit_try_run_case+0x10/0x10
[   25.813785]  ? _raw_spin_lock_irqsave+0xa1/0x100
[   25.813825]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   25.813875]  ? __kthread_parkme+0x82/0x180
[   25.813896]  ? preempt_count_sub+0x50/0x80
[   25.813920]  ? __pfx_kunit_try_run_case+0x10/0x10
[   25.813965]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   25.813989]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   25.814012]  kthread+0x337/0x6f0
[   25.814032]  ? trace_preempt_on+0x20/0xc0
[   25.814057]  ? __pfx_kthread+0x10/0x10
[   25.814078]  ? _raw_spin_unlock_irq+0x47/0x80
[   25.814101]  ? calculate_sigpending+0x7b/0xa0
[   25.814126]  ? __pfx_kthread+0x10/0x10
[   25.814156]  ret_from_fork+0x116/0x1d0
[   25.814176]  ? __pfx_kthread+0x10/0x10
[   25.814197]  ret_from_fork_asm+0x1a/0x30
[   25.814229]  </TASK>
[   25.814241] 
[   25.825110] Allocated by task 249:
[   25.825307]  kasan_save_stack+0x45/0x70
[   25.825894]  kasan_save_track+0x18/0x40
[   25.826100]  kasan_save_alloc_info+0x3b/0x50
[   25.826424]  __kasan_kmalloc+0xb7/0xc0
[   25.826717]  __kmalloc_cache_noprof+0x189/0x420
[   25.827038]  workqueue_uaf+0x152/0x560
[   25.827340]  kunit_try_run_case+0x1a5/0x480
[   25.827895]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   25.828309]  kthread+0x337/0x6f0
[   25.828628]  ret_from_fork+0x116/0x1d0
[   25.828822]  ret_from_fork_asm+0x1a/0x30
[   25.829031] 
[   25.829484] Freed by task 9:
[   25.829619]  kasan_save_stack+0x45/0x70
[   25.829845]  kasan_save_track+0x18/0x40
[   25.830082]  kasan_save_free_info+0x3f/0x60
[   25.830597]  __kasan_slab_free+0x56/0x70
[   25.830764]  kfree+0x222/0x3f0
[   25.831089]  workqueue_uaf_work+0x12/0x20
[   25.831401]  process_one_work+0x5ee/0xf60
[   25.831794]  worker_thread+0x758/0x1220
[   25.832192]  kthread+0x337/0x6f0
[   25.832664]  ret_from_fork+0x116/0x1d0
[   25.832853]  ret_from_fork_asm+0x1a/0x30
[   25.833251] 
[   25.833333] Last potentially related work creation:
[   25.833767]  kasan_save_stack+0x45/0x70
[   25.834129]  kasan_record_aux_stack+0xb2/0xc0
[   25.834557]  __queue_work+0x61a/0xe70
[   25.834857]  queue_work_on+0xb6/0xc0
[   25.835162]  workqueue_uaf+0x26d/0x560
[   25.835355]  kunit_try_run_case+0x1a5/0x480
[   25.835662]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   25.835914]  kthread+0x337/0x6f0
[   25.836310]  ret_from_fork+0x116/0x1d0
[   25.836461]  ret_from_fork_asm+0x1a/0x30
[   25.836824] 
[   25.836923] The buggy address belongs to the object at ffff888106110ac0
[   25.836923]  which belongs to the cache kmalloc-32 of size 32
[   25.837958] The buggy address is located 0 bytes inside of
[   25.837958]  freed 32-byte region [ffff888106110ac0, ffff888106110ae0)
[   25.838580] 
[   25.838712] The buggy address belongs to the physical page:
[   25.839223] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x106110
[   25.839772] flags: 0x200000000000000(node=0|zone=2)
[   25.840053] page_type: f5(slab)
[   25.840457] raw: 0200000000000000 ffff888100041780 dead000000000122 0000000000000000
[   25.840858] raw: 0000000000000000 0000000080400040 00000000f5000000 0000000000000000
[   25.841324] page dumped because: kasan: bad access detected
[   25.841704] 
[   25.841805] Memory state around the buggy address:
[   25.842065]  ffff888106110980: 00 00 07 fc fc fc fc fc 00 00 00 fc fc fc fc fc
[   25.842342]  ffff888106110a00: 00 00 03 fc fc fc fc fc 00 00 07 fc fc fc fc fc
[   25.843312] >ffff888106110a80: 00 00 00 07 fc fc fc fc fa fb fb fb fc fc fc fc
[   25.843647]                                            ^
[   25.844105]  ffff888106110b00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   25.844511]  ffff888106110b80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   25.845014] ==================================================================