Date
June 20, 2025, 12:38 p.m.
Environment | |
---|---|
qemu-arm64 | |
qemu-x86_64 |
[ 32.262396] ================================================================== [ 32.262601] BUG: KASAN: slab-use-after-free in kmalloc_uaf_memset+0x170/0x310 [ 32.263201] Write of size 33 at addr fff00000c596cc00 by task kunit_try_catch/197 [ 32.263446] [ 32.263605] CPU: 1 UID: 0 PID: 197 Comm: kunit_try_catch Tainted: G B N 6.16.0-rc2-next-20250620 #1 PREEMPT [ 32.264202] Tainted: [B]=BAD_PAGE, [N]=TEST [ 32.264384] Hardware name: linux,dummy-virt (DT) [ 32.264725] Call trace: [ 32.264806] show_stack+0x20/0x38 (C) [ 32.264967] dump_stack_lvl+0x8c/0xd0 [ 32.265155] print_report+0x118/0x608 [ 32.265364] kasan_report+0xdc/0x128 [ 32.265700] kasan_check_range+0x100/0x1a8 [ 32.266001] __asan_memset+0x34/0x78 [ 32.266115] kmalloc_uaf_memset+0x170/0x310 [ 32.266253] kunit_try_run_case+0x170/0x3f0 [ 32.266395] kunit_generic_run_threadfn_adapter+0x88/0x100 [ 32.266592] kthread+0x328/0x630 [ 32.266774] ret_from_fork+0x10/0x20 [ 32.266957] [ 32.267030] Allocated by task 197: [ 32.267136] kasan_save_stack+0x3c/0x68 [ 32.267287] kasan_save_track+0x20/0x40 [ 32.267398] kasan_save_alloc_info+0x40/0x58 [ 32.267522] __kasan_kmalloc+0xd4/0xd8 [ 32.267903] __kmalloc_cache_noprof+0x16c/0x3c0 [ 32.268020] kmalloc_uaf_memset+0xb8/0x310 [ 32.268403] kunit_try_run_case+0x170/0x3f0 [ 32.268460] kunit_generic_run_threadfn_adapter+0x88/0x100 [ 32.268536] kthread+0x328/0x630 [ 32.268591] ret_from_fork+0x10/0x20 [ 32.268781] [ 32.268837] Freed by task 197: [ 32.268914] kasan_save_stack+0x3c/0x68 [ 32.269029] kasan_save_track+0x20/0x40 [ 32.269125] kasan_save_free_info+0x4c/0x78 [ 32.269204] __kasan_slab_free+0x6c/0x98 [ 32.269269] kfree+0x214/0x3c8 [ 32.269326] kmalloc_uaf_memset+0x11c/0x310 [ 32.269442] kunit_try_run_case+0x170/0x3f0 [ 32.269540] kunit_generic_run_threadfn_adapter+0x88/0x100 [ 32.269664] kthread+0x328/0x630 [ 32.269756] ret_from_fork+0x10/0x20 [ 32.269842] [ 32.269897] The buggy address belongs to the object at fff00000c596cc00 [ 32.269897] which belongs to the cache kmalloc-64 of size 64 [ 32.270058] The buggy address is located 0 bytes inside of [ 32.270058] freed 64-byte region [fff00000c596cc00, fff00000c596cc40) [ 32.270226] [ 32.270282] The buggy address belongs to the physical page: [ 32.270358] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x10596c [ 32.270510] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff) [ 32.271324] page_type: f5(slab) [ 32.271457] raw: 0bfffe0000000000 fff00000c00018c0 dead000000000122 0000000000000000 [ 32.271595] raw: 0000000000000000 0000000080200020 00000000f5000000 0000000000000000 [ 32.272088] page dumped because: kasan: bad access detected [ 32.272189] [ 32.272754] Memory state around the buggy address: [ 32.272862] fff00000c596cb00: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc [ 32.273109] fff00000c596cb80: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc [ 32.273471] >fff00000c596cc00: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc [ 32.273681] ^ [ 32.273824] fff00000c596cc80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc [ 32.273937] fff00000c596cd00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc [ 32.274541] ==================================================================
[ 25.908347] ================================================================== [ 25.908979] BUG: KASAN: slab-use-after-free in kmalloc_uaf_memset+0x1a3/0x360 [ 25.909450] Write of size 33 at addr ffff888102b16e00 by task kunit_try_catch/215 [ 25.910062] [ 25.910567] CPU: 1 UID: 0 PID: 215 Comm: kunit_try_catch Tainted: G B N 6.16.0-rc2-next-20250620 #1 PREEMPT(voluntary) [ 25.910685] Tainted: [B]=BAD_PAGE, [N]=TEST [ 25.910713] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014 [ 25.910866] Call Trace: [ 25.910901] <TASK> [ 25.910942] dump_stack_lvl+0x73/0xb0 [ 25.911099] print_report+0xd1/0x650 [ 25.911164] ? __virt_addr_valid+0x1db/0x2d0 [ 25.911234] ? kmalloc_uaf_memset+0x1a3/0x360 [ 25.911271] ? kasan_complete_mode_report_info+0x64/0x200 [ 25.911342] ? kmalloc_uaf_memset+0x1a3/0x360 [ 25.911404] kasan_report+0x141/0x180 [ 25.911462] ? kmalloc_uaf_memset+0x1a3/0x360 [ 25.911511] kasan_check_range+0x10c/0x1c0 [ 25.911541] __asan_memset+0x27/0x50 [ 25.911562] kmalloc_uaf_memset+0x1a3/0x360 [ 25.911583] ? __pfx_kmalloc_uaf_memset+0x10/0x10 [ 25.911606] ? __schedule+0x10cc/0x2b60 [ 25.911631] ? __pfx_read_tsc+0x10/0x10 [ 25.911654] ? ktime_get_ts64+0x86/0x230 [ 25.911684] kunit_try_run_case+0x1a5/0x480 [ 25.911722] ? __pfx_kunit_try_run_case+0x10/0x10 [ 25.911794] ? _raw_spin_lock_irqsave+0xa1/0x100 [ 25.911838] ? _raw_spin_unlock_irqrestore+0x5f/0x90 [ 25.911875] ? __kthread_parkme+0x82/0x180 [ 25.911900] ? preempt_count_sub+0x50/0x80 [ 25.911928] ? __pfx_kunit_try_run_case+0x10/0x10 [ 25.911955] kunit_generic_run_threadfn_adapter+0x85/0xf0 [ 25.911979] ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10 [ 25.912002] kthread+0x337/0x6f0 [ 25.912023] ? trace_preempt_on+0x20/0xc0 [ 25.912049] ? __pfx_kthread+0x10/0x10 [ 25.912071] ? _raw_spin_unlock_irq+0x47/0x80 [ 25.912092] ? calculate_sigpending+0x7b/0xa0 [ 25.912118] ? __pfx_kthread+0x10/0x10 [ 25.912140] ret_from_fork+0x116/0x1d0 [ 25.912187] ? __pfx_kthread+0x10/0x10 [ 25.912212] ret_from_fork_asm+0x1a/0x30 [ 25.912248] </TASK> [ 25.912262] [ 25.925230] Allocated by task 215: [ 25.925613] kasan_save_stack+0x45/0x70 [ 25.925989] kasan_save_track+0x18/0x40 [ 25.926325] kasan_save_alloc_info+0x3b/0x50 [ 25.927469] __kasan_kmalloc+0xb7/0xc0 [ 25.928004] __kmalloc_cache_noprof+0x189/0x420 [ 25.928423] kmalloc_uaf_memset+0xa9/0x360 [ 25.928934] kunit_try_run_case+0x1a5/0x480 [ 25.929167] kunit_generic_run_threadfn_adapter+0x85/0xf0 [ 25.929589] kthread+0x337/0x6f0 [ 25.930192] ret_from_fork+0x116/0x1d0 [ 25.931111] ret_from_fork_asm+0x1a/0x30 [ 25.931593] [ 25.931706] Freed by task 215: [ 25.931868] kasan_save_stack+0x45/0x70 [ 25.932185] kasan_save_track+0x18/0x40 [ 25.932521] kasan_save_free_info+0x3f/0x60 [ 25.932768] __kasan_slab_free+0x56/0x70 [ 25.932964] kfree+0x222/0x3f0 [ 25.933996] kmalloc_uaf_memset+0x12b/0x360 [ 25.934305] kunit_try_run_case+0x1a5/0x480 [ 25.934487] kunit_generic_run_threadfn_adapter+0x85/0xf0 [ 25.935405] kthread+0x337/0x6f0 [ 25.936059] ret_from_fork+0x116/0x1d0 [ 25.936532] ret_from_fork_asm+0x1a/0x30 [ 25.936883] [ 25.937052] The buggy address belongs to the object at ffff888102b16e00 [ 25.937052] which belongs to the cache kmalloc-64 of size 64 [ 25.937922] The buggy address is located 0 bytes inside of [ 25.937922] freed 64-byte region [ffff888102b16e00, ffff888102b16e40) [ 25.938945] [ 25.939345] The buggy address belongs to the physical page: [ 25.939863] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x102b16 [ 25.940189] flags: 0x200000000000000(node=0|zone=2) [ 25.940644] page_type: f5(slab) [ 25.941604] raw: 0200000000000000 ffff8881000418c0 dead000000000122 0000000000000000 [ 25.942021] raw: 0000000000000000 0000000080200020 00000000f5000000 0000000000000000 [ 25.942785] page dumped because: kasan: bad access detected [ 25.943118] [ 25.943272] Memory state around the buggy address: [ 25.943733] ffff888102b16d00: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc [ 25.944562] ffff888102b16d80: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc [ 25.944995] >ffff888102b16e00: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc [ 25.945267] ^ [ 25.945431] ffff888102b16e80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc [ 25.945687] ffff888102b16f00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc [ 25.946169] ==================================================================