Date
July 19, 2025, 11:11 a.m.
Environment | |
---|---|
qemu-arm64 | |
qemu-x86_64 |
[ 15.455257] ================================================================== [ 15.455320] BUG: KASAN: slab-use-after-free in kmalloc_uaf2+0x3f4/0x468 [ 15.455375] Read of size 1 at addr fff00000c63a85a8 by task kunit_try_catch/189 [ 15.456198] [ 15.456513] CPU: 1 UID: 0 PID: 189 Comm: kunit_try_catch Tainted: G B N 6.16.0-rc6 #1 PREEMPT [ 15.456697] Tainted: [B]=BAD_PAGE, [N]=TEST [ 15.456736] Hardware name: linux,dummy-virt (DT) [ 15.456769] Call trace: [ 15.456873] show_stack+0x20/0x38 (C) [ 15.456950] dump_stack_lvl+0x8c/0xd0 [ 15.456996] print_report+0x118/0x5d0 [ 15.457043] kasan_report+0xdc/0x128 [ 15.457099] __asan_report_load1_noabort+0x20/0x30 [ 15.457211] kmalloc_uaf2+0x3f4/0x468 [ 15.457486] kunit_try_run_case+0x170/0x3f0 [ 15.457566] kunit_generic_run_threadfn_adapter+0x88/0x100 [ 15.458101] kthread+0x328/0x630 [ 15.458265] ret_from_fork+0x10/0x20 [ 15.458321] [ 15.458340] Allocated by task 189: [ 15.458369] kasan_save_stack+0x3c/0x68 [ 15.458415] kasan_save_track+0x20/0x40 [ 15.458453] kasan_save_alloc_info+0x40/0x58 [ 15.459033] __kasan_kmalloc+0xd4/0xd8 [ 15.459084] __kmalloc_cache_noprof+0x16c/0x3c0 [ 15.459313] kmalloc_uaf2+0xc4/0x468 [ 15.459349] kunit_try_run_case+0x170/0x3f0 [ 15.459803] kunit_generic_run_threadfn_adapter+0x88/0x100 [ 15.459870] kthread+0x328/0x630 [ 15.459902] ret_from_fork+0x10/0x20 [ 15.459949] [ 15.459968] Freed by task 189: [ 15.459996] kasan_save_stack+0x3c/0x68 [ 15.460034] kasan_save_track+0x20/0x40 [ 15.460069] kasan_save_free_info+0x4c/0x78 [ 15.460109] __kasan_slab_free+0x6c/0x98 [ 15.460387] kfree+0x214/0x3c8 [ 15.460430] kmalloc_uaf2+0x134/0x468 [ 15.460496] kunit_try_run_case+0x170/0x3f0 [ 15.460546] kunit_generic_run_threadfn_adapter+0x88/0x100 [ 15.460717] kthread+0x328/0x630 [ 15.460961] ret_from_fork+0x10/0x20 [ 15.461054] [ 15.461076] The buggy address belongs to the object at fff00000c63a8580 [ 15.461076] which belongs to the cache kmalloc-64 of size 64 [ 15.461136] The buggy address is located 40 bytes inside of [ 15.461136] freed 64-byte region [fff00000c63a8580, fff00000c63a85c0) [ 15.461460] [ 15.461481] The buggy address belongs to the physical page: [ 15.461513] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1063a8 [ 15.462962] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff) [ 15.463020] page_type: f5(slab) [ 15.463062] raw: 0bfffe0000000000 fff00000c00018c0 dead000000000122 0000000000000000 [ 15.463113] raw: 0000000000000000 0000000080200020 00000000f5000000 0000000000000000 [ 15.463518] page dumped because: kasan: bad access detected [ 15.463573] [ 15.464936] Memory state around the buggy address: [ 15.464971] fff00000c63a8480: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc [ 15.465498] fff00000c63a8500: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc [ 15.465569] >fff00000c63a8580: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc [ 15.465660] ^ [ 15.465925] fff00000c63a8600: 00 00 00 00 00 03 fc fc fc fc fc fc fc fc fc fc [ 15.465998] fff00000c63a8680: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc [ 15.466037] ==================================================================
[ 12.383513] ================================================================== [ 12.383976] BUG: KASAN: slab-use-after-free in kmalloc_uaf2+0x4a8/0x520 [ 12.384300] Read of size 1 at addr ffff8881027ea3a8 by task kunit_try_catch/206 [ 12.384780] [ 12.384902] CPU: 0 UID: 0 PID: 206 Comm: kunit_try_catch Tainted: G B N 6.16.0-rc6 #1 PREEMPT(voluntary) [ 12.384949] Tainted: [B]=BAD_PAGE, [N]=TEST [ 12.384960] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014 [ 12.384981] Call Trace: [ 12.385008] <TASK> [ 12.385025] dump_stack_lvl+0x73/0xb0 [ 12.385055] print_report+0xd1/0x610 [ 12.385077] ? __virt_addr_valid+0x1db/0x2d0 [ 12.385100] ? kmalloc_uaf2+0x4a8/0x520 [ 12.385170] ? kasan_complete_mode_report_info+0x64/0x200 [ 12.385193] ? kmalloc_uaf2+0x4a8/0x520 [ 12.385212] kasan_report+0x141/0x180 [ 12.385234] ? kmalloc_uaf2+0x4a8/0x520 [ 12.385257] __asan_report_load1_noabort+0x18/0x20 [ 12.385281] kmalloc_uaf2+0x4a8/0x520 [ 12.385300] ? __pfx_kmalloc_uaf2+0x10/0x10 [ 12.385321] ? __kasan_check_write+0x18/0x20 [ 12.385339] ? queued_spin_lock_slowpath+0x116/0xb40 [ 12.385363] ? irqentry_exit+0x2a/0x60 [ 12.385384] ? sysvec_apic_timer_interrupt+0x50/0x90 [ 12.385408] ? trace_hardirqs_on+0x37/0xe0 [ 12.385432] ? __pfx_read_tsc+0x10/0x10 [ 12.385452] ? ktime_get_ts64+0x86/0x230 [ 12.385477] kunit_try_run_case+0x1a5/0x480 [ 12.385515] ? __pfx_kunit_try_run_case+0x10/0x10 [ 12.385538] ? queued_spin_lock_slowpath+0x116/0xb40 [ 12.385561] ? __kthread_parkme+0x82/0x180 [ 12.385581] ? preempt_count_sub+0x50/0x80 [ 12.385605] ? __pfx_kunit_try_run_case+0x10/0x10 [ 12.385628] kunit_generic_run_threadfn_adapter+0x85/0xf0 [ 12.385650] ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10 [ 12.385673] kthread+0x337/0x6f0 [ 12.385691] ? trace_preempt_on+0x20/0xc0 [ 12.385712] ? __pfx_kthread+0x10/0x10 [ 12.385731] ? _raw_spin_unlock_irq+0x47/0x80 [ 12.385752] ? calculate_sigpending+0x7b/0xa0 [ 12.385776] ? __pfx_kthread+0x10/0x10 [ 12.385796] ret_from_fork+0x116/0x1d0 [ 12.385814] ? __pfx_kthread+0x10/0x10 [ 12.385833] ret_from_fork_asm+0x1a/0x30 [ 12.385863] </TASK> [ 12.385874] [ 12.393695] Allocated by task 206: [ 12.393876] kasan_save_stack+0x45/0x70 [ 12.394080] kasan_save_track+0x18/0x40 [ 12.394368] kasan_save_alloc_info+0x3b/0x50 [ 12.394606] __kasan_kmalloc+0xb7/0xc0 [ 12.394770] __kmalloc_cache_noprof+0x189/0x420 [ 12.394992] kmalloc_uaf2+0xc6/0x520 [ 12.395136] kunit_try_run_case+0x1a5/0x480 [ 12.395339] kunit_generic_run_threadfn_adapter+0x85/0xf0 [ 12.395609] kthread+0x337/0x6f0 [ 12.395783] ret_from_fork+0x116/0x1d0 [ 12.395957] ret_from_fork_asm+0x1a/0x30 [ 12.396121] [ 12.396191] Freed by task 206: [ 12.396302] kasan_save_stack+0x45/0x70 [ 12.396702] kasan_save_track+0x18/0x40 [ 12.396909] kasan_save_free_info+0x3f/0x60 [ 12.397263] __kasan_slab_free+0x56/0x70 [ 12.397460] kfree+0x222/0x3f0 [ 12.397600] kmalloc_uaf2+0x14c/0x520 [ 12.397730] kunit_try_run_case+0x1a5/0x480 [ 12.397873] kunit_generic_run_threadfn_adapter+0x85/0xf0 [ 12.398048] kthread+0x337/0x6f0 [ 12.398166] ret_from_fork+0x116/0x1d0 [ 12.398302] ret_from_fork_asm+0x1a/0x30 [ 12.398441] [ 12.398537] The buggy address belongs to the object at ffff8881027ea380 [ 12.398537] which belongs to the cache kmalloc-64 of size 64 [ 12.399430] The buggy address is located 40 bytes inside of [ 12.399430] freed 64-byte region [ffff8881027ea380, ffff8881027ea3c0) [ 12.399920] [ 12.399995] The buggy address belongs to the physical page: [ 12.400176] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1027ea [ 12.400414] flags: 0x200000000000000(node=0|zone=2) [ 12.400589] page_type: f5(slab) [ 12.401021] raw: 0200000000000000 ffff8881000418c0 dead000000000122 0000000000000000 [ 12.401720] raw: 0000000000000000 0000000080200020 00000000f5000000 0000000000000000 [ 12.402109] page dumped because: kasan: bad access detected [ 12.402646] [ 12.402740] Memory state around the buggy address: [ 12.402967] ffff8881027ea280: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc [ 12.403377] ffff8881027ea300: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc [ 12.403607] >ffff8881027ea380: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc [ 12.403823] ^ [ 12.404031] ffff8881027ea400: 00 00 00 00 00 03 fc fc fc fc fc fc fc fc fc fc [ 12.404730] ffff8881027ea480: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc [ 12.405037] ==================================================================