Hay
Date
June 23, 2025, 7:07 a.m.

Environment
qemu-arm64
qemu-x86_64

[   33.652346] ==================================================================
[   33.652965] BUG: KASAN: slab-use-after-free in workqueue_uaf+0x480/0x4a8
[   33.653412] Read of size 8 at addr fff00000c57bf600 by task kunit_try_catch/212
[   33.653968] 
[   33.654077] CPU: 1 UID: 0 PID: 212 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc3-next-20250623 #1 PREEMPT 
[   33.654589] Tainted: [B]=BAD_PAGE, [N]=TEST
[   33.655072] Hardware name: linux,dummy-virt (DT)
[   33.655165] Call trace:
[   33.655793]  show_stack+0x20/0x38 (C)
[   33.655972]  dump_stack_lvl+0x8c/0xd0
[   33.656159]  print_report+0x118/0x608
[   33.656487]  kasan_report+0xdc/0x128
[   33.656969]  __asan_report_load8_noabort+0x20/0x30
[   33.657351]  workqueue_uaf+0x480/0x4a8
[   33.657653]  kunit_try_run_case+0x170/0x3f0
[   33.657901]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   33.658207]  kthread+0x328/0x630
[   33.658676]  ret_from_fork+0x10/0x20
[   33.659214] 
[   33.659272] Allocated by task 212:
[   33.659359]  kasan_save_stack+0x3c/0x68
[   33.659467]  kasan_save_track+0x20/0x40
[   33.659569]  kasan_save_alloc_info+0x40/0x58
[   33.659675]  __kasan_kmalloc+0xd4/0xd8
[   33.660321]  __kmalloc_cache_noprof+0x16c/0x3c0
[   33.661001]  workqueue_uaf+0x13c/0x4a8
[   33.661143]  kunit_try_run_case+0x170/0x3f0
[   33.661879]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   33.662525]  kthread+0x328/0x630
[   33.662627]  ret_from_fork+0x10/0x20
[   33.662730] 
[   33.662795] Freed by task 24:
[   33.663519]  kasan_save_stack+0x3c/0x68
[   33.663678]  kasan_save_track+0x20/0x40
[   33.664231]  kasan_save_free_info+0x4c/0x78
[   33.664625]  __kasan_slab_free+0x6c/0x98
[   33.664739]  kfree+0x214/0x3c8
[   33.665073]  workqueue_uaf_work+0x18/0x30
[   33.665190]  process_one_work+0x530/0xf98
[   33.665490]  worker_thread+0x618/0xf38
[   33.665910]  kthread+0x328/0x630
[   33.666001]  ret_from_fork+0x10/0x20
[   33.666116] 
[   33.666270] Last potentially related work creation:
[   33.666475]  kasan_save_stack+0x3c/0x68
[   33.666808]  kasan_record_aux_stack+0xb4/0xc8
[   33.667374]  __queue_work+0x65c/0xfe0
[   33.667554]  queue_work_on+0xbc/0xf8
[   33.667812]  workqueue_uaf+0x210/0x4a8
[   33.667935]  kunit_try_run_case+0x170/0x3f0
[   33.668051]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   33.668199]  kthread+0x328/0x630
[   33.668288]  ret_from_fork+0x10/0x20
[   33.668423] 
[   33.668492] The buggy address belongs to the object at fff00000c57bf600
[   33.668492]  which belongs to the cache kmalloc-32 of size 32
[   33.668626] The buggy address is located 0 bytes inside of
[   33.668626]  freed 32-byte region [fff00000c57bf600, fff00000c57bf620)
[   33.668778] 
[   33.668827] The buggy address belongs to the physical page:
[   33.668908] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1057bf
[   33.669049] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   33.669179] page_type: f5(slab)
[   33.669545] raw: 0bfffe0000000000 fff00000c0001780 dead000000000122 0000000000000000
[   33.669730] raw: 0000000000000000 0000000080400040 00000000f5000000 0000000000000000
[   33.669895] page dumped because: kasan: bad access detected
[   33.670004] 
[   33.670070] Memory state around the buggy address:
[   33.670207]  fff00000c57bf500: 00 00 03 fc fc fc fc fc 00 00 07 fc fc fc fc fc
[   33.670324]  fff00000c57bf580: 00 00 00 fc fc fc fc fc 00 00 00 07 fc fc fc fc
[   33.670477] >fff00000c57bf600: fa fb fb fb fc fc fc fc fc fc fc fc fc fc fc fc
[   33.670584]                    ^
[   33.670907]  fff00000c57bf680: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   33.671043]  fff00000c57bf700: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   33.671141] ==================================================================

