Hay
Date
July 3, 2025, 6:13 p.m.

Environment
qemu-arm64
qemu-x86_64

[   17.240384] ==================================================================
[   17.240529] BUG: KASAN: slab-use-after-free in workqueue_uaf+0x480/0x4a8
[   17.240597] Read of size 8 at addr fff00000c78c4d80 by task kunit_try_catch/200
[   17.240801] 
[   17.240969] CPU: 0 UID: 0 PID: 200 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc4 #1 PREEMPT 
[   17.241078] Tainted: [B]=BAD_PAGE, [N]=TEST
[   17.241105] Hardware name: linux,dummy-virt (DT)
[   17.241468] Call trace:
[   17.241619]  show_stack+0x20/0x38 (C)
[   17.241752]  dump_stack_lvl+0x8c/0xd0
[   17.241962]  print_report+0x118/0x608
[   17.242225]  kasan_report+0xdc/0x128
[   17.242620]  __asan_report_load8_noabort+0x20/0x30
[   17.242906]  workqueue_uaf+0x480/0x4a8
[   17.243001]  kunit_try_run_case+0x170/0x3f0
[   17.243168]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   17.243336]  kthread+0x328/0x630
[   17.243439]  ret_from_fork+0x10/0x20
[   17.243704] 
[   17.243863] Allocated by task 200:
[   17.244051]  kasan_save_stack+0x3c/0x68
[   17.244253]  kasan_save_track+0x20/0x40
[   17.244546]  kasan_save_alloc_info+0x40/0x58
[   17.244626]  __kasan_kmalloc+0xd4/0xd8
[   17.244662]  __kmalloc_cache_noprof+0x16c/0x3c0
[   17.244827]  workqueue_uaf+0x13c/0x4a8
[   17.244868]  kunit_try_run_case+0x170/0x3f0
[   17.244909]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   17.244959]  kthread+0x328/0x630
[   17.244992]  ret_from_fork+0x10/0x20
[   17.245026] 
[   17.245057] Freed by task 75:
[   17.245084]  kasan_save_stack+0x3c/0x68
[   17.245122]  kasan_save_track+0x20/0x40
[   17.245667]  kasan_save_free_info+0x4c/0x78
[   17.245742]  __kasan_slab_free+0x6c/0x98
[   17.245878]  kfree+0x214/0x3c8
[   17.245937]  workqueue_uaf_work+0x18/0x30
[   17.246259]  process_one_work+0x530/0xf98
[   17.246346]  worker_thread+0x618/0xf38
[   17.246404]  kthread+0x328/0x630
[   17.246435]  ret_from_fork+0x10/0x20
[   17.246760] 
[   17.246812] Last potentially related work creation:
[   17.246838]  kasan_save_stack+0x3c/0x68
[   17.247057]  kasan_record_aux_stack+0xb4/0xc8
[   17.247254]  __queue_work+0x65c/0x1008
[   17.247300]  queue_work_on+0xbc/0xf8
[   17.247506]  workqueue_uaf+0x210/0x4a8
[   17.247688]  kunit_try_run_case+0x170/0x3f0
[   17.247816]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   17.247872]  kthread+0x328/0x630
[   17.247933]  ret_from_fork+0x10/0x20
[   17.247990] 
[   17.248019] The buggy address belongs to the object at fff00000c78c4d80
[   17.248019]  which belongs to the cache kmalloc-32 of size 32
[   17.248087] The buggy address is located 0 bytes inside of
[   17.248087]  freed 32-byte region [fff00000c78c4d80, fff00000c78c4da0)
[   17.248146] 
[   17.248167] The buggy address belongs to the physical page:
[   17.248196] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1078c4
[   17.248259] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   17.248316] page_type: f5(slab)
[   17.248366] raw: 0bfffe0000000000 fff00000c0001780 dead000000000122 0000000000000000
[   17.248414] raw: 0000000000000000 0000000080400040 00000000f5000000 0000000000000000
[   17.248466] page dumped because: kasan: bad access detected
[   17.248497] 
[   17.248515] Memory state around the buggy address:
[   17.248547]  fff00000c78c4c80: 00 00 07 fc fc fc fc fc 00 00 00 fc fc fc fc fc
[   17.248592]  fff00000c78c4d00: 00 00 00 fc fc fc fc fc 00 00 00 07 fc fc fc fc
[   17.248642] >fff00000c78c4d80: fa fb fb fb fc fc fc fc 00 00 00 fc fc fc fc fc
[   17.248700]                    ^
[   17.248734]  fff00000c78c4e00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   17.248777]  fff00000c78c4e80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   17.248830] ==================================================================

