Hay
Date
July 9, 2025, 2:07 p.m.

Environment
qemu-arm64
qemu-x86_64

[   17.980905] ==================================================================
[   17.981068] BUG: KASAN: slab-use-after-free in workqueue_uaf+0x480/0x4a8
[   17.981146] Read of size 8 at addr fff00000c6558fc0 by task kunit_try_catch/200
[   17.981219] 
[   17.981266] CPU: 0 UID: 0 PID: 200 Comm: kunit_try_catch Tainted: G    B   W        N  6.16.0-rc5 #1 PREEMPT 
[   17.981358] Tainted: [B]=BAD_PAGE, [W]=WARN, [N]=TEST
[   17.981388] Hardware name: linux,dummy-virt (DT)
[   17.981422] Call trace:
[   17.981445]  show_stack+0x20/0x38 (C)
[   17.981503]  dump_stack_lvl+0x8c/0xd0
[   17.981554]  print_report+0x118/0x608
[   17.981631]  kasan_report+0xdc/0x128
[   17.981697]  __asan_report_load8_noabort+0x20/0x30
[   17.981748]  workqueue_uaf+0x480/0x4a8
[   17.982034]  kunit_try_run_case+0x170/0x3f0
[   17.982213]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   17.982348]  kthread+0x328/0x630
[   17.982393]  ret_from_fork+0x10/0x20
[   17.982442] 
[   17.982461] Allocated by task 200:
[   17.982489]  kasan_save_stack+0x3c/0x68
[   17.982556]  kasan_save_track+0x20/0x40
[   17.982594]  kasan_save_alloc_info+0x40/0x58
[   17.982635]  __kasan_kmalloc+0xd4/0xd8
[   17.982802]  __kmalloc_cache_noprof+0x16c/0x3c0
[   17.982895]  workqueue_uaf+0x13c/0x4a8
[   17.982933]  kunit_try_run_case+0x170/0x3f0
[   17.983185]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   17.983347]  kthread+0x328/0x630
[   17.983488]  ret_from_fork+0x10/0x20
[   17.983588] 
[   17.983607] Freed by task 10:
[   17.983649]  kasan_save_stack+0x3c/0x68
[   17.984056]  kasan_save_track+0x20/0x40
[   17.984220]  kasan_save_free_info+0x4c/0x78
[   17.984332]  __kasan_slab_free+0x6c/0x98
[   17.984372]  kfree+0x214/0x3c8
[   17.984805]  workqueue_uaf_work+0x18/0x30
[   17.984914]  process_one_work+0x530/0xf98
[   17.985041]  worker_thread+0x618/0xf38
[   17.985124]  kthread+0x328/0x630
[   17.985156]  ret_from_fork+0x10/0x20
[   17.985194] 
[   17.985214] Last potentially related work creation:
[   17.985239]  kasan_save_stack+0x3c/0x68
[   17.985297]  kasan_record_aux_stack+0xb4/0xc8
[   17.985900]  __queue_work+0x65c/0x1008
[   17.985957]  queue_work_on+0xbc/0xf8
[   17.985995]  workqueue_uaf+0x210/0x4a8
[   17.986032]  kunit_try_run_case+0x170/0x3f0
[   17.986071]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   17.986126]  kthread+0x328/0x630
[   17.986426]  ret_from_fork+0x10/0x20
[   17.986568] 
[   17.986671] The buggy address belongs to the object at fff00000c6558fc0
[   17.986671]  which belongs to the cache kmalloc-32 of size 32
[   17.986808] The buggy address is located 0 bytes inside of
[   17.986808]  freed 32-byte region [fff00000c6558fc0, fff00000c6558fe0)
[   17.986889] 
[   17.986915] The buggy address belongs to the physical page:
[   17.986947] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x106558
[   17.987018] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   17.987079] page_type: f5(slab)
[   17.987149] raw: 0bfffe0000000000 fff00000c0001780 dead000000000122 0000000000000000
[   17.987201] raw: 0000000000000000 0000000000400040 00000000f5000000 0000000000000000
[   17.987252] page dumped because: kasan: bad access detected
[   17.987284] 
[   17.987303] Memory state around the buggy address:
[   17.987335]  fff00000c6558e80: 00 00 00 fc fc fc fc fc 00 00 03 fc fc fc fc fc
[   17.987378]  fff00000c6558f00: 00 00 07 fc fc fc fc fc 00 00 00 fc fc fc fc fc
[   17.987421] >fff00000c6558f80: 00 00 00 07 fc fc fc fc fa fb fb fb fc fc fc fc
[   17.987472]                                            ^
[   17.987507]  fff00000c6559000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   17.987567]  fff00000c6559080: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   17.987606] ==================================================================