[   22.444239] ==================================================================
[   22.444836] BUG: KASAN: slab-use-after-free in workqueue_uaf+0x4d6/0x560
[   22.445246] Read of size 8 at addr ffff888102c09540 by task kunit_try_catch/229
[   22.446084] 
[   22.446271] CPU: 1 UID: 0 PID: 229 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc3-next-20250623 #1 PREEMPT(voluntary) 
[   22.446362] Tainted: [B]=BAD_PAGE, [N]=TEST
[   22.446401] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   22.446437] Call Trace:
[   22.446459]  <TASK>
[   22.446487]  dump_stack_lvl+0x73/0xb0
[   22.446539]  print_report+0xd1/0x650
[   22.446576]  ? __virt_addr_valid+0x1db/0x2d0
[   22.446616]  ? workqueue_uaf+0x4d6/0x560
[   22.446647]  ? kasan_complete_mode_report_info+0x64/0x200
[   22.446692]  ? workqueue_uaf+0x4d6/0x560
[   22.446731]  kasan_report+0x141/0x180
[   22.446769]  ? workqueue_uaf+0x4d6/0x560
[   22.446809]  __asan_report_load8_noabort+0x18/0x20
[   22.447046]  workqueue_uaf+0x4d6/0x560
[   22.447109]  ? __pfx_workqueue_uaf+0x10/0x10
[   22.447146]  ? __schedule+0x10cc/0x2b60
[   22.447182]  ? __pfx_read_tsc+0x10/0x10
[   22.447220]  ? ktime_get_ts64+0x86/0x230
[   22.447264]  kunit_try_run_case+0x1a5/0x480
[   22.447305]  ? __pfx_kunit_try_run_case+0x10/0x10
[   22.447336]  ? _raw_spin_lock_irqsave+0xa1/0x100
[   22.447369]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   22.447420]  ? __kthread_parkme+0x82/0x180
[   22.447452]  ? preempt_count_sub+0x50/0x80
[   22.447494]  ? __pfx_kunit_try_run_case+0x10/0x10
[   22.447530]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   22.447561]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   22.447590]  kthread+0x337/0x6f0
[   22.447615]  ? trace_preempt_on+0x20/0xc0
[   22.447645]  ? __pfx_kthread+0x10/0x10
[   22.447672]  ? _raw_spin_unlock_irq+0x47/0x80
[   22.447701]  ? calculate_sigpending+0x7b/0xa0
[   22.447731]  ? __pfx_kthread+0x10/0x10
[   22.447759]  ret_from_fork+0x116/0x1d0
[   22.447784]  ? __pfx_kthread+0x10/0x10
[   22.447811]  ret_from_fork_asm+0x1a/0x30
[   22.447866]  </TASK>
[   22.447883] 
[   22.456499] Allocated by task 229:
[   22.456724]  kasan_save_stack+0x45/0x70
[   22.457014]  kasan_save_track+0x18/0x40
[   22.457462]  kasan_save_alloc_info+0x3b/0x50
[   22.457644]  __kasan_kmalloc+0xb7/0xc0
[   22.457897]  __kmalloc_cache_noprof+0x189/0x420
[   22.458091]  workqueue_uaf+0x152/0x560
[   22.458330]  kunit_try_run_case+0x1a5/0x480
[   22.458495]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   22.458677]  kthread+0x337/0x6f0
[   22.458808]  ret_from_fork+0x116/0x1d0
[   22.458945]  ret_from_fork_asm+0x1a/0x30
[   22.459100] 
[   22.459231] Freed by task 71:
[   22.459830]  kasan_save_stack+0x45/0x70
[   22.460308]  kasan_save_track+0x18/0x40
[   22.460628]  kasan_save_free_info+0x3f/0x60
[   22.460927]  __kasan_slab_free+0x56/0x70
[   22.461351]  kfree+0x222/0x3f0
[   22.461624]  workqueue_uaf_work+0x12/0x20
[   22.461891]  process_one_work+0x5ee/0xf60
[   22.462344]  worker_thread+0x758/0x1220
[   22.462666]  kthread+0x337/0x6f0
[   22.462812]  ret_from_fork+0x116/0x1d0
[   22.463068]  ret_from_fork_asm+0x1a/0x30
[   22.463655] 
[   22.463746] Last potentially related work creation:
[   22.463893]  kasan_save_stack+0x45/0x70
[   22.464042]  kasan_record_aux_stack+0xb2/0xc0
[   22.464198]  __queue_work+0x61a/0xe70
[   22.464339]  queue_work_on+0xb6/0xc0
[   22.464605]  workqueue_uaf+0x26d/0x560
[   22.465094]  kunit_try_run_case+0x1a5/0x480
[   22.465427]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   22.465785]  kthread+0x337/0x6f0
[   22.466094]  ret_from_fork+0x116/0x1d0
[   22.466358]  ret_from_fork_asm+0x1a/0x30
[   22.466659] 
[   22.466793] The buggy address belongs to the object at ffff888102c09540
[   22.466793]  which belongs to the cache kmalloc-32 of size 32
[   22.467648] The buggy address is located 0 bytes inside of
[   22.467648]  freed 32-byte region [ffff888102c09540, ffff888102c09560)
[   22.468349] 
[   22.468466] The buggy address belongs to the physical page:
[   22.468640] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x102c09
[   22.468878] flags: 0x200000000000000(node=0|zone=2)
[   22.469053] page_type: f5(slab)
[   22.469189] raw: 0200000000000000 ffff888100041780 dead000000000122 0000000000000000
[   22.469465] raw: 0000000000000000 0000000080400040 00000000f5000000 0000000000000000
[   22.470055] page dumped because: kasan: bad access detected
[   22.470461] 
[   22.470612] Memory state around the buggy address:
[   22.471122]  ffff888102c09400: 00 00 05 fc fc fc fc fc fa fb fb fb fc fc fc fc
[   22.472094]  ffff888102c09480: fa fb fb fb fc fc fc fc 00 00 07 fc fc fc fc fc
[   22.472435] >ffff888102c09500: 00 00 00 fc fc fc fc fc fa fb fb fb fc fc fc fc
[   22.472821]                                            ^
[   22.473397]  ffff888102c09580: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   22.473630]  ffff888102c09600: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   22.474259] ==================================================================