Hay
Date
July 17, 2025, 11:11 p.m.

Environment
qemu-arm64
qemu-x86_64

[   17.006840] ==================================================================
[   17.006980] BUG: KASAN: slab-use-after-free in workqueue_uaf+0x480/0x4a8
[   17.007066] Read of size 8 at addr fff00000c7859e00 by task kunit_try_catch/200
[   17.007118] 
[   17.007292] CPU: 1 UID: 0 PID: 200 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc6 #1 PREEMPT 
[   17.007510] Tainted: [B]=BAD_PAGE, [N]=TEST
[   17.007599] Hardware name: linux,dummy-virt (DT)
[   17.007673] Call trace:
[   17.007804]  show_stack+0x20/0x38 (C)
[   17.007874]  dump_stack_lvl+0x8c/0xd0
[   17.007925]  print_report+0x118/0x5d0
[   17.007978]  kasan_report+0xdc/0x128
[   17.008022]  __asan_report_load8_noabort+0x20/0x30
[   17.008361]  workqueue_uaf+0x480/0x4a8
[   17.008528]  kunit_try_run_case+0x170/0x3f0
[   17.008792]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   17.008910]  kthread+0x328/0x630
[   17.009265]  ret_from_fork+0x10/0x20
[   17.009570] 
[   17.009733] Allocated by task 200:
[   17.009846]  kasan_save_stack+0x3c/0x68
[   17.010288]  kasan_save_track+0x20/0x40
[   17.010484]  kasan_save_alloc_info+0x40/0x58
[   17.010540]  __kasan_kmalloc+0xd4/0xd8
[   17.010579]  __kmalloc_cache_noprof+0x16c/0x3c0
[   17.010619]  workqueue_uaf+0x13c/0x4a8
[   17.010665]  kunit_try_run_case+0x170/0x3f0
[   17.010703]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   17.010746]  kthread+0x328/0x630
[   17.010790]  ret_from_fork+0x10/0x20
[   17.010828] 
[   17.010858] Freed by task 48:
[   17.010914]  kasan_save_stack+0x3c/0x68
[   17.010954]  kasan_save_track+0x20/0x40
[   17.010998]  kasan_save_free_info+0x4c/0x78
[   17.011036]  __kasan_slab_free+0x6c/0x98
[   17.011077]  kfree+0x214/0x3c8
[   17.011110]  workqueue_uaf_work+0x18/0x30
[   17.011161]  process_one_work+0x530/0xf98
[   17.011197]  worker_thread+0x618/0xf38
[   17.011239]  kthread+0x328/0x630
[   17.011271]  ret_from_fork+0x10/0x20
[   17.011308] 
[   17.011329] Last potentially related work creation:
[   17.011355]  kasan_save_stack+0x3c/0x68
[   17.011392]  kasan_record_aux_stack+0xb4/0xc8
[   17.011432]  __queue_work+0x65c/0x1008
[   17.011468]  queue_work_on+0xbc/0xf8
[   17.011516]  workqueue_uaf+0x210/0x4a8
[   17.011554]  kunit_try_run_case+0x170/0x3f0
[   17.011596]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   17.011660]  kthread+0x328/0x630
[   17.011693]  ret_from_fork+0x10/0x20
[   17.011729] 
[   17.012045] The buggy address belongs to the object at fff00000c7859e00
[   17.012045]  which belongs to the cache kmalloc-32 of size 32
[   17.012168] The buggy address is located 0 bytes inside of
[   17.012168]  freed 32-byte region [fff00000c7859e00, fff00000c7859e20)
[   17.012229] 
[   17.012252] The buggy address belongs to the physical page:
[   17.012677] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x107859
[   17.012771] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   17.013030] page_type: f5(slab)
[   17.013113] raw: 0bfffe0000000000 fff00000c0001780 dead000000000122 0000000000000000
[   17.013322] raw: 0000000000000000 0000000080400040 00000000f5000000 0000000000000000
[   17.013485] page dumped because: kasan: bad access detected
[   17.013793] 
[   17.013816] Memory state around the buggy address:
[   17.014150]  fff00000c7859d00: 00 00 03 fc fc fc fc fc 00 00 07 fc fc fc fc fc
[   17.014263]  fff00000c7859d80: 00 00 00 fc fc fc fc fc 00 00 00 07 fc fc fc fc
[   17.014479] >fff00000c7859e00: fa fb fb fb fc fc fc fc 00 00 00 fc fc fc fc fc
[   17.014687]                    ^
[   17.014718]  fff00000c7859e80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   17.014787]  fff00000c7859f00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   17.015037] ==================================================================

