Date
June 7, 2025, 10:40 a.m.
Environment | |
---|---|
qemu-arm64 | |
qemu-x86_64 |
[ 23.259259] ================================================================== [ 23.259382] BUG: KASAN: slab-use-after-free in workqueue_uaf+0x480/0x4a8 [ 23.259566] Read of size 8 at addr fff00000c7765ac0 by task kunit_try_catch/204 [ 23.259701] [ 23.259799] CPU: 1 UID: 0 PID: 204 Comm: kunit_try_catch Tainted: G B N 6.15.2-rc1 #1 PREEMPT [ 23.260027] Tainted: [B]=BAD_PAGE, [N]=TEST [ 23.260097] Hardware name: linux,dummy-virt (DT) [ 23.260445] Call trace: [ 23.260540] show_stack+0x20/0x38 (C) [ 23.260667] dump_stack_lvl+0x8c/0xd0 [ 23.260775] print_report+0x118/0x608 [ 23.260875] kasan_report+0xdc/0x128 [ 23.260984] __asan_report_load8_noabort+0x20/0x30 [ 23.261108] workqueue_uaf+0x480/0x4a8 [ 23.261221] kunit_try_run_case+0x170/0x3f0 [ 23.261345] kunit_generic_run_threadfn_adapter+0x88/0x100 [ 23.261474] kthread+0x328/0x630 [ 23.261560] ret_from_fork+0x10/0x20 [ 23.261870] [ 23.261930] Allocated by task 204: [ 23.262003] kasan_save_stack+0x3c/0x68 [ 23.262102] kasan_save_track+0x20/0x40 [ 23.262185] kasan_save_alloc_info+0x40/0x58 [ 23.262558] __kasan_kmalloc+0xd4/0xd8 [ 23.262846] __kmalloc_cache_noprof+0x16c/0x3c0 [ 23.262994] workqueue_uaf+0x13c/0x4a8 [ 23.263090] kunit_try_run_case+0x170/0x3f0 [ 23.263503] kunit_generic_run_threadfn_adapter+0x88/0x100 [ 23.263636] kthread+0x328/0x630 [ 23.263750] ret_from_fork+0x10/0x20 [ 23.263888] [ 23.263933] Freed by task 32: [ 23.264014] kasan_save_stack+0x3c/0x68 [ 23.264157] kasan_save_track+0x20/0x40 [ 23.264246] kasan_save_free_info+0x4c/0x78 [ 23.264382] __kasan_slab_free+0x6c/0x98 [ 23.264496] kfree+0x214/0x3c8 [ 23.264612] workqueue_uaf_work+0x18/0x30 [ 23.264723] process_one_work+0x530/0xf98 [ 23.264814] worker_thread+0x618/0xf38 [ 23.264895] kthread+0x328/0x630 [ 23.264987] ret_from_fork+0x10/0x20 [ 23.265115] [ 23.265245] Last potentially related work creation: [ 23.265315] kasan_save_stack+0x3c/0x68 [ 23.265416] kasan_record_aux_stack+0xb4/0xc8 [ 23.265507] __queue_work+0x65c/0x1008 [ 23.265594] queue_work_on+0xbc/0xf8 [ 23.265721] workqueue_uaf+0x210/0x4a8 [ 23.265816] kunit_try_run_case+0x170/0x3f0 [ 23.265956] kunit_generic_run_threadfn_adapter+0x88/0x100 [ 23.266054] kthread+0x328/0x630 [ 23.266163] ret_from_fork+0x10/0x20 [ 23.266273] [ 23.266344] The buggy address belongs to the object at fff00000c7765ac0 [ 23.266344] which belongs to the cache kmalloc-32 of size 32 [ 23.266636] The buggy address is located 0 bytes inside of [ 23.266636] freed 32-byte region [fff00000c7765ac0, fff00000c7765ae0) [ 23.266812] [ 23.266872] The buggy address belongs to the physical page: [ 23.266955] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x107765 [ 23.267094] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff) [ 23.267215] page_type: f5(slab) [ 23.267305] raw: 0bfffe0000000000 fff00000c0001780 dead000000000122 0000000000000000 [ 23.267451] raw: 0000000000000000 0000000080400040 00000000f5000000 0000000000000000 [ 23.267549] page dumped because: kasan: bad access detected [ 23.267620] [ 23.267668] Memory state around the buggy address: [ 23.267764] fff00000c7765980: fa fb fb fb fc fc fc fc 00 00 00 fc fc fc fc fc [ 23.267901] fff00000c7765a00: 00 00 03 fc fc fc fc fc 00 00 07 fc fc fc fc fc [ 23.268009] >fff00000c7765a80: 00 00 00 07 fc fc fc fc fa fb fb fb fc fc fc fc [ 23.268100] ^ [ 23.268208] fff00000c7765b00: 00 00 00 fc fc fc fc fc fc fc fc fc fc fc fc fc [ 23.268346] fff00000c7765b80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc [ 23.268468] ==================================================================
[ 14.472116] ================================================================== [ 14.472746] BUG: KASAN: slab-use-after-free in workqueue_uaf+0x4d6/0x560 [ 14.473273] Read of size 8 at addr ffff888102d9fd00 by task kunit_try_catch/220 [ 14.473732] [ 14.473892] CPU: 1 UID: 0 PID: 220 Comm: kunit_try_catch Tainted: G B N 6.15.2-rc1 #1 PREEMPT(voluntary) [ 14.473996] Tainted: [B]=BAD_PAGE, [N]=TEST [ 14.474023] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014 [ 14.474065] Call Trace: [ 14.474099] <TASK> [ 14.474135] dump_stack_lvl+0x73/0xb0 [ 14.474185] print_report+0xd1/0x650 [ 14.474222] ? __virt_addr_valid+0x1db/0x2d0 [ 14.474248] ? workqueue_uaf+0x4d6/0x560 [ 14.474270] ? kasan_complete_mode_report_info+0x64/0x200 [ 14.474294] ? workqueue_uaf+0x4d6/0x560 [ 14.474332] kasan_report+0x141/0x180 [ 14.474375] ? workqueue_uaf+0x4d6/0x560 [ 14.474429] __asan_report_load8_noabort+0x18/0x20 [ 14.474467] workqueue_uaf+0x4d6/0x560 [ 14.474512] ? __pfx_workqueue_uaf+0x10/0x10 [ 14.475516] ? __pfx_workqueue_uaf+0x10/0x10 [ 14.475740] kunit_try_run_case+0x1a5/0x480 [ 14.475781] ? __pfx_kunit_try_run_case+0x10/0x10 [ 14.475807] ? _raw_spin_lock_irqsave+0xa1/0x100 [ 14.475833] ? _raw_spin_unlock_irqrestore+0x5f/0x90 [ 14.475857] ? __kthread_parkme+0x82/0x180 [ 14.475882] ? preempt_count_sub+0x50/0x80 [ 14.475911] ? __pfx_kunit_try_run_case+0x10/0x10 [ 14.475936] kunit_generic_run_threadfn_adapter+0x85/0xf0 [ 14.475960] ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10 [ 14.475984] kthread+0x337/0x6f0 [ 14.476003] ? trace_preempt_on+0x20/0xc0 [ 14.476029] ? __pfx_kthread+0x10/0x10 [ 14.476049] ? _raw_spin_unlock_irq+0x47/0x80 [ 14.476071] ? calculate_sigpending+0x7b/0xa0 [ 14.476095] ? __pfx_kthread+0x10/0x10 [ 14.476115] ret_from_fork+0x41/0x80 [ 14.476138] ? __pfx_kthread+0x10/0x10 [ 14.476158] ret_from_fork_asm+0x1a/0x30 [ 14.476190] </TASK> [ 14.476205] [ 14.490413] Allocated by task 220: [ 14.491103] kasan_save_stack+0x45/0x70 [ 14.491342] kasan_save_track+0x18/0x40 [ 14.491970] kasan_save_alloc_info+0x3b/0x50 [ 14.492289] __kasan_kmalloc+0xb7/0xc0 [ 14.493101] __kmalloc_cache_noprof+0x189/0x420 [ 14.493346] workqueue_uaf+0x152/0x560 [ 14.493497] kunit_try_run_case+0x1a5/0x480 [ 14.493904] kunit_generic_run_threadfn_adapter+0x85/0xf0 [ 14.494314] kthread+0x337/0x6f0 [ 14.495407] ret_from_fork+0x41/0x80 [ 14.495727] ret_from_fork_asm+0x1a/0x30 [ 14.495917] [ 14.496084] Freed by task 24: [ 14.496320] kasan_save_stack+0x45/0x70 [ 14.497152] kasan_save_track+0x18/0x40 [ 14.497379] kasan_save_free_info+0x3f/0x60 [ 14.497591] __kasan_slab_free+0x56/0x70 [ 14.498342] kfree+0x222/0x3f0 [ 14.498785] workqueue_uaf_work+0x12/0x20 [ 14.499080] process_one_work+0x5ee/0xf60 [ 14.499274] worker_thread+0x758/0x1220 [ 14.499573] kthread+0x337/0x6f0 [ 14.500486] ret_from_fork+0x41/0x80 [ 14.500844] ret_from_fork_asm+0x1a/0x30 [ 14.501140] [ 14.501282] Last potentially related work creation: [ 14.501524] kasan_save_stack+0x45/0x70 [ 14.502246] kasan_record_aux_stack+0xb2/0xc0 [ 14.502423] __queue_work+0x626/0xeb0 [ 14.503022] queue_work_on+0xb6/0xc0 [ 14.503217] workqueue_uaf+0x26d/0x560 [ 14.503907] kunit_try_run_case+0x1a5/0x480 [ 14.504158] kunit_generic_run_threadfn_adapter+0x85/0xf0 [ 14.504333] kthread+0x337/0x6f0 [ 14.504577] ret_from_fork+0x41/0x80 [ 14.505456] ret_from_fork_asm+0x1a/0x30 [ 14.505868] [ 14.506366] The buggy address belongs to the object at ffff888102d9fd00 [ 14.506366] which belongs to the cache kmalloc-32 of size 32 [ 14.506988] The buggy address is located 0 bytes inside of [ 14.506988] freed 32-byte region [ffff888102d9fd00, ffff888102d9fd20) [ 14.508173] [ 14.508314] The buggy address belongs to the physical page: [ 14.508504] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x102d9f [ 14.509114] flags: 0x200000000000000(node=0|zone=2) [ 14.509510] page_type: f5(slab) [ 14.510492] raw: 0200000000000000 ffff888100041780 dead000000000122 0000000000000000 [ 14.511254] raw: 0000000000000000 0000000080400040 00000000f5000000 0000000000000000 [ 14.511920] page dumped because: kasan: bad access detected [ 14.512343] [ 14.512515] Memory state around the buggy address: [ 14.513158] ffff888102d9fc00: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc [ 14.513419] ffff888102d9fc80: fa fb fb fb fc fc fc fc 00 00 00 fc fc fc fc fc [ 14.513970] >ffff888102d9fd00: fa fb fb fb fc fc fc fc fc fc fc fc fc fc fc fc [ 14.514425] ^ [ 14.515510] ffff888102d9fd80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc [ 14.516256] ffff888102d9fe00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc [ 14.516526] ==================================================================