[   13.381534] ==================================================================
[   13.382585] BUG: KASAN: slab-use-after-free in workqueue_uaf+0x4d6/0x560
[   13.383340] Read of size 8 at addr ffff888103950d40 by task kunit_try_catch/217
[   13.383573] 
[   13.383683] CPU: 1 UID: 0 PID: 217 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc5 #1 PREEMPT(voluntary) 
[   13.383730] Tainted: [B]=BAD_PAGE, [N]=TEST
[   13.383741] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   13.383762] Call Trace:
[   13.383774]  <TASK>
[   13.383791]  dump_stack_lvl+0x73/0xb0
[   13.383835]  print_report+0xd1/0x650
[   13.383857]  ? __virt_addr_valid+0x1db/0x2d0
[   13.383881]  ? workqueue_uaf+0x4d6/0x560
[   13.383901]  ? kasan_complete_mode_report_info+0x64/0x200
[   13.383923]  ? workqueue_uaf+0x4d6/0x560
[   13.383944]  kasan_report+0x141/0x180
[   13.383966]  ? workqueue_uaf+0x4d6/0x560
[   13.383991]  __asan_report_load8_noabort+0x18/0x20
[   13.384016]  workqueue_uaf+0x4d6/0x560
[   13.384037]  ? __pfx_workqueue_uaf+0x10/0x10
[   13.384059]  ? __schedule+0x10cc/0x2b60
[   13.384081]  ? __pfx_read_tsc+0x10/0x10
[   13.384102]  ? ktime_get_ts64+0x86/0x230
[   13.384127]  kunit_try_run_case+0x1a5/0x480
[   13.384152]  ? __pfx_kunit_try_run_case+0x10/0x10
[   13.384174]  ? _raw_spin_lock_irqsave+0xa1/0x100
[   13.384198]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   13.384220]  ? __kthread_parkme+0x82/0x180
[   13.384242]  ? preempt_count_sub+0x50/0x80
[   13.384278]  ? __pfx_kunit_try_run_case+0x10/0x10
[   13.384302]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   13.384325]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   13.384350]  kthread+0x337/0x6f0
[   13.384368]  ? trace_preempt_on+0x20/0xc0
[   13.384392]  ? __pfx_kthread+0x10/0x10
[   13.384412]  ? _raw_spin_unlock_irq+0x47/0x80
[   13.384433]  ? calculate_sigpending+0x7b/0xa0
[   13.384457]  ? __pfx_kthread+0x10/0x10
[   13.384478]  ret_from_fork+0x116/0x1d0
[   13.384496]  ? __pfx_kthread+0x10/0x10
[   13.384515]  ret_from_fork_asm+0x1a/0x30
[   13.384546]  </TASK>
[   13.384556] 
[   13.393180] Allocated by task 217:
[   13.393346]  kasan_save_stack+0x45/0x70
[   13.393562]  kasan_save_track+0x18/0x40
[   13.393769]  kasan_save_alloc_info+0x3b/0x50
[   13.394177]  __kasan_kmalloc+0xb7/0xc0
[   13.394376]  __kmalloc_cache_noprof+0x189/0x420
[   13.394615]  workqueue_uaf+0x152/0x560
[   13.394767]  kunit_try_run_case+0x1a5/0x480
[   13.395058]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   13.395304]  kthread+0x337/0x6f0
[   13.395455]  ret_from_fork+0x116/0x1d0
[   13.395588]  ret_from_fork_asm+0x1a/0x30
[   13.395740] 
[   13.395809] Freed by task 70:
[   13.395963]  kasan_save_stack+0x45/0x70
[   13.396151]  kasan_save_track+0x18/0x40
[   13.396384]  kasan_save_free_info+0x3f/0x60
[   13.396567]  __kasan_slab_free+0x56/0x70
[   13.396740]  kfree+0x222/0x3f0
[   13.397083]  workqueue_uaf_work+0x12/0x20
[   13.397248]  process_one_work+0x5ee/0xf60
[   13.397393]  worker_thread+0x758/0x1220
[   13.397587]  kthread+0x337/0x6f0
[   13.397790]  ret_from_fork+0x116/0x1d0
[   13.398218]  ret_from_fork_asm+0x1a/0x30
[   13.398399] 
[   13.398494] Last potentially related work creation:
[   13.398683]  kasan_save_stack+0x45/0x70
[   13.398851]  kasan_record_aux_stack+0xb2/0xc0
[   13.399133]  __queue_work+0x626/0xeb0
[   13.399324]  queue_work_on+0xb6/0xc0
[   13.399474]  workqueue_uaf+0x26d/0x560
[   13.399622]  kunit_try_run_case+0x1a5/0x480
[   13.399919]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   13.400190]  kthread+0x337/0x6f0
[   13.400361]  ret_from_fork+0x116/0x1d0
[   13.400499]  ret_from_fork_asm+0x1a/0x30
[   13.400651] 
[   13.400748] The buggy address belongs to the object at ffff888103950d40
[   13.400748]  which belongs to the cache kmalloc-32 of size 32
[   13.401362] The buggy address is located 0 bytes inside of
[   13.401362]  freed 32-byte region [ffff888103950d40, ffff888103950d60)
[   13.402075] 
[   13.402161] The buggy address belongs to the physical page:
[   13.402407] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x103950
[   13.402669] flags: 0x200000000000000(node=0|zone=2)
[   13.402977] page_type: f5(slab)
[   13.403162] raw: 0200000000000000 ffff888100041780 dead000000000122 0000000000000000
[   13.403462] raw: 0000000000000000 0000000080400040 00000000f5000000 0000000000000000
[   13.403796] page dumped because: kasan: bad access detected
[   13.404021] 
[   13.404115] Memory state around the buggy address:
[   13.404309]  ffff888103950c00: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc
[   13.404568]  ffff888103950c80: fa fb fb fb fc fc fc fc 00 00 07 fc fc fc fc fc
[   13.404864] >ffff888103950d00: 00 00 00 fc fc fc fc fc fa fb fb fb fc fc fc fc
[   13.405171]                                            ^
[   13.405412]  ffff888103950d80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   13.405729]  ffff888103950e00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   13.405995] ==================================================================