[   12.896648] ==================================================================
[   12.897242] BUG: KASAN: slab-use-after-free in workqueue_uaf+0x4d6/0x560
[   12.897565] Read of size 8 at addr ffff8881026b6840 by task kunit_try_catch/217
[   12.898311] 
[   12.898513] CPU: 1 UID: 0 PID: 217 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc6 #1 PREEMPT(voluntary) 
[   12.898630] Tainted: [B]=BAD_PAGE, [N]=TEST
[   12.898646] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   12.898668] Call Trace:
[   12.898682]  <TASK>
[   12.898758]  dump_stack_lvl+0x73/0xb0
[   12.898795]  print_report+0xd1/0x610
[   12.898872]  ? __virt_addr_valid+0x1db/0x2d0
[   12.898897]  ? workqueue_uaf+0x4d6/0x560
[   12.898917]  ? kasan_complete_mode_report_info+0x64/0x200
[   12.898939]  ? workqueue_uaf+0x4d6/0x560
[   12.898960]  kasan_report+0x141/0x180
[   12.898981]  ? workqueue_uaf+0x4d6/0x560
[   12.899007]  __asan_report_load8_noabort+0x18/0x20
[   12.899031]  workqueue_uaf+0x4d6/0x560
[   12.899067]  ? __pfx_workqueue_uaf+0x10/0x10
[   12.899088]  ? __schedule+0x10cc/0x2b60
[   12.899111]  ? __pfx_read_tsc+0x10/0x10
[   12.899132]  ? ktime_get_ts64+0x86/0x230
[   12.899158]  kunit_try_run_case+0x1a5/0x480
[   12.899184]  ? __pfx_kunit_try_run_case+0x10/0x10
[   12.899205]  ? _raw_spin_lock_irqsave+0xa1/0x100
[   12.899229]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   12.899252]  ? __kthread_parkme+0x82/0x180
[   12.899272]  ? preempt_count_sub+0x50/0x80
[   12.899297]  ? __pfx_kunit_try_run_case+0x10/0x10
[   12.899320]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   12.899343]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   12.899365]  kthread+0x337/0x6f0
[   12.899384]  ? trace_preempt_on+0x20/0xc0
[   12.899407]  ? __pfx_kthread+0x10/0x10
[   12.899426]  ? _raw_spin_unlock_irq+0x47/0x80
[   12.899447]  ? calculate_sigpending+0x7b/0xa0
[   12.899471]  ? __pfx_kthread+0x10/0x10
[   12.899491]  ret_from_fork+0x116/0x1d0
[   12.899510]  ? __pfx_kthread+0x10/0x10
[   12.899529]  ret_from_fork_asm+0x1a/0x30
[   12.899563]  </TASK>
[   12.899573] 
[   12.909613] Allocated by task 217:
[   12.909982]  kasan_save_stack+0x45/0x70
[   12.910219]  kasan_save_track+0x18/0x40
[   12.910400]  kasan_save_alloc_info+0x3b/0x50
[   12.910600]  __kasan_kmalloc+0xb7/0xc0
[   12.911006]  __kmalloc_cache_noprof+0x189/0x420
[   12.911315]  workqueue_uaf+0x152/0x560
[   12.911559]  kunit_try_run_case+0x1a5/0x480
[   12.911777]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   12.912211]  kthread+0x337/0x6f0
[   12.912388]  ret_from_fork+0x116/0x1d0
[   12.912545]  ret_from_fork_asm+0x1a/0x30
[   12.912755] 
[   12.912853] Freed by task 72:
[   12.913000]  kasan_save_stack+0x45/0x70
[   12.913183]  kasan_save_track+0x18/0x40
[   12.913377]  kasan_save_free_info+0x3f/0x60
[   12.913574]  __kasan_slab_free+0x56/0x70
[   12.914423]  kfree+0x222/0x3f0
[   12.914552]  workqueue_uaf_work+0x12/0x20
[   12.915002]  process_one_work+0x5ee/0xf60
[   12.915291]  worker_thread+0x758/0x1220
[   12.915544]  kthread+0x337/0x6f0
[   12.915752]  ret_from_fork+0x116/0x1d0
[   12.916001]  ret_from_fork_asm+0x1a/0x30
[   12.916378] 
[   12.916457] Last potentially related work creation:
[   12.916681]  kasan_save_stack+0x45/0x70
[   12.917018]  kasan_record_aux_stack+0xb2/0xc0
[   12.917250]  __queue_work+0x626/0xeb0
[   12.917420]  queue_work_on+0xb6/0xc0
[   12.917589]  workqueue_uaf+0x26d/0x560
[   12.918071]  kunit_try_run_case+0x1a5/0x480
[   12.918261]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   12.918686]  kthread+0x337/0x6f0
[   12.918920]  ret_from_fork+0x116/0x1d0
[   12.919088]  ret_from_fork_asm+0x1a/0x30
[   12.919291] 
[   12.919510] The buggy address belongs to the object at ffff8881026b6840
[   12.919510]  which belongs to the cache kmalloc-32 of size 32
[   12.920284] The buggy address is located 0 bytes inside of
[   12.920284]  freed 32-byte region [ffff8881026b6840, ffff8881026b6860)
[   12.921122] 
[   12.921224] The buggy address belongs to the physical page:
[   12.921441] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1026b6
[   12.922091] flags: 0x200000000000000(node=0|zone=2)
[   12.922339] page_type: f5(slab)
[   12.922496] raw: 0200000000000000 ffff888100041780 dead000000000122 0000000000000000
[   12.923076] raw: 0000000000000000 0000000080400040 00000000f5000000 0000000000000000
[   12.923465] page dumped because: kasan: bad access detected
[   12.923760] 
[   12.923981] Memory state around the buggy address:
[   12.924307]  ffff8881026b6700: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc
[   12.924696]  ffff8881026b6780: 00 00 00 fc fc fc fc fc fa fb fb fb fc fc fc fc
[   12.925407] >ffff8881026b6800: 00 00 00 fc fc fc fc fc fa fb fb fb fc fc fc fc
[   12.925735]                                            ^
[   12.926127]  ffff8881026b6880: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   12.926463]  ffff8881026b6900: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   12.926988] ==================================================================