[   12.035592] ==================================================================
[   12.036024] BUG: KASAN: slab-use-after-free in workqueue_uaf+0x4d6/0x560
[   12.036657] Read of size 8 at addr ffff88810333d180 by task kunit_try_catch/218
[   12.036914] 
[   12.037025] CPU: 1 UID: 0 PID: 218 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc4 #1 PREEMPT(voluntary) 
[   12.037069] Tainted: [B]=BAD_PAGE, [N]=TEST
[   12.037080] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   12.037100] Call Trace:
[   12.037125]  <TASK>
[   12.037140]  dump_stack_lvl+0x73/0xb0
[   12.037167]  print_report+0xd1/0x650
[   12.037189]  ? __virt_addr_valid+0x1db/0x2d0
[   12.037210]  ? workqueue_uaf+0x4d6/0x560
[   12.037230]  ? kasan_complete_mode_report_info+0x64/0x200
[   12.037251]  ? workqueue_uaf+0x4d6/0x560
[   12.037271]  kasan_report+0x141/0x180
[   12.037292]  ? workqueue_uaf+0x4d6/0x560
[   12.037317]  __asan_report_load8_noabort+0x18/0x20
[   12.037340]  workqueue_uaf+0x4d6/0x560
[   12.037361]  ? __pfx_workqueue_uaf+0x10/0x10
[   12.037382]  ? __schedule+0x10cc/0x2b60
[   12.037403]  ? __pfx_read_tsc+0x10/0x10
[   12.037424]  ? ktime_get_ts64+0x86/0x230
[   12.037446]  kunit_try_run_case+0x1a5/0x480
[   12.037470]  ? __pfx_kunit_try_run_case+0x10/0x10
[   12.037491]  ? _raw_spin_lock_irqsave+0xa1/0x100
[   12.037512]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   12.037534]  ? __kthread_parkme+0x82/0x180
[   12.037553]  ? preempt_count_sub+0x50/0x80
[   12.037576]  ? __pfx_kunit_try_run_case+0x10/0x10
[   12.037598]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   12.037620]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   12.037642]  kthread+0x337/0x6f0
[   12.037661]  ? trace_preempt_on+0x20/0xc0
[   12.037685]  ? __pfx_kthread+0x10/0x10
[   12.037706]  ? _raw_spin_unlock_irq+0x47/0x80
[   12.037729]  ? calculate_sigpending+0x7b/0xa0
[   12.037751]  ? __pfx_kthread+0x10/0x10
[   12.037801]  ret_from_fork+0x116/0x1d0
[   12.037820]  ? __pfx_kthread+0x10/0x10
[   12.037839]  ret_from_fork_asm+0x1a/0x30
[   12.037870]  </TASK>
[   12.037881] 
[   12.045275] Allocated by task 218:
[   12.045451]  kasan_save_stack+0x45/0x70
[   12.045664]  kasan_save_track+0x18/0x40
[   12.045827]  kasan_save_alloc_info+0x3b/0x50
[   12.046039]  __kasan_kmalloc+0xb7/0xc0
[   12.046307]  __kmalloc_cache_noprof+0x189/0x420
[   12.046510]  workqueue_uaf+0x152/0x560
[   12.046699]  kunit_try_run_case+0x1a5/0x480
[   12.046892]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   12.047141]  kthread+0x337/0x6f0
[   12.047280]  ret_from_fork+0x116/0x1d0
[   12.047523]  ret_from_fork_asm+0x1a/0x30
[   12.047707] 
[   12.047797] Freed by task 41:
[   12.047947]  kasan_save_stack+0x45/0x70
[   12.048299]  kasan_save_track+0x18/0x40
[   12.048505]  kasan_save_free_info+0x3f/0x60
[   12.048757]  __kasan_slab_free+0x56/0x70
[   12.048930]  kfree+0x222/0x3f0
[   12.049049]  workqueue_uaf_work+0x12/0x20
[   12.049245]  process_one_work+0x5ee/0xf60
[   12.049580]  worker_thread+0x758/0x1220
[   12.049759]  kthread+0x337/0x6f0
[   12.049915]  ret_from_fork+0x116/0x1d0
[   12.050078]  ret_from_fork_asm+0x1a/0x30
[   12.050310] 
[   12.050410] Last potentially related work creation:
[   12.050616]  kasan_save_stack+0x45/0x70
[   12.050817]  kasan_record_aux_stack+0xb2/0xc0
[   12.051025]  __queue_work+0x626/0xeb0
[   12.051265]  queue_work_on+0xb6/0xc0
[   12.051446]  workqueue_uaf+0x26d/0x560
[   12.051637]  kunit_try_run_case+0x1a5/0x480
[   12.051824]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   12.052050]  kthread+0x337/0x6f0
[   12.052184]  ret_from_fork+0x116/0x1d0
[   12.052318]  ret_from_fork_asm+0x1a/0x30
[   12.052456] 
[   12.052527] The buggy address belongs to the object at ffff88810333d180
[   12.052527]  which belongs to the cache kmalloc-32 of size 32
[   12.052918] The buggy address is located 0 bytes inside of
[   12.052918]  freed 32-byte region [ffff88810333d180, ffff88810333d1a0)
[   12.054018] 
[   12.054161] The buggy address belongs to the physical page:
[   12.054472] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x10333d
[   12.054804] flags: 0x200000000000000(node=0|zone=2)
[   12.055023] page_type: f5(slab)
[   12.055158] raw: 0200000000000000 ffff888100041780 dead000000000122 0000000000000000
[   12.055639] raw: 0000000000000000 0000000080400040 00000000f5000000 0000000000000000
[   12.055896] page dumped because: kasan: bad access detected
[   12.056069] 
[   12.056155] Memory state around the buggy address:
[   12.056312]  ffff88810333d080: fa fb fb fb fc fc fc fc 00 00 00 fc fc fc fc fc
[   12.056688]  ffff88810333d100: 00 00 03 fc fc fc fc fc 00 00 07 fc fc fc fc fc
[   12.057170] >ffff88810333d180: fa fb fb fb fc fc fc fc fc fc fc fc fc fc fc fc
[   12.057884]                    ^
[   12.058065]  ffff88810333d200: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   12.058298]  ffff88810333d280: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   12.058514] ==================================================================