Date
May 13, 2025, 12:07 p.m.
Environment | |
---|---|
qemu-arm64 | |
qemu-x86_64 |
[ 19.471102] ================================================================== [ 19.471193] BUG: KASAN: slab-use-after-free in kmalloc_uaf2+0x3f4/0x468 [ 19.471277] Read of size 1 at addr fff00000c77800a8 by task kunit_try_catch/188 [ 19.471335] [ 19.471385] CPU: 1 UID: 0 PID: 188 Comm: kunit_try_catch Tainted: G B N 6.15.0-rc6-next-20250513 #1 PREEMPT [ 19.471483] Tainted: [B]=BAD_PAGE, [N]=TEST [ 19.471516] Hardware name: linux,dummy-virt (DT) [ 19.471555] Call trace: [ 19.471583] show_stack+0x20/0x38 (C) [ 19.471643] dump_stack_lvl+0x8c/0xd0 [ 19.471698] print_report+0x118/0x608 [ 19.471750] kasan_report+0xdc/0x128 [ 19.471799] __asan_report_load1_noabort+0x20/0x30 [ 19.471856] kmalloc_uaf2+0x3f4/0x468 [ 19.471909] kunit_try_run_case+0x170/0x3f0 [ 19.471961] kunit_generic_run_threadfn_adapter+0x88/0x100 [ 19.472037] kthread+0x328/0x630 [ 19.472090] ret_from_fork+0x10/0x20 [ 19.472147] [ 19.472167] Allocated by task 188: [ 19.472200] kasan_save_stack+0x3c/0x68 [ 19.472249] kasan_save_track+0x20/0x40 [ 19.472305] kasan_save_alloc_info+0x40/0x58 [ 19.472349] __kasan_kmalloc+0xd4/0xd8 [ 19.472388] __kmalloc_cache_noprof+0x15c/0x3c0 [ 19.472431] kmalloc_uaf2+0xc4/0x468 [ 19.472473] kunit_try_run_case+0x170/0x3f0 [ 19.472514] kunit_generic_run_threadfn_adapter+0x88/0x100 [ 19.472560] kthread+0x328/0x630 [ 19.472598] ret_from_fork+0x10/0x20 [ 19.472638] [ 19.472659] Freed by task 188: [ 19.472688] kasan_save_stack+0x3c/0x68 [ 19.472726] kasan_save_track+0x20/0x40 [ 19.472762] kasan_save_free_info+0x4c/0x78 [ 19.472803] __kasan_slab_free+0x6c/0x98 [ 19.472840] kfree+0x214/0x3c8 [ 19.472874] kmalloc_uaf2+0x134/0x468 [ 19.472911] kunit_try_run_case+0x170/0x3f0 [ 19.472949] kunit_generic_run_threadfn_adapter+0x88/0x100 [ 19.473006] kthread+0x328/0x630 [ 19.473049] ret_from_fork+0x10/0x20 [ 19.473088] [ 19.473111] The buggy address belongs to the object at fff00000c7780080 [ 19.473111] which belongs to the cache kmalloc-64 of size 64 [ 19.473191] The buggy address is located 40 bytes inside of [ 19.473191] freed 64-byte region [fff00000c7780080, fff00000c77800c0) [ 19.473298] [ 19.473323] The buggy address belongs to the physical page: [ 19.473359] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x107780 [ 19.473421] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff) [ 19.473478] page_type: f5(slab) [ 19.473527] raw: 0bfffe0000000000 fff00000c00018c0 dead000000000122 0000000000000000 [ 19.473587] raw: 0000000000000000 0000000080200020 00000000f5000000 0000000000000000 [ 19.473636] page dumped because: kasan: bad access detected [ 19.473672] [ 19.473694] Memory state around the buggy address: [ 19.473754] fff00000c777ff80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc [ 19.473813] fff00000c7780000: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc [ 19.473962] >fff00000c7780080: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc [ 19.474021] ^ [ 19.474060] fff00000c7780100: 00 00 00 00 00 03 fc fc fc fc fc fc fc fc fc fc [ 19.474109] fff00000c7780180: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc [ 19.474152] ==================================================================
[ 11.427961] ================================================================== [ 11.428422] BUG: KASAN: slab-use-after-free in kmalloc_uaf2+0x4a8/0x520 [ 11.428727] Read of size 1 at addr ffff8881026b6828 by task kunit_try_catch/205 [ 11.429118] [ 11.429327] CPU: 1 UID: 0 PID: 205 Comm: kunit_try_catch Tainted: G B N 6.15.0-rc6-next-20250513 #1 PREEMPT(voluntary) [ 11.429478] Tainted: [B]=BAD_PAGE, [N]=TEST [ 11.429490] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014 [ 11.429510] Call Trace: [ 11.429522] <TASK> [ 11.429537] dump_stack_lvl+0x73/0xb0 [ 11.429565] print_report+0xd1/0x650 [ 11.429588] ? __virt_addr_valid+0x1db/0x2d0 [ 11.429691] ? kmalloc_uaf2+0x4a8/0x520 [ 11.429712] ? kasan_complete_mode_report_info+0x64/0x200 [ 11.429733] ? kmalloc_uaf2+0x4a8/0x520 [ 11.429754] kasan_report+0x141/0x180 [ 11.429777] ? kmalloc_uaf2+0x4a8/0x520 [ 11.429825] __asan_report_load1_noabort+0x18/0x20 [ 11.429846] kmalloc_uaf2+0x4a8/0x520 [ 11.429866] ? __pfx_kmalloc_uaf2+0x10/0x10 [ 11.429886] ? finish_task_switch.isra.0+0x153/0x700 [ 11.429907] ? __switch_to+0x47/0xf50 [ 11.429935] ? __schedule+0x10cc/0x2b60 [ 11.429957] ? __pfx_read_tsc+0x10/0x10 [ 11.429994] ? ktime_get_ts64+0x86/0x230 [ 11.430019] kunit_try_run_case+0x1a5/0x480 [ 11.430043] ? __pfx_kunit_try_run_case+0x10/0x10 [ 11.430064] ? _raw_spin_lock_irqsave+0xa1/0x100 [ 11.430086] ? _raw_spin_unlock_irqrestore+0x5f/0x90 [ 11.430108] ? __kthread_parkme+0x82/0x180 [ 11.430128] ? preempt_count_sub+0x50/0x80 [ 11.430151] ? __pfx_kunit_try_run_case+0x10/0x10 [ 11.430174] kunit_generic_run_threadfn_adapter+0x85/0xf0 [ 11.430208] ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10 [ 11.430231] kthread+0x337/0x6f0 [ 11.430250] ? trace_preempt_on+0x20/0xc0 [ 11.430273] ? __pfx_kthread+0x10/0x10 [ 11.430294] ? _raw_spin_unlock_irq+0x47/0x80 [ 11.430314] ? calculate_sigpending+0x7b/0xa0 [ 11.430338] ? __pfx_kthread+0x10/0x10 [ 11.430359] ret_from_fork+0x116/0x1d0 [ 11.430377] ? __pfx_kthread+0x10/0x10 [ 11.430397] ret_from_fork_asm+0x1a/0x30 [ 11.430429] </TASK> [ 11.430440] [ 11.442382] Allocated by task 205: [ 11.442739] kasan_save_stack+0x45/0x70 [ 11.443174] kasan_save_track+0x18/0x40 [ 11.443460] kasan_save_alloc_info+0x3b/0x50 [ 11.443682] __kasan_kmalloc+0xb7/0xc0 [ 11.444074] __kmalloc_cache_noprof+0x189/0x420 [ 11.444554] kmalloc_uaf2+0xc6/0x520 [ 11.444839] kunit_try_run_case+0x1a5/0x480 [ 11.444987] kunit_generic_run_threadfn_adapter+0x85/0xf0 [ 11.445154] kthread+0x337/0x6f0 [ 11.445463] ret_from_fork+0x116/0x1d0 [ 11.445893] ret_from_fork_asm+0x1a/0x30 [ 11.446287] [ 11.446447] Freed by task 205: [ 11.446763] kasan_save_stack+0x45/0x70 [ 11.447192] kasan_save_track+0x18/0x40 [ 11.447646] kasan_save_free_info+0x3f/0x60 [ 11.447914] __kasan_slab_free+0x56/0x70 [ 11.448054] kfree+0x222/0x3f0 [ 11.448167] kmalloc_uaf2+0x14c/0x520 [ 11.448505] kunit_try_run_case+0x1a5/0x480 [ 11.448951] kunit_generic_run_threadfn_adapter+0x85/0xf0 [ 11.449468] kthread+0x337/0x6f0 [ 11.449845] ret_from_fork+0x116/0x1d0 [ 11.450265] ret_from_fork_asm+0x1a/0x30 [ 11.450440] [ 11.450518] The buggy address belongs to the object at ffff8881026b6800 [ 11.450518] which belongs to the cache kmalloc-64 of size 64 [ 11.451696] The buggy address is located 40 bytes inside of [ 11.451696] freed 64-byte region [ffff8881026b6800, ffff8881026b6840) [ 11.452133] [ 11.452252] The buggy address belongs to the physical page: [ 11.452842] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1026b6 [ 11.453564] flags: 0x200000000000000(node=0|zone=2) [ 11.454050] page_type: f5(slab) [ 11.454183] raw: 0200000000000000 ffff8881000418c0 dead000000000122 0000000000000000 [ 11.454448] raw: 0000000000000000 0000000080200020 00000000f5000000 0000000000000000 [ 11.454912] page dumped because: kasan: bad access detected [ 11.455436] [ 11.455675] Memory state around the buggy address: [ 11.455939] ffff8881026b6700: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc [ 11.456155] ffff8881026b6780: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc [ 11.456789] >ffff8881026b6800: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc [ 11.457507] ^ [ 11.457986] ffff8881026b6880: 00 00 00 00 00 03 fc fc fc fc fc fc fc fc fc fc [ 11.458469] ffff8881026b6900: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc [ 11.459041] ==================================================================