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

Environment
qemu-arm64
qemu-x86_64

[   17.269201] ==================================================================
[   17.269274] BUG: KASAN: slab-use-after-free in workqueue_uaf+0x480/0x4a8
[   17.269331] Read of size 8 at addr fff00000c589be40 by task kunit_try_catch/201
[   17.269636] 
[   17.270009] CPU: 0 UID: 0 PID: 201 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc5 #1 PREEMPT 
[   17.270206] Tainted: [B]=BAD_PAGE, [N]=TEST
[   17.270236] Hardware name: linux,dummy-virt (DT)
[   17.270382] Call trace:
[   17.270406]  show_stack+0x20/0x38 (C)
[   17.270597]  dump_stack_lvl+0x8c/0xd0
[   17.270648]  print_report+0x118/0x608
[   17.270695]  kasan_report+0xdc/0x128
[   17.271231]  __asan_report_load8_noabort+0x20/0x30
[   17.271288]  workqueue_uaf+0x480/0x4a8
[   17.271386]  kunit_try_run_case+0x170/0x3f0
[   17.271574]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   17.271921]  kthread+0x328/0x630
[   17.272202]  ret_from_fork+0x10/0x20
[   17.272464] 
[   17.272489] Allocated by task 201:
[   17.272520]  kasan_save_stack+0x3c/0x68
[   17.272565]  kasan_save_track+0x20/0x40
[   17.272603]  kasan_save_alloc_info+0x40/0x58
[   17.272975]  __kasan_kmalloc+0xd4/0xd8
[   17.273031]  __kmalloc_cache_noprof+0x16c/0x3c0
[   17.273073]  workqueue_uaf+0x13c/0x4a8
[   17.273118]  kunit_try_run_case+0x170/0x3f0
[   17.273578]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   17.273631]  kthread+0x328/0x630
[   17.273769]  ret_from_fork+0x10/0x20
[   17.274074] 
[   17.274108] Freed by task 76:
[   17.274137]  kasan_save_stack+0x3c/0x68
[   17.274255]  kasan_save_track+0x20/0x40
[   17.274296]  kasan_save_free_info+0x4c/0x78
[   17.274334]  __kasan_slab_free+0x6c/0x98
[   17.274370]  kfree+0x214/0x3c8
[   17.274894]  workqueue_uaf_work+0x18/0x30
[   17.275030]  process_one_work+0x530/0xf98
[   17.275162]  worker_thread+0x618/0xf38
[   17.275365]  kthread+0x328/0x630
[   17.275407]  ret_from_fork+0x10/0x20
[   17.275444] 
[   17.275464] Last potentially related work creation:
[   17.275704]  kasan_save_stack+0x3c/0x68
[   17.275943]  kasan_record_aux_stack+0xb4/0xc8
[   17.276175]  __queue_work+0x65c/0x1008
[   17.276218]  queue_work_on+0xbc/0xf8
[   17.276252]  workqueue_uaf+0x210/0x4a8
[   17.276288]  kunit_try_run_case+0x170/0x3f0
[   17.276324]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   17.276370]  kthread+0x328/0x630
[   17.276402]  ret_from_fork+0x10/0x20
[   17.276440] 
[   17.276458] The buggy address belongs to the object at fff00000c589be40
[   17.276458]  which belongs to the cache kmalloc-32 of size 32
[   17.277301] The buggy address is located 0 bytes inside of
[   17.277301]  freed 32-byte region [fff00000c589be40, fff00000c589be60)
[   17.277380] 
[   17.277401] The buggy address belongs to the physical page:
[   17.277434] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x10589b
[   17.277490] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   17.277541] page_type: f5(slab)
[   17.278088] raw: 0bfffe0000000000 fff00000c0001780 dead000000000122 0000000000000000
[   17.278765] raw: 0000000000000000 0000000080400040 00000000f5000000 0000000000000000
[   17.278962] page dumped because: kasan: bad access detected
[   17.279061] 
[   17.279080] Memory state around the buggy address:
[   17.279115]  fff00000c589bd00: 00 00 00 fc fc fc fc fc 00 00 03 fc fc fc fc fc
[   17.279370]  fff00000c589bd80: 00 00 07 fc fc fc fc fc 00 00 00 fc fc fc fc fc
[   17.279413] >fff00000c589be00: 00 00 00 07 fc fc fc fc fa fb fb fb fc fc fc fc
[   17.279452]                                            ^
[   17.279747]  fff00000c589be80: 00 00 00 fc fc fc fc fc fc fc fc fc fc fc fc fc
[   17.280051]  fff00000c589bf00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   17.280306] ==================================================================

