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

Environment
qemu-arm64
qemu-x86_64

[   18.422360] ==================================================================
[   18.422630] BUG: KASAN: slab-use-after-free in workqueue_uaf+0x480/0x4a8
[   18.422739] Read of size 8 at addr fff00000c5a51b80 by task kunit_try_catch/200
[   18.422792] 
[   18.422857] CPU: 1 UID: 0 PID: 200 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc4 #1 PREEMPT 
[   18.423003] Tainted: [B]=BAD_PAGE, [N]=TEST
[   18.423032] Hardware name: linux,dummy-virt (DT)
[   18.423065] Call trace:
[   18.423107]  show_stack+0x20/0x38 (C)
[   18.423162]  dump_stack_lvl+0x8c/0xd0
[   18.423351]  print_report+0x118/0x608
[   18.423548]  kasan_report+0xdc/0x128
[   18.423646]  __asan_report_load8_noabort+0x20/0x30
[   18.423730]  workqueue_uaf+0x480/0x4a8
[   18.423794]  kunit_try_run_case+0x170/0x3f0
[   18.423889]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   18.423993]  kthread+0x328/0x630
[   18.424058]  ret_from_fork+0x10/0x20
[   18.424140] 
[   18.424217] Allocated by task 200:
[   18.424288]  kasan_save_stack+0x3c/0x68
[   18.424336]  kasan_save_track+0x20/0x40
[   18.424373]  kasan_save_alloc_info+0x40/0x58
[   18.424640]  __kasan_kmalloc+0xd4/0xd8
[   18.424763]  __kmalloc_cache_noprof+0x16c/0x3c0
[   18.424839]  workqueue_uaf+0x13c/0x4a8
[   18.424875]  kunit_try_run_case+0x170/0x3f0
[   18.424913]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   18.424967]  kthread+0x328/0x630
[   18.425010]  ret_from_fork+0x10/0x20
[   18.425062] 
[   18.425081] Freed by task 47:
[   18.425108]  kasan_save_stack+0x3c/0x68
[   18.425161]  kasan_save_track+0x20/0x40
[   18.425199]  kasan_save_free_info+0x4c/0x78
[   18.425240]  __kasan_slab_free+0x6c/0x98
[   18.425278]  kfree+0x214/0x3c8
[   18.425310]  workqueue_uaf_work+0x18/0x30
[   18.425354]  process_one_work+0x530/0xf98
[   18.425392]  worker_thread+0x618/0xf38
[   18.425433]  kthread+0x328/0x630
[   18.425476]  ret_from_fork+0x10/0x20
[   18.425520] 
[   18.425550] Last potentially related work creation:
[   18.425577]  kasan_save_stack+0x3c/0x68
[   18.425615]  kasan_record_aux_stack+0xb4/0xc8
[   18.425657]  __queue_work+0x65c/0x1008
[   18.425695]  queue_work_on+0xbc/0xf8
[   18.425731]  workqueue_uaf+0x210/0x4a8
[   18.425774]  kunit_try_run_case+0x170/0x3f0
[   18.425828]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   18.425871]  kthread+0x328/0x630
[   18.425903]  ret_from_fork+0x10/0x20
[   18.425937] 
[   18.425955] The buggy address belongs to the object at fff00000c5a51b80
[   18.425955]  which belongs to the cache kmalloc-32 of size 32
[   18.426347] The buggy address is located 0 bytes inside of
[   18.426347]  freed 32-byte region [fff00000c5a51b80, fff00000c5a51ba0)
[   18.426453] 
[   18.426549] The buggy address belongs to the physical page:
[   18.426595] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x105a51
[   18.426652] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   18.426973] page_type: f5(slab)
[   18.427100] raw: 0bfffe0000000000 fff00000c0001780 dead000000000122 0000000000000000
[   18.427166] raw: 0000000000000000 0000000080400040 00000000f5000000 0000000000000000
[   18.427246] page dumped because: kasan: bad access detected
[   18.427333] 
[   18.427394] Memory state around the buggy address:
[   18.427450]  fff00000c5a51a80: 00 00 03 fc fc fc fc fc 00 00 07 fc fc fc fc fc
[   18.427573]  fff00000c5a51b00: 00 00 00 fc fc fc fc fc 00 00 00 07 fc fc fc fc
[   18.427651] >fff00000c5a51b80: fa fb fb fb fc fc fc fc 00 00 00 fc fc fc fc fc
[   18.427716]                    ^
[   18.427772]  fff00000c5a51c00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   18.427869]  fff00000c5a51c80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   18.427932] ==================================================================

