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

Environment
qemu-arm64
qemu-x86_64

[   17.002570] ==================================================================
[   17.002637] BUG: KASAN: slab-use-after-free in workqueue_uaf+0x480/0x4a8
[   17.002691] Read of size 8 at addr fff00000c5931500 by task kunit_try_catch/200
[   17.002740] 
[   17.003069] CPU: 1 UID: 0 PID: 200 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc5 #1 PREEMPT 
[   17.003269] Tainted: [B]=BAD_PAGE, [N]=TEST
[   17.003296] Hardware name: linux,dummy-virt (DT)
[   17.003327] Call trace:
[   17.003350]  show_stack+0x20/0x38 (C)
[   17.003898]  dump_stack_lvl+0x8c/0xd0
[   17.004003]  print_report+0x118/0x5d0
[   17.004104]  kasan_report+0xdc/0x128
[   17.004299]  __asan_report_load8_noabort+0x20/0x30
[   17.004385]  workqueue_uaf+0x480/0x4a8
[   17.004428]  kunit_try_run_case+0x170/0x3f0
[   17.004522]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   17.004891]  kthread+0x328/0x630
[   17.005057]  ret_from_fork+0x10/0x20
[   17.005236] 
[   17.005618] Allocated by task 200:
[   17.006061]  kasan_save_stack+0x3c/0x68
[   17.006316]  kasan_save_track+0x20/0x40
[   17.006788]  kasan_save_alloc_info+0x40/0x58
[   17.006839]  __kasan_kmalloc+0xd4/0xd8
[   17.006879]  __kmalloc_cache_noprof+0x16c/0x3c0
[   17.006920]  workqueue_uaf+0x13c/0x4a8
[   17.006957]  kunit_try_run_case+0x170/0x3f0
[   17.006996]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   17.007040]  kthread+0x328/0x630
[   17.007794]  ret_from_fork+0x10/0x20
[   17.008134] 
[   17.008731] Freed by task 47:
[   17.008913]  kasan_save_stack+0x3c/0x68
[   17.009689]  kasan_save_track+0x20/0x40
[   17.009834]  kasan_save_free_info+0x4c/0x78
[   17.009875]  __kasan_slab_free+0x6c/0x98
[   17.009912]  kfree+0x214/0x3c8
[   17.009951]  workqueue_uaf_work+0x18/0x30
[   17.009991]  process_one_work+0x530/0xf98
[   17.010029]  worker_thread+0x618/0xf38
[   17.010067]  kthread+0x328/0x630
[   17.011267]  ret_from_fork+0x10/0x20
[   17.011478] 
[   17.011986] Last potentially related work creation:
[   17.012467]  kasan_save_stack+0x3c/0x68
[   17.012777]  kasan_record_aux_stack+0xb4/0xc8
[   17.013026]  __queue_work+0x65c/0x1008
[   17.013104]  queue_work_on+0xbc/0xf8
[   17.013198]  workqueue_uaf+0x210/0x4a8
[   17.013729]  kunit_try_run_case+0x170/0x3f0
[   17.014225]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   17.014286]  kthread+0x328/0x630
[   17.014774]  ret_from_fork+0x10/0x20
[   17.014861] 
[   17.014889] The buggy address belongs to the object at fff00000c5931500
[   17.014889]  which belongs to the cache kmalloc-32 of size 32
[   17.014951] The buggy address is located 0 bytes inside of
[   17.014951]  freed 32-byte region [fff00000c5931500, fff00000c5931520)
[   17.015014] 
[   17.015035] The buggy address belongs to the physical page:
[   17.015660] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x105931
[   17.016351] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   17.016769] page_type: f5(slab)
[   17.016849] raw: 0bfffe0000000000 fff00000c0001780 dead000000000122 0000000000000000
[   17.016924] raw: 0000000000000000 0000000080400040 00000000f5000000 0000000000000000
[   17.017105] page dumped because: kasan: bad access detected
[   17.017593] 
[   17.017640] Memory state around the buggy address:
[   17.017883]  fff00000c5931400: 00 00 03 fc fc fc fc fc 00 00 07 fc fc fc fc fc
[   17.018141]  fff00000c5931480: 00 00 00 fc fc fc fc fc 00 00 00 07 fc fc fc fc
[   17.018341] >fff00000c5931500: fa fb fb fb fc fc fc fc fc fc fc fc fc fc fc fc
[   17.018407]                    ^
[   17.018459]  fff00000c5931580: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   17.018509]  fff00000c5931600: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   17.018557] ==================================================================

