Hay
Date
May 26, 2025, 9:10 a.m.

Environment
qemu-arm64
qemu-x86_64

[   18.081312] ==================================================================
[   18.081491] BUG: KASAN: slab-use-after-free in workqueue_uaf+0x480/0x4a8
[   18.081631] Read of size 8 at addr fff00000c78b61c0 by task kunit_try_catch/200
[   18.081773] 
[   18.081859] CPU: 0 UID: 0 PID: 200 Comm: kunit_try_catch Tainted: G    B            N  6.15.0-rc7-next-20250526 #1 PREEMPT 
[   18.082072] Tainted: [B]=BAD_PAGE, [N]=TEST
[   18.082167] Hardware name: linux,dummy-virt (DT)
[   18.082263] Call trace:
[   18.082368]  show_stack+0x20/0x38 (C)
[   18.082549]  dump_stack_lvl+0x8c/0xd0
[   18.082700]  print_report+0x118/0x608
[   18.082891]  kasan_report+0xdc/0x128
[   18.082998]  __asan_report_load8_noabort+0x20/0x30
[   18.083122]  workqueue_uaf+0x480/0x4a8
[   18.083255]  kunit_try_run_case+0x170/0x3f0
[   18.083385]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   18.083523]  kthread+0x328/0x630
[   18.083622]  ret_from_fork+0x10/0x20
[   18.083747] 
[   18.083772] Allocated by task 200:
[   18.083811]  kasan_save_stack+0x3c/0x68
[   18.083862]  kasan_save_track+0x20/0x40
[   18.083903]  kasan_save_alloc_info+0x40/0x58
[   18.083947]  __kasan_kmalloc+0xd4/0xd8
[   18.083987]  __kmalloc_cache_noprof+0x15c/0x3c0
[   18.084032]  workqueue_uaf+0x13c/0x4a8
[   18.084072]  kunit_try_run_case+0x170/0x3f0
[   18.084113]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   18.084160]  kthread+0x328/0x630
[   18.084196]  ret_from_fork+0x10/0x20
[   18.084235] 
[   18.084257] Freed by task 10:
[   18.084285]  kasan_save_stack+0x3c/0x68
[   18.084353]  kasan_save_track+0x20/0x40
[   18.084433]  kasan_save_free_info+0x4c/0x78
[   18.084586]  __kasan_slab_free+0x6c/0x98
[   18.084758]  kfree+0x214/0x3c8
[   18.084862]  workqueue_uaf_work+0x18/0x30
[   18.084956]  process_one_work+0x530/0xf98
[   18.085277]  worker_thread+0x8ac/0xf28
[   18.085617]  kthread+0x328/0x630
[   18.085685]  ret_from_fork+0x10/0x20
[   18.085770] 
[   18.085816] Last potentially related work creation:
[   18.085880]  kasan_save_stack+0x3c/0x68
[   18.085973]  kasan_record_aux_stack+0xb4/0xc8
[   18.086066]  __queue_work+0x65c/0x1010
[   18.086577]  queue_work_on+0xbc/0xf8
[   18.086742]  workqueue_uaf+0x210/0x4a8
[   18.087296]  kunit_try_run_case+0x170/0x3f0
[   18.087431]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   18.087544]  kthread+0x328/0x630
[   18.088136]  ret_from_fork+0x10/0x20
[   18.088369] 
[   18.088519] The buggy address belongs to the object at fff00000c78b61c0
[   18.088519]  which belongs to the cache kmalloc-32 of size 32
[   18.088688] The buggy address is located 0 bytes inside of
[   18.088688]  freed 32-byte region [fff00000c78b61c0, fff00000c78b61e0)
[   18.088899] 
[   18.088963] The buggy address belongs to the physical page:
[   18.089333] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1078b6
[   18.089673] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   18.089835] page_type: f5(slab)
[   18.089929] raw: 0bfffe0000000000 fff00000c0001780 dead000000000122 0000000000000000
[   18.090045] raw: 0000000000000000 0000000080400040 00000000f5000000 0000000000000000
[   18.090554] page dumped because: kasan: bad access detected
[   18.090651] 
[   18.090695] Memory state around the buggy address:
[   18.090772]  fff00000c78b6080: 00 00 00 fc fc fc fc fc 00 00 03 fc fc fc fc fc
[   18.090869]  fff00000c78b6100: 00 00 07 fc fc fc fc fc 00 00 00 fc fc fc fc fc
[   18.090968] >fff00000c78b6180: 00 00 00 07 fc fc fc fc fa fb fb fb fc fc fc fc
[   18.091058]                                            ^
[   18.091219]  fff00000c78b6200: 00 00 00 fc fc fc fc fc fc fc fc fc fc fc fc fc
[   18.091568]  fff00000c78b6280: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   18.091722] ==================================================================


