Date
June 2, 2025, 2:10 p.m.
Environment | |
---|---|
qemu-arm64 | |
qemu-x86_64 |
[ 20.670792] ================================================================== [ 20.671825] BUG: KASAN: slab-use-after-free in workqueue_uaf+0x498/0x4c0 [ 20.672119] Read of size 8 at addr fff00000c5c7fbc0 by task kunit_try_catch/187 [ 20.672383] [ 20.672515] CPU: 1 UID: 0 PID: 187 Comm: kunit_try_catch Tainted: G B N 6.12.32-rc1 #1 [ 20.672619] Tainted: [B]=BAD_PAGE, [N]=TEST [ 20.672653] Hardware name: linux,dummy-virt (DT) [ 20.672694] Call trace: [ 20.672720] dump_backtrace+0x9c/0x128 [ 20.672769] show_stack+0x20/0x38 [ 20.672809] dump_stack_lvl+0x8c/0xd0 [ 20.672857] print_report+0x118/0x5f0 [ 20.672898] kasan_report+0xdc/0x128 [ 20.672937] __asan_report_load8_noabort+0x20/0x30 [ 20.672986] workqueue_uaf+0x498/0x4c0 [ 20.673029] kunit_try_run_case+0x170/0x3f0 [ 20.673076] kunit_generic_run_threadfn_adapter+0x88/0x100 [ 20.673125] kthread+0x24c/0x2d0 [ 20.673168] ret_from_fork+0x10/0x20 [ 20.673214] [ 20.676966] Allocated by task 187: [ 20.677320] kasan_save_stack+0x3c/0x68 [ 20.677598] kasan_save_track+0x20/0x40 [ 20.677842] kasan_save_alloc_info+0x40/0x58 [ 20.678168] __kasan_kmalloc+0xd4/0xd8 [ 20.678407] __kmalloc_cache_noprof+0x154/0x320 [ 20.678710] workqueue_uaf+0x140/0x4c0 [ 20.678883] kunit_try_run_case+0x170/0x3f0 [ 20.679056] kunit_generic_run_threadfn_adapter+0x88/0x100 [ 20.679468] kthread+0x24c/0x2d0 [ 20.680359] ret_from_fork+0x10/0x20 [ 20.680774] [ 20.680895] Freed by task 47: [ 20.681200] kasan_save_stack+0x3c/0x68 [ 20.681433] kasan_save_track+0x20/0x40 [ 20.681818] kasan_save_free_info+0x4c/0x78 [ 20.682020] __kasan_slab_free+0x6c/0x98 [ 20.682422] kfree+0x110/0x3b8 [ 20.682751] workqueue_uaf_work+0x18/0x30 [ 20.683004] process_one_work+0x530/0xfa8 [ 20.683304] worker_thread+0x610/0xf18 [ 20.683552] kthread+0x24c/0x2d0 [ 20.683795] ret_from_fork+0x10/0x20 [ 20.684052] [ 20.684190] Last potentially related work creation: [ 20.684640] kasan_save_stack+0x3c/0x68 [ 20.685033] __kasan_record_aux_stack+0xbc/0xe8 [ 20.685395] kasan_record_aux_stack_noalloc+0x14/0x20 [ 20.685768] __queue_work+0x654/0xfd8 [ 20.685948] queue_work_on+0xbc/0xf8 [ 20.686395] workqueue_uaf+0x218/0x4c0 [ 20.686804] kunit_try_run_case+0x170/0x3f0 [ 20.687325] kunit_generic_run_threadfn_adapter+0x88/0x100 [ 20.687676] kthread+0x24c/0x2d0 [ 20.688011] ret_from_fork+0x10/0x20 [ 20.688300] [ 20.688546] The buggy address belongs to the object at fff00000c5c7fbc0 [ 20.688546] which belongs to the cache kmalloc-32 of size 32 [ 20.689293] The buggy address is located 0 bytes inside of [ 20.689293] freed 32-byte region [fff00000c5c7fbc0, fff00000c5c7fbe0) [ 20.689665] [ 20.689785] The buggy address belongs to the physical page: [ 20.689982] page: refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x105c7f [ 20.690276] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff) [ 20.690573] page_type: f5(slab) [ 20.690879] raw: 0bfffe0000000000 fff00000c0001780 dead000000000122 0000000000000000 [ 20.692222] raw: 0000000000000000 0000000080400040 00000001f5000000 0000000000000000 [ 20.692816] page dumped because: kasan: bad access detected [ 20.693207] [ 20.693437] Memory state around the buggy address: [ 20.693735] fff00000c5c7fa80: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc [ 20.694287] fff00000c5c7fb00: fa fb fb fb fc fc fc fc 00 00 07 fc fc fc fc fc [ 20.694744] >fff00000c5c7fb80: 00 00 00 fc fc fc fc fc fa fb fb fb fc fc fc fc [ 20.695289] ^ [ 20.695787] fff00000c5c7fc00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc [ 20.696379] fff00000c5c7fc80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc [ 20.696648] ==================================================================
[ 12.682154] ================================================================== [ 12.683422] BUG: KASAN: slab-use-after-free in workqueue_uaf+0x4d8/0x560 [ 12.683902] Read of size 8 at addr ffff88810261f1c0 by task kunit_try_catch/205 [ 12.684260] [ 12.684439] CPU: 0 UID: 0 PID: 205 Comm: kunit_try_catch Tainted: G B N 6.12.32-rc1 #1 [ 12.684512] Tainted: [B]=BAD_PAGE, [N]=TEST [ 12.684530] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014 [ 12.684562] Call Trace: [ 12.684584] <TASK> [ 12.684610] dump_stack_lvl+0x73/0xb0 [ 12.684654] print_report+0xd1/0x640 [ 12.684705] ? __virt_addr_valid+0x1db/0x2d0 [ 12.684739] ? workqueue_uaf+0x4d8/0x560 [ 12.684766] ? kasan_complete_mode_report_info+0x64/0x200 [ 12.684804] ? workqueue_uaf+0x4d8/0x560 [ 12.684837] kasan_report+0x140/0x180 [ 12.684916] ? workqueue_uaf+0x4d8/0x560 [ 12.684991] __asan_report_load8_noabort+0x18/0x20 [ 12.685027] workqueue_uaf+0x4d8/0x560 [ 12.685071] ? __pfx_workqueue_uaf+0x10/0x10 [ 12.685300] ? __schedule+0xc49/0x27a0 [ 12.685339] ? __pfx_read_tsc+0x10/0x10 [ 12.685411] ? ktime_get_ts64+0x84/0x230 [ 12.685538] kunit_try_run_case+0x1a6/0x480 [ 12.685617] ? __pfx_kunit_try_run_case+0x10/0x10 [ 12.685665] ? _raw_spin_lock_irqsave+0xa2/0x110 [ 12.685705] ? _raw_spin_unlock_irqrestore+0x5f/0x90 [ 12.685733] ? __kthread_parkme+0x82/0x160 [ 12.685753] ? preempt_count_sub+0x50/0x80 [ 12.685775] ? __pfx_kunit_try_run_case+0x10/0x10 [ 12.685794] ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10 [ 12.685818] kunit_generic_run_threadfn_adapter+0x85/0xf0 [ 12.685842] kthread+0x257/0x310 [ 12.685859] ? __pfx_kthread+0x10/0x10 [ 12.685878] ret_from_fork+0x41/0x80 [ 12.685908] ? __pfx_kthread+0x10/0x10 [ 12.685929] ret_from_fork_asm+0x1a/0x30 [ 12.685959] </TASK> [ 12.685972] [ 12.695914] Allocated by task 205: [ 12.696094] kasan_save_stack+0x45/0x70 [ 12.696335] kasan_save_track+0x18/0x40 [ 12.696759] kasan_save_alloc_info+0x3b/0x50 [ 12.697031] __kasan_kmalloc+0xb7/0xc0 [ 12.697705] __kmalloc_cache_noprof+0x168/0x350 [ 12.698115] workqueue_uaf+0x153/0x560 [ 12.698531] kunit_try_run_case+0x1a6/0x480 [ 12.698779] kunit_generic_run_threadfn_adapter+0x85/0xf0 [ 12.698984] kthread+0x257/0x310 [ 12.699401] ret_from_fork+0x41/0x80 [ 12.699590] ret_from_fork_asm+0x1a/0x30 [ 12.699874] [ 12.700045] Freed by task 10: [ 12.700402] kasan_save_stack+0x45/0x70 [ 12.700582] kasan_save_track+0x18/0x40 [ 12.700868] kasan_save_free_info+0x3f/0x60 [ 12.701471] __kasan_slab_free+0x56/0x70 [ 12.702348] kfree+0x123/0x3d0 [ 12.702516] workqueue_uaf_work+0x12/0x20 [ 12.702677] process_one_work+0x5ee/0xf60 [ 12.702832] worker_thread+0x753/0x1200 [ 12.702980] kthread+0x257/0x310 [ 12.703111] ret_from_fork+0x41/0x80 [ 12.703248] ret_from_fork_asm+0x1a/0x30 [ 12.703386] [ 12.703469] Last potentially related work creation: [ 12.703614] kasan_save_stack+0x45/0x70 [ 12.705642] __kasan_record_aux_stack+0xae/0xc0 [ 12.706380] kasan_record_aux_stack_noalloc+0xf/0x20 [ 12.708239] __queue_work+0x67e/0xf70 [ 12.708927] queue_work_on+0x74/0xa0 [ 12.709991] workqueue_uaf+0x26e/0x560 [ 12.710579] kunit_try_run_case+0x1a6/0x480 [ 12.710935] kunit_generic_run_threadfn_adapter+0x85/0xf0 [ 12.711313] kthread+0x257/0x310 [ 12.711559] ret_from_fork+0x41/0x80 [ 12.711737] ret_from_fork_asm+0x1a/0x30 [ 12.711889] [ 12.711976] The buggy address belongs to the object at ffff88810261f1c0 [ 12.711976] which belongs to the cache kmalloc-32 of size 32 [ 12.712572] The buggy address is located 0 bytes inside of [ 12.712572] freed 32-byte region [ffff88810261f1c0, ffff88810261f1e0) [ 12.712982] [ 12.713469] The buggy address belongs to the physical page: [ 12.713792] page: refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x10261f [ 12.714275] flags: 0x200000000000000(node=0|zone=2) [ 12.714638] page_type: f5(slab) [ 12.714922] raw: 0200000000000000 ffff888100041780 dead000000000122 0000000000000000 [ 12.716887] raw: 0000000000000000 0000000080400040 00000001f5000000 0000000000000000 [ 12.717756] page dumped because: kasan: bad access detected [ 12.718033] [ 12.718182] Memory state around the buggy address: [ 12.718708] ffff88810261f080: 00 00 05 fc fc fc fc fc fa fb fb fb fc fc fc fc [ 12.719041] ffff88810261f100: fa fb fb fb fc fc fc fc 00 00 07 fc fc fc fc fc [ 12.719543] >ffff88810261f180: 00 00 00 fc fc fc fc fc fa fb fb fb fc fc fc fc [ 12.719978] ^ [ 12.720360] ffff88810261f200: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc [ 12.721000] ffff88810261f280: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc [ 12.721388] ==================================================================