[   13.593696] ==================================================================
[   13.594200] BUG: KASAN: slab-use-after-free in workqueue_uaf+0x4d6/0x560
[   13.594839] Read of size 8 at addr ffff888103a4fb80 by task kunit_try_catch/217
[   13.595294] 
[   13.595658] CPU: 0 UID: 0 PID: 217 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc5 #1 PREEMPT(voluntary) 
[   13.595817] Tainted: [B]=BAD_PAGE, [N]=TEST
[   13.595831] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   13.595853] Call Trace:
[   13.595867]  <TASK>
[   13.595885]  dump_stack_lvl+0x73/0xb0
[   13.595916]  print_report+0xd1/0x610
[   13.595939]  ? __virt_addr_valid+0x1db/0x2d0
[   13.595962]  ? workqueue_uaf+0x4d6/0x560
[   13.596152]  ? kasan_complete_mode_report_info+0x64/0x200
[   13.596180]  ? workqueue_uaf+0x4d6/0x560
[   13.596202]  kasan_report+0x141/0x180
[   13.596224]  ? workqueue_uaf+0x4d6/0x560
[   13.596250]  __asan_report_load8_noabort+0x18/0x20
[   13.596290]  workqueue_uaf+0x4d6/0x560
[   13.596311]  ? __pfx_workqueue_uaf+0x10/0x10
[   13.596333]  ? sysvec_apic_timer_interrupt+0x50/0x90
[   13.596360]  ? trace_hardirqs_on+0x37/0xe0
[   13.596384]  ? __pfx_read_tsc+0x10/0x10
[   13.596404]  ? ktime_get_ts64+0x86/0x230
[   13.596429]  kunit_try_run_case+0x1a5/0x480
[   13.596453]  ? __pfx_kunit_try_run_case+0x10/0x10
[   13.596478]  ? queued_spin_lock_slowpath+0x116/0xb40
[   13.596504]  ? __kthread_parkme+0x82/0x180
[   13.596525]  ? preempt_count_sub+0x50/0x80
[   13.596551]  ? __pfx_kunit_try_run_case+0x10/0x10
[   13.596578]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   13.596602]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   13.596627]  kthread+0x337/0x6f0
[   13.596646]  ? trace_preempt_on+0x20/0xc0
[   13.596668]  ? __pfx_kthread+0x10/0x10
[   13.596690]  ? _raw_spin_unlock_irq+0x47/0x80
[   13.596711]  ? calculate_sigpending+0x7b/0xa0
[   13.596736]  ? __pfx_kthread+0x10/0x10
[   13.596757]  ret_from_fork+0x116/0x1d0
[   13.596775]  ? __pfx_kthread+0x10/0x10
[   13.596795]  ret_from_fork_asm+0x1a/0x30
[   13.596826]  </TASK>
[   13.596838] 
[   13.609834] Allocated by task 217:
[   13.610057]  kasan_save_stack+0x45/0x70
[   13.610629]  kasan_save_track+0x18/0x40
[   13.611047]  kasan_save_alloc_info+0x3b/0x50
[   13.611235]  __kasan_kmalloc+0xb7/0xc0
[   13.611382]  __kmalloc_cache_noprof+0x189/0x420
[   13.611542]  workqueue_uaf+0x152/0x560
[   13.611678]  kunit_try_run_case+0x1a5/0x480
[   13.611826]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   13.612365]  kthread+0x337/0x6f0
[   13.612530]  ret_from_fork+0x116/0x1d0
[   13.612720]  ret_from_fork_asm+0x1a/0x30
[   13.612890] 
[   13.612964] Freed by task 9:
[   13.613129]  kasan_save_stack+0x45/0x70
[   13.613314]  kasan_save_track+0x18/0x40
[   13.613465]  kasan_save_free_info+0x3f/0x60
[   13.614162]  __kasan_slab_free+0x56/0x70
[   13.614371]  kfree+0x222/0x3f0
[   13.614543]  workqueue_uaf_work+0x12/0x20
[   13.614724]  process_one_work+0x5ee/0xf60
[   13.614900]  worker_thread+0x758/0x1220
[   13.615105]  kthread+0x337/0x6f0
[   13.615257]  ret_from_fork+0x116/0x1d0
[   13.615432]  ret_from_fork_asm+0x1a/0x30
[   13.615637] 
[   13.615729] Last potentially related work creation:
[   13.615934]  kasan_save_stack+0x45/0x70
[   13.616095]  kasan_record_aux_stack+0xb2/0xc0
[   13.616842]  __queue_work+0x626/0xeb0
[   13.617103]  queue_work_on+0xb6/0xc0
[   13.617302]  workqueue_uaf+0x26d/0x560
[   13.617617]  kunit_try_run_case+0x1a5/0x480
[   13.617897]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   13.618202]  kthread+0x337/0x6f0
[   13.618587]  ret_from_fork+0x116/0x1d0
[   13.618789]  ret_from_fork_asm+0x1a/0x30
[   13.618940] 
[   13.619035] The buggy address belongs to the object at ffff888103a4fb80
[   13.619035]  which belongs to the cache kmalloc-32 of size 32
[   13.619971] The buggy address is located 0 bytes inside of
[   13.619971]  freed 32-byte region [ffff888103a4fb80, ffff888103a4fba0)
[   13.620632] 
[   13.620742] The buggy address belongs to the physical page:
[   13.620982] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x103a4f
[   13.621340] flags: 0x200000000000000(node=0|zone=2)
[   13.621566] page_type: f5(slab)
[   13.621723] raw: 0200000000000000 ffff888100041780 dead000000000122 0000000000000000
[   13.622022] raw: 0000000000000000 0000000080400040 00000000f5000000 0000000000000000
[   13.622820] page dumped because: kasan: bad access detected
[   13.623027] 
[   13.623410] Memory state around the buggy address:
[   13.623679]  ffff888103a4fa80: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc
[   13.624073]  ffff888103a4fb00: fa fb fb fb fc fc fc fc 00 00 00 07 fc fc fc fc
[   13.624370] >ffff888103a4fb80: fa fb fb fb fc fc fc fc fc fc fc fc fc fc fc fc
[   13.624808]                    ^
[   13.624981]  ffff888103a4fc00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   13.625552]  ffff888103a4fc80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   13.625910] ==================================================================