[   12.591932] ==================================================================
[   12.593100] BUG: KASAN: slab-use-after-free in workqueue_uaf+0x4d6/0x560
[   12.593968] Read of size 8 at addr ffff888103983200 by task kunit_try_catch/217
[   12.594450] 
[   12.594556] CPU: 1 UID: 0 PID: 217 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc4 #1 PREEMPT(voluntary) 
[   12.594607] Tainted: [B]=BAD_PAGE, [N]=TEST
[   12.594618] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   12.594640] Call Trace:
[   12.594658]  <TASK>
[   12.594678]  dump_stack_lvl+0x73/0xb0
[   12.594713]  print_report+0xd1/0x650
[   12.594736]  ? __virt_addr_valid+0x1db/0x2d0
[   12.594758]  ? workqueue_uaf+0x4d6/0x560
[   12.594778]  ? kasan_complete_mode_report_info+0x64/0x200
[   12.594799]  ? workqueue_uaf+0x4d6/0x560
[   12.594819]  kasan_report+0x141/0x180
[   12.594839]  ? workqueue_uaf+0x4d6/0x560
[   12.594863]  __asan_report_load8_noabort+0x18/0x20
[   12.594886]  workqueue_uaf+0x4d6/0x560
[   12.594906]  ? __pfx_workqueue_uaf+0x10/0x10
[   12.594928]  ? __pfx_workqueue_uaf+0x10/0x10
[   12.594952]  kunit_try_run_case+0x1a5/0x480
[   12.594976]  ? __pfx_kunit_try_run_case+0x10/0x10
[   12.594996]  ? _raw_spin_lock_irqsave+0xa1/0x100
[   12.595019]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   12.595041]  ? __kthread_parkme+0x82/0x180
[   12.595060]  ? preempt_count_sub+0x50/0x80
[   12.595082]  ? __pfx_kunit_try_run_case+0x10/0x10
[   12.595104]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   12.595125]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   12.595146]  kthread+0x337/0x6f0
[   12.595164]  ? trace_preempt_on+0x20/0xc0
[   12.595186]  ? __pfx_kthread+0x10/0x10
[   12.595205]  ? _raw_spin_unlock_irq+0x47/0x80
[   12.595236]  ? calculate_sigpending+0x7b/0xa0
[   12.595258]  ? __pfx_kthread+0x10/0x10
[   12.595278]  ret_from_fork+0x116/0x1d0
[   12.595296]  ? __pfx_kthread+0x10/0x10
[   12.595315]  ret_from_fork_asm+0x1a/0x30
[   12.595345]  </TASK>
[   12.595356] 
[   12.607107] Allocated by task 217:
[   12.607612]  kasan_save_stack+0x45/0x70
[   12.607805]  kasan_save_track+0x18/0x40
[   12.608006]  kasan_save_alloc_info+0x3b/0x50
[   12.608158]  __kasan_kmalloc+0xb7/0xc0
[   12.608310]  __kmalloc_cache_noprof+0x189/0x420
[   12.608643]  workqueue_uaf+0x152/0x560
[   12.608853]  kunit_try_run_case+0x1a5/0x480
[   12.609013]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   12.609331]  kthread+0x337/0x6f0
[   12.609605]  ret_from_fork+0x116/0x1d0
[   12.609760]  ret_from_fork_asm+0x1a/0x30
[   12.609927] 
[   12.610021] Freed by task 41:
[   12.610192]  kasan_save_stack+0x45/0x70
[   12.610616]  kasan_save_track+0x18/0x40
[   12.611022]  kasan_save_free_info+0x3f/0x60
[   12.611204]  __kasan_slab_free+0x56/0x70
[   12.611637]  kfree+0x222/0x3f0
[   12.611971]  workqueue_uaf_work+0x12/0x20
[   12.612371]  process_one_work+0x5ee/0xf60
[   12.612725]  worker_thread+0x758/0x1220
[   12.613167]  kthread+0x337/0x6f0
[   12.613537]  ret_from_fork+0x116/0x1d0
[   12.613724]  ret_from_fork_asm+0x1a/0x30
[   12.613908] 
[   12.614004] Last potentially related work creation:
[   12.614492]  kasan_save_stack+0x45/0x70
[   12.614785]  kasan_record_aux_stack+0xb2/0xc0
[   12.615146]  __queue_work+0x626/0xeb0
[   12.615504]  queue_work_on+0xb6/0xc0
[   12.615691]  workqueue_uaf+0x26d/0x560
[   12.615871]  kunit_try_run_case+0x1a5/0x480
[   12.616061]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   12.616593]  kthread+0x337/0x6f0
[   12.617019]  ret_from_fork+0x116/0x1d0
[   12.617751]  ret_from_fork_asm+0x1a/0x30
[   12.617916] 
[   12.617991] The buggy address belongs to the object at ffff888103983200
[   12.617991]  which belongs to the cache kmalloc-32 of size 32
[   12.618620] The buggy address is located 0 bytes inside of
[   12.618620]  freed 32-byte region [ffff888103983200, ffff888103983220)
[   12.619119] 
[   12.619226] The buggy address belongs to the physical page:
[   12.619485] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x103983
[   12.619985] flags: 0x200000000000000(node=0|zone=2)
[   12.620351] page_type: f5(slab)
[   12.620581] raw: 0200000000000000 ffff888100041780 dead000000000122 0000000000000000
[   12.620904] raw: 0000000000000000 0000000080400040 00000000f5000000 0000000000000000
[   12.621235] page dumped because: kasan: bad access detected
[   12.621620] 
[   12.621759] Memory state around the buggy address:
[   12.621972]  ffff888103983100: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc
[   12.622404]  ffff888103983180: fa fb fb fb fc fc fc fc 00 00 00 fc fc fc fc fc
[   12.622851] >ffff888103983200: fa fb fb fb fc fc fc fc fc fc fc fc fc fc fc fc
[   12.623075]                    ^
[   12.623306]  ffff888103983280: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   12.623672]  ffff888103983300: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   12.624758] ==================================================================