[   11.581937] ==================================================================
[   11.582977] BUG: KASAN: slab-use-after-free in workqueue_uaf+0x4d6/0x560
[   11.583643] Read of size 8 at addr ffff888102824d40 by task kunit_try_catch/218
[   11.584104] 
[   11.584225] CPU: 0 UID: 0 PID: 218 Comm: kunit_try_catch Tainted: G    B            N  6.15.0-rc7-next-20250526 #1 PREEMPT(voluntary) 
[   11.584271] Tainted: [B]=BAD_PAGE, [N]=TEST
[   11.584283] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   11.584304] Call Trace:
[   11.584316]  <TASK>
[   11.584333]  dump_stack_lvl+0x73/0xb0
[   11.584362]  print_report+0xd1/0x650
[   11.584398]  ? __virt_addr_valid+0x1db/0x2d0
[   11.584420]  ? workqueue_uaf+0x4d6/0x560
[   11.584441]  ? kasan_complete_mode_report_info+0x64/0x200
[   11.584463]  ? workqueue_uaf+0x4d6/0x560
[   11.584484]  kasan_report+0x141/0x180
[   11.584807]  ? workqueue_uaf+0x4d6/0x560
[   11.584836]  __asan_report_load8_noabort+0x18/0x20
[   11.584857]  workqueue_uaf+0x4d6/0x560
[   11.584879]  ? __pfx_workqueue_uaf+0x10/0x10
[   11.584901]  ? __schedule+0x10cc/0x2b60
[   11.584926]  ? __pfx_read_tsc+0x10/0x10
[   11.584946]  ? ktime_get_ts64+0x86/0x230
[   11.584971]  kunit_try_run_case+0x1a5/0x480
[   11.584992]  ? __pfx_kunit_try_run_case+0x10/0x10
[   11.585083]  ? _raw_spin_lock_irqsave+0xa1/0x100
[   11.585108]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   11.585133]  ? __kthread_parkme+0x82/0x180
[   11.585153]  ? preempt_count_sub+0x50/0x80
[   11.585176]  ? __pfx_kunit_try_run_case+0x10/0x10
[   11.585196]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   11.585220]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   11.585243]  kthread+0x337/0x6f0
[   11.585262]  ? trace_preempt_on+0x20/0xc0
[   11.585285]  ? __pfx_kthread+0x10/0x10
[   11.585305]  ? _raw_spin_unlock_irq+0x47/0x80
[   11.585327]  ? calculate_sigpending+0x7b/0xa0
[   11.585352]  ? __pfx_kthread+0x10/0x10
[   11.585373]  ret_from_fork+0x116/0x1d0
[   11.585403]  ? __pfx_kthread+0x10/0x10
[   11.585423]  ret_from_fork_asm+0x1a/0x30
[   11.585453]  </TASK>
[   11.585464] 
[   11.595878] Allocated by task 218:
[   11.596431]  kasan_save_stack+0x45/0x70
[   11.596623]  kasan_save_track+0x18/0x40
[   11.596854]  kasan_save_alloc_info+0x3b/0x50
[   11.597427]  __kasan_kmalloc+0xb7/0xc0
[   11.597749]  __kmalloc_cache_noprof+0x189/0x420
[   11.597986]  workqueue_uaf+0x152/0x560
[   11.598438]  kunit_try_run_case+0x1a5/0x480
[   11.598627]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   11.599095]  kthread+0x337/0x6f0
[   11.599365]  ret_from_fork+0x116/0x1d0
[   11.599677]  ret_from_fork_asm+0x1a/0x30
[   11.600051] 
[   11.600238] Freed by task 9:
[   11.600364]  kasan_save_stack+0x45/0x70
[   11.600584]  kasan_save_track+0x18/0x40
[   11.601267]  kasan_save_free_info+0x3f/0x60
[   11.601488]  __kasan_slab_free+0x56/0x70
[   11.601805]  kfree+0x222/0x3f0
[   11.602114]  workqueue_uaf_work+0x12/0x20
[   11.602303]  process_one_work+0x5ee/0xf60
[   11.602677]  worker_thread+0x758/0x1220
[   11.603041]  kthread+0x337/0x6f0
[   11.603286]  ret_from_fork+0x116/0x1d0
[   11.603601]  ret_from_fork_asm+0x1a/0x30
[   11.604012] 
[   11.604138] Last potentially related work creation:
[   11.604368]  kasan_save_stack+0x45/0x70
[   11.604657]  kasan_record_aux_stack+0xb2/0xc0
[   11.605246]  __queue_work+0x626/0xeb0
[   11.605466]  queue_work_on+0xb6/0xc0
[   11.605646]  workqueue_uaf+0x26d/0x560
[   11.605935]  kunit_try_run_case+0x1a5/0x480
[   11.606194]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   11.606623]  kthread+0x337/0x6f0
[   11.606804]  ret_from_fork+0x116/0x1d0
[   11.607216]  ret_from_fork_asm+0x1a/0x30
[   11.607437] 
[   11.607522] The buggy address belongs to the object at ffff888102824d40
[   11.607522]  which belongs to the cache kmalloc-32 of size 32
[   11.608406] The buggy address is located 0 bytes inside of
[   11.608406]  freed 32-byte region [ffff888102824d40, ffff888102824d60)
[   11.608983] 
[   11.609071] The buggy address belongs to the physical page:
[   11.609536] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x102824
[   11.609947] flags: 0x200000000000000(node=0|zone=2)
[   11.610234] page_type: f5(slab)
[   11.610392] raw: 0200000000000000 ffff888100041780 dead000000000122 0000000000000000
[   11.610729] raw: 0000000000000000 0000000080400040 00000000f5000000 0000000000000000
[   11.611019] page dumped because: kasan: bad access detected
[   11.611271] 
[   11.611421] Memory state around the buggy address:
[   11.611612]  ffff888102824c00: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc
[   11.612057]  ffff888102824c80: 00 00 00 fc fc fc fc fc 00 00 03 fc fc fc fc fc
[   11.612533] >ffff888102824d00: 00 00 07 fc fc fc fc fc fa fb fb fb fc fc fc fc
[   11.613286]                                            ^
[   11.613561]  ffff888102824d80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   11.614126]  ffff888102824e00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   11.614517] ==================================================================