[   12.967007] ==================================================================
[   12.967650] BUG: KASAN: slab-use-after-free in workqueue_uaf+0x4d6/0x560
[   12.968000] Read of size 8 at addr ffff888102c62d80 by task kunit_try_catch/217
[   12.968593] 
[   12.968715] CPU: 0 UID: 0 PID: 217 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc5 #1 PREEMPT(voluntary) 
[   12.969019] Tainted: [B]=BAD_PAGE, [N]=TEST
[   12.969035] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   12.969055] Call Trace:
[   12.969067]  <TASK>
[   12.969083]  dump_stack_lvl+0x73/0xb0
[   12.969114]  print_report+0xd1/0x650
[   12.969136]  ? __virt_addr_valid+0x1db/0x2d0
[   12.969159]  ? workqueue_uaf+0x4d6/0x560
[   12.969180]  ? kasan_complete_mode_report_info+0x64/0x200
[   12.969203]  ? workqueue_uaf+0x4d6/0x560
[   12.969224]  kasan_report+0x141/0x180
[   12.969246]  ? workqueue_uaf+0x4d6/0x560
[   12.969272]  __asan_report_load8_noabort+0x18/0x20
[   12.969296]  workqueue_uaf+0x4d6/0x560
[   12.969318]  ? __pfx_workqueue_uaf+0x10/0x10
[   12.969341]  ? __schedule+0x10cc/0x2b60
[   12.969364]  ? __pfx_read_tsc+0x10/0x10
[   12.969385]  ? ktime_get_ts64+0x86/0x230
[   12.969410]  kunit_try_run_case+0x1a5/0x480
[   12.969434]  ? __pfx_kunit_try_run_case+0x10/0x10
[   12.969457]  ? _raw_spin_lock_irqsave+0xa1/0x100
[   12.969481]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   12.969505]  ? __kthread_parkme+0x82/0x180
[   12.969525]  ? preempt_count_sub+0x50/0x80
[   12.969549]  ? __pfx_kunit_try_run_case+0x10/0x10
[   12.969573]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   12.969597]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   12.969622]  kthread+0x337/0x6f0
[   12.969641]  ? trace_preempt_on+0x20/0xc0
[   12.969665]  ? __pfx_kthread+0x10/0x10
[   12.969686]  ? _raw_spin_unlock_irq+0x47/0x80
[   12.969709]  ? calculate_sigpending+0x7b/0xa0
[   12.969737]  ? __pfx_kthread+0x10/0x10
[   12.969759]  ret_from_fork+0x116/0x1d0
[   12.969777]  ? __pfx_kthread+0x10/0x10
[   12.969812]  ret_from_fork_asm+0x1a/0x30
[   12.969844]  </TASK>
[   12.969853] 
[   12.980444] Allocated by task 217:
[   12.980785]  kasan_save_stack+0x45/0x70
[   12.981217]  kasan_save_track+0x18/0x40
[   12.981572]  kasan_save_alloc_info+0x3b/0x50
[   12.981985]  __kasan_kmalloc+0xb7/0xc0
[   12.982492]  __kmalloc_cache_noprof+0x189/0x420
[   12.982944]  workqueue_uaf+0x152/0x560
[   12.983369]  kunit_try_run_case+0x1a5/0x480
[   12.983694]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   12.984144]  kthread+0x337/0x6f0
[   12.984431]  ret_from_fork+0x116/0x1d0
[   12.984563]  ret_from_fork_asm+0x1a/0x30
[   12.984704] 
[   12.984800] Freed by task 9:
[   12.985141]  kasan_save_stack+0x45/0x70
[   12.985480]  kasan_save_track+0x18/0x40
[   12.985839]  kasan_save_free_info+0x3f/0x60
[   12.986399]  __kasan_slab_free+0x56/0x70
[   12.986732]  kfree+0x222/0x3f0
[   12.986852]  workqueue_uaf_work+0x12/0x20
[   12.987319]  process_one_work+0x5ee/0xf60
[   12.987682]  worker_thread+0x758/0x1220
[   12.987896]  kthread+0x337/0x6f0
[   12.988141]  ret_from_fork+0x116/0x1d0
[   12.988478]  ret_from_fork_asm+0x1a/0x30
[   12.988872] 
[   12.989003] Last potentially related work creation:
[   12.989383]  kasan_save_stack+0x45/0x70
[   12.989617]  kasan_record_aux_stack+0xb2/0xc0
[   12.989774]  __queue_work+0x626/0xeb0
[   12.989906]  queue_work_on+0xb6/0xc0
[   12.990227]  workqueue_uaf+0x26d/0x560
[   12.990579]  kunit_try_run_case+0x1a5/0x480
[   12.990969]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   12.991490]  kthread+0x337/0x6f0
[   12.991789]  ret_from_fork+0x116/0x1d0
[   12.992234]  ret_from_fork_asm+0x1a/0x30
[   12.992615] 
[   12.992767] The buggy address belongs to the object at ffff888102c62d80
[   12.992767]  which belongs to the cache kmalloc-32 of size 32
[   12.993607] The buggy address is located 0 bytes inside of
[   12.993607]  freed 32-byte region [ffff888102c62d80, ffff888102c62da0)
[   12.994604] 
[   12.994785] The buggy address belongs to the physical page:
[   12.995339] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x102c62
[   12.995874] flags: 0x200000000000000(node=0|zone=2)
[   12.996412] page_type: f5(slab)
[   12.996718] raw: 0200000000000000 ffff888100041780 dead000000000122 0000000000000000
[   12.997091] raw: 0000000000000000 0000000080400040 00000000f5000000 0000000000000000
[   12.997754] page dumped because: kasan: bad access detected
[   12.998178] 
[   12.998495] Memory state around the buggy address:
[   12.998856]  ffff888102c62c80: 00 00 07 fc fc fc fc fc fa fb fb fb fc fc fc fc
[   12.999156]  ffff888102c62d00: 00 00 07 fc fc fc fc fc 00 00 00 fc fc fc fc fc
[   12.999743] >ffff888102c62d80: fa fb fb fb fc fc fc fc fc fc fc fc fc fc fc fc
[   13.000400]                    ^
[   13.000688]  ffff888102c62e00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   13.000962]  ffff888102c62e80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   13.001243] ==================================================================