Date
July 4, 2025, 11:10 a.m.
Environment | |
---|---|
qemu-arm64 | |
qemu-x86_64 |
[ 29.921969] ================================================================== [ 29.922038] BUG: KASAN: slab-use-after-free in workqueue_uaf+0x480/0x4a8 [ 29.922090] Read of size 8 at addr fff00000c9b3dac0 by task kunit_try_catch/233 [ 29.922141] [ 29.922175] CPU: 0 UID: 0 PID: 233 Comm: kunit_try_catch Tainted: G B N 6.16.0-rc4-next-20250704 #1 PREEMPT [ 29.922262] Tainted: [B]=BAD_PAGE, [N]=TEST [ 29.922301] Hardware name: linux,dummy-virt (DT) [ 29.922343] Call trace: [ 29.922369] show_stack+0x20/0x38 (C) [ 29.922417] dump_stack_lvl+0x8c/0xd0 [ 29.922498] print_report+0x118/0x608 [ 29.922547] kasan_report+0xdc/0x128 [ 29.922592] __asan_report_load8_noabort+0x20/0x30 [ 29.922652] workqueue_uaf+0x480/0x4a8 [ 29.922709] kunit_try_run_case+0x170/0x3f0 [ 29.922758] kunit_generic_run_threadfn_adapter+0x88/0x100 [ 29.922812] kthread+0x328/0x630 [ 29.922867] ret_from_fork+0x10/0x20 [ 29.924210] [ 29.924319] Allocated by task 233: [ 29.924411] kasan_save_stack+0x3c/0x68 [ 29.924485] kasan_save_track+0x20/0x40 [ 29.924815] kasan_save_alloc_info+0x40/0x58 [ 29.925018] __kasan_kmalloc+0xd4/0xd8 [ 29.925177] __kmalloc_cache_noprof+0x16c/0x3c0 [ 29.925337] workqueue_uaf+0x13c/0x4a8 [ 29.925656] kunit_try_run_case+0x170/0x3f0 [ 29.926044] kunit_generic_run_threadfn_adapter+0x88/0x100 [ 29.926245] kthread+0x328/0x630 [ 29.926292] ret_from_fork+0x10/0x20 [ 29.926488] [ 29.926514] Freed by task 9: [ 29.926541] kasan_save_stack+0x3c/0x68 [ 29.926864] kasan_save_track+0x20/0x40 [ 29.927023] kasan_save_free_info+0x4c/0x78 [ 29.927254] __kasan_slab_free+0x6c/0x98 [ 29.927472] kfree+0x214/0x3c8 [ 29.927694] workqueue_uaf_work+0x18/0x30 [ 29.927759] process_one_work+0x530/0xf98 [ 29.927988] worker_thread+0x618/0xf38 [ 29.928099] kthread+0x328/0x630 [ 29.928189] ret_from_fork+0x10/0x20 [ 29.928419] [ 29.928442] Last potentially related work creation: [ 29.928476] kasan_save_stack+0x3c/0x68 [ 29.928825] kasan_record_aux_stack+0xb4/0xc8 [ 29.928974] __queue_work+0x65c/0xfe0 [ 29.929186] queue_work_on+0xbc/0xf8 [ 29.929336] workqueue_uaf+0x210/0x4a8 [ 29.929395] kunit_try_run_case+0x170/0x3f0 [ 29.929503] kunit_generic_run_threadfn_adapter+0x88/0x100 [ 29.929985] kthread+0x328/0x630 [ 29.930231] ret_from_fork+0x10/0x20 [ 29.930418] [ 29.930441] The buggy address belongs to the object at fff00000c9b3dac0 [ 29.930441] which belongs to the cache kmalloc-32 of size 32 [ 29.930667] The buggy address is located 0 bytes inside of [ 29.930667] freed 32-byte region [fff00000c9b3dac0, fff00000c9b3dae0) [ 29.930841] [ 29.930887] The buggy address belongs to the physical page: [ 29.930950] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x109b3d [ 29.931263] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff) [ 29.931405] page_type: f5(slab) [ 29.931671] raw: 0bfffe0000000000 fff00000c0001780 dead000000000122 0000000000000000 [ 29.931817] raw: 0000000000000000 0000000080400040 00000000f5000000 0000000000000000 [ 29.931861] page dumped because: kasan: bad access detected [ 29.932248] [ 29.932381] Memory state around the buggy address: [ 29.932725] fff00000c9b3d980: 00 00 00 fc fc fc fc fc 00 00 03 fc fc fc fc fc [ 29.932837] fff00000c9b3da00: 00 00 07 fc fc fc fc fc 00 00 00 fc fc fc fc fc [ 29.932882] >fff00000c9b3da80: 00 00 00 07 fc fc fc fc fa fb fb fb fc fc fc fc [ 29.933310] ^ [ 29.933487] fff00000c9b3db00: 00 00 00 fc fc fc fc fc 00 00 00 fc fc fc fc fc [ 29.933565] fff00000c9b3db80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc [ 29.933680] ==================================================================
[ 25.576309] ================================================================== [ 25.577074] BUG: KASAN: slab-use-after-free in workqueue_uaf+0x4d6/0x560 [ 25.577573] Read of size 8 at addr ffff888104516100 by task kunit_try_catch/249 [ 25.578146] [ 25.578602] CPU: 1 UID: 0 PID: 249 Comm: kunit_try_catch Tainted: G B N 6.16.0-rc4-next-20250704 #1 PREEMPT(voluntary) [ 25.578679] Tainted: [B]=BAD_PAGE, [N]=TEST [ 25.578694] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014 [ 25.578765] Call Trace: [ 25.578782] <TASK> [ 25.578806] dump_stack_lvl+0x73/0xb0 [ 25.578844] print_report+0xd1/0x650 [ 25.578870] ? __virt_addr_valid+0x1db/0x2d0 [ 25.578910] ? workqueue_uaf+0x4d6/0x560 [ 25.578932] ? kasan_complete_mode_report_info+0x64/0x200 [ 25.578960] ? workqueue_uaf+0x4d6/0x560 [ 25.578983] kasan_report+0x141/0x180 [ 25.579007] ? workqueue_uaf+0x4d6/0x560 [ 25.579035] __asan_report_load8_noabort+0x18/0x20 [ 25.579060] workqueue_uaf+0x4d6/0x560 [ 25.579084] ? __pfx_workqueue_uaf+0x10/0x10 [ 25.579108] ? __schedule+0x10cc/0x2b60 [ 25.579134] ? __pfx_read_tsc+0x10/0x10 [ 25.579171] ? ktime_get_ts64+0x86/0x230 [ 25.579200] kunit_try_run_case+0x1a5/0x480 [ 25.579231] ? __pfx_kunit_try_run_case+0x10/0x10 [ 25.579257] ? _raw_spin_lock_irqsave+0xa1/0x100 [ 25.579283] ? _raw_spin_unlock_irqrestore+0x5f/0x90 [ 25.579309] ? __kthread_parkme+0x82/0x180 [ 25.579333] ? preempt_count_sub+0x50/0x80 [ 25.579359] ? __pfx_kunit_try_run_case+0x10/0x10 [ 25.579386] kunit_generic_run_threadfn_adapter+0x85/0xf0 [ 25.579424] ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10 [ 25.579450] kthread+0x337/0x6f0 [ 25.579472] ? trace_preempt_on+0x20/0xc0 [ 25.579499] ? __pfx_kthread+0x10/0x10 [ 25.579521] ? _raw_spin_unlock_irq+0x47/0x80 [ 25.579545] ? calculate_sigpending+0x7b/0xa0 [ 25.579572] ? __pfx_kthread+0x10/0x10 [ 25.579596] ret_from_fork+0x116/0x1d0 [ 25.579617] ? __pfx_kthread+0x10/0x10 [ 25.579639] ret_from_fork_asm+0x1a/0x30 [ 25.579674] </TASK> [ 25.579689] [ 25.589790] Allocated by task 249: [ 25.590113] kasan_save_stack+0x45/0x70 [ 25.590713] kasan_save_track+0x18/0x40 [ 25.590895] kasan_save_alloc_info+0x3b/0x50 [ 25.591672] __kasan_kmalloc+0xb7/0xc0 [ 25.591903] __kmalloc_cache_noprof+0x189/0x420 [ 25.592147] workqueue_uaf+0x152/0x560 [ 25.592532] kunit_try_run_case+0x1a5/0x480 [ 25.592901] kunit_generic_run_threadfn_adapter+0x85/0xf0 [ 25.593406] kthread+0x337/0x6f0 [ 25.593602] ret_from_fork+0x116/0x1d0 [ 25.594046] ret_from_fork_asm+0x1a/0x30 [ 25.594497] [ 25.594609] Freed by task 41: [ 25.594769] kasan_save_stack+0x45/0x70 [ 25.595185] kasan_save_track+0x18/0x40 [ 25.595530] kasan_save_free_info+0x3f/0x60 [ 25.595948] __kasan_slab_free+0x56/0x70 [ 25.596311] kfree+0x222/0x3f0 [ 25.596487] workqueue_uaf_work+0x12/0x20 [ 25.596694] process_one_work+0x5ee/0xf60 [ 25.597054] worker_thread+0x758/0x1220 [ 25.597360] kthread+0x337/0x6f0 [ 25.597516] ret_from_fork+0x116/0x1d0 [ 25.597724] ret_from_fork_asm+0x1a/0x30 [ 25.597982] [ 25.598081] Last potentially related work creation: [ 25.598313] kasan_save_stack+0x45/0x70 [ 25.598623] kasan_record_aux_stack+0xb2/0xc0 [ 25.598845] __queue_work+0x61a/0xe70 [ 25.599069] queue_work_on+0xb6/0xc0 [ 25.599222] workqueue_uaf+0x26d/0x560 [ 25.599562] kunit_try_run_case+0x1a5/0x480 [ 25.599823] kunit_generic_run_threadfn_adapter+0x85/0xf0 [ 25.600047] kthread+0x337/0x6f0 [ 25.600324] ret_from_fork+0x116/0x1d0 [ 25.600552] ret_from_fork_asm+0x1a/0x30 [ 25.600715] [ 25.600789] The buggy address belongs to the object at ffff888104516100 [ 25.600789] which belongs to the cache kmalloc-32 of size 32 [ 25.601816] The buggy address is located 0 bytes inside of [ 25.601816] freed 32-byte region [ffff888104516100, ffff888104516120) [ 25.602453] [ 25.602594] The buggy address belongs to the physical page: [ 25.602853] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x104516 [ 25.603244] flags: 0x200000000000000(node=0|zone=2) [ 25.603608] page_type: f5(slab) [ 25.603810] raw: 0200000000000000 ffff888100041780 dead000000000122 0000000000000000 [ 25.604175] raw: 0000000000000000 0000000080400040 00000000f5000000 0000000000000000 [ 25.604625] page dumped because: kasan: bad access detected [ 25.604814] [ 25.604940] Memory state around the buggy address: [ 25.605423] ffff888104516000: 00 00 00 fc fc fc fc fc 00 00 03 fc fc fc fc fc [ 25.605674] ffff888104516080: 00 00 07 fc fc fc fc fc 00 00 00 fc fc fc fc fc [ 25.606258] >ffff888104516100: fa fb fb fb fc fc fc fc fc fc fc fc fc fc fc fc [ 25.606651] ^ [ 25.606803] ffff888104516180: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc [ 25.607411] ffff888104516200: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc [ 25.607727] ==================================================================