Date
June 2, 2025, 2:10 p.m.
Environment | |
---|---|
qemu-arm64 | |
qemu-x86_64 |
[ 20.218453] ================================================================== [ 20.219181] BUG: KASAN: slab-use-after-free in kmalloc_uaf_memset+0x17c/0x328 [ 20.220584] Write of size 33 at addr fff00000c5cc2900 by task kunit_try_catch/173 [ 20.221715] [ 20.222311] CPU: 0 UID: 0 PID: 173 Comm: kunit_try_catch Tainted: G B N 6.12.32-rc1 #1 [ 20.222531] Tainted: [B]=BAD_PAGE, [N]=TEST [ 20.222602] Hardware name: linux,dummy-virt (DT) [ 20.222673] Call trace: [ 20.222718] dump_backtrace+0x9c/0x128 [ 20.222830] show_stack+0x20/0x38 [ 20.222874] dump_stack_lvl+0x8c/0xd0 [ 20.222924] print_report+0x118/0x5f0 [ 20.222968] kasan_report+0xdc/0x128 [ 20.223010] kasan_check_range+0x100/0x1a8 [ 20.223060] __asan_memset+0x34/0x78 [ 20.223139] kmalloc_uaf_memset+0x17c/0x328 [ 20.223222] kunit_try_run_case+0x170/0x3f0 [ 20.223452] kunit_generic_run_threadfn_adapter+0x88/0x100 [ 20.223562] kthread+0x24c/0x2d0 [ 20.223640] ret_from_fork+0x10/0x20 [ 20.223733] [ 20.229494] Allocated by task 173: [ 20.229733] kasan_save_stack+0x3c/0x68 [ 20.229993] kasan_save_track+0x20/0x40 [ 20.230216] kasan_save_alloc_info+0x40/0x58 [ 20.230506] __kasan_kmalloc+0xd4/0xd8 [ 20.230749] __kmalloc_cache_noprof+0x154/0x320 [ 20.231577] kmalloc_uaf_memset+0xb8/0x328 [ 20.232562] kunit_try_run_case+0x170/0x3f0 [ 20.233016] kunit_generic_run_threadfn_adapter+0x88/0x100 [ 20.233691] kthread+0x24c/0x2d0 [ 20.234129] ret_from_fork+0x10/0x20 [ 20.234553] [ 20.234801] Freed by task 173: [ 20.235194] kasan_save_stack+0x3c/0x68 [ 20.235598] kasan_save_track+0x20/0x40 [ 20.235982] kasan_save_free_info+0x4c/0x78 [ 20.236348] __kasan_slab_free+0x6c/0x98 [ 20.236684] kfree+0x110/0x3b8 [ 20.236974] kmalloc_uaf_memset+0x120/0x328 [ 20.237704] kunit_try_run_case+0x170/0x3f0 [ 20.238161] kunit_generic_run_threadfn_adapter+0x88/0x100 [ 20.238677] kthread+0x24c/0x2d0 [ 20.239008] ret_from_fork+0x10/0x20 [ 20.239333] [ 20.240051] The buggy address belongs to the object at fff00000c5cc2900 [ 20.240051] which belongs to the cache kmalloc-64 of size 64 [ 20.240836] The buggy address is located 0 bytes inside of [ 20.240836] freed 64-byte region [fff00000c5cc2900, fff00000c5cc2940) [ 20.241847] [ 20.242187] The buggy address belongs to the physical page: [ 20.242742] page: refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x105cc2 [ 20.243773] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff) [ 20.244422] page_type: f5(slab) [ 20.244826] raw: 0bfffe0000000000 fff00000c00018c0 dead000000000122 0000000000000000 [ 20.245485] raw: 0000000000000000 0000000080200020 00000001f5000000 0000000000000000 [ 20.246203] page dumped because: kasan: bad access detected [ 20.246727] [ 20.246978] Memory state around the buggy address: [ 20.247558] fff00000c5cc2800: 00 00 00 00 00 00 00 00 fc fc fc fc fc fc fc fc [ 20.248381] fff00000c5cc2880: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc [ 20.248979] >fff00000c5cc2900: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc [ 20.249602] ^ [ 20.249982] fff00000c5cc2980: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc [ 20.250585] fff00000c5cc2a00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc [ 20.251213] ==================================================================
[ 12.356955] ================================================================== [ 12.357477] BUG: KASAN: slab-use-after-free in kmalloc_uaf_memset+0x1a4/0x360 [ 12.357707] Write of size 33 at addr ffff88810261a700 by task kunit_try_catch/191 [ 12.358169] [ 12.358289] CPU: 0 UID: 0 PID: 191 Comm: kunit_try_catch Tainted: G B N 6.12.32-rc1 #1 [ 12.358366] Tainted: [B]=BAD_PAGE, [N]=TEST [ 12.358388] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014 [ 12.358425] Call Trace: [ 12.358450] <TASK> [ 12.358479] dump_stack_lvl+0x73/0xb0 [ 12.358531] print_report+0xd1/0x640 [ 12.358568] ? __virt_addr_valid+0x1db/0x2d0 [ 12.358609] ? kmalloc_uaf_memset+0x1a4/0x360 [ 12.358643] ? kasan_complete_mode_report_info+0x64/0x200 [ 12.358723] ? kmalloc_uaf_memset+0x1a4/0x360 [ 12.358767] kasan_report+0x140/0x180 [ 12.358813] ? kmalloc_uaf_memset+0x1a4/0x360 [ 12.358866] kasan_check_range+0x10c/0x1c0 [ 12.358908] __asan_memset+0x27/0x50 [ 12.358949] kmalloc_uaf_memset+0x1a4/0x360 [ 12.358994] ? __pfx_kmalloc_uaf_memset+0x10/0x10 [ 12.359039] ? __schedule+0xc49/0x27a0 [ 12.359115] ? __pfx_read_tsc+0x10/0x10 [ 12.359145] ? ktime_get_ts64+0x84/0x230 [ 12.359190] kunit_try_run_case+0x1a6/0x480 [ 12.359226] ? __pfx_kunit_try_run_case+0x10/0x10 [ 12.359256] ? _raw_spin_lock_irqsave+0xa2/0x110 [ 12.359291] ? _raw_spin_unlock_irqrestore+0x5f/0x90 [ 12.359334] ? __kthread_parkme+0x82/0x160 [ 12.359363] ? preempt_count_sub+0x50/0x80 [ 12.359398] ? __pfx_kunit_try_run_case+0x10/0x10 [ 12.359429] ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10 [ 12.359470] kunit_generic_run_threadfn_adapter+0x85/0xf0 [ 12.359508] kthread+0x257/0x310 [ 12.359540] ? __pfx_kthread+0x10/0x10 [ 12.359574] ret_from_fork+0x41/0x80 [ 12.359609] ? __pfx_kthread+0x10/0x10 [ 12.359641] ret_from_fork_asm+0x1a/0x30 [ 12.359704] </TASK> [ 12.359725] [ 12.367788] Allocated by task 191: [ 12.368169] kasan_save_stack+0x45/0x70 [ 12.368406] kasan_save_track+0x18/0x40 [ 12.368577] kasan_save_alloc_info+0x3b/0x50 [ 12.368758] __kasan_kmalloc+0xb7/0xc0 [ 12.368920] __kmalloc_cache_noprof+0x168/0x350 [ 12.369104] kmalloc_uaf_memset+0xaa/0x360 [ 12.369389] kunit_try_run_case+0x1a6/0x480 [ 12.369714] kunit_generic_run_threadfn_adapter+0x85/0xf0 [ 12.370108] kthread+0x257/0x310 [ 12.370420] ret_from_fork+0x41/0x80 [ 12.371220] ret_from_fork_asm+0x1a/0x30 [ 12.371478] [ 12.371620] Freed by task 191: [ 12.371850] kasan_save_stack+0x45/0x70 [ 12.372023] kasan_save_track+0x18/0x40 [ 12.372320] kasan_save_free_info+0x3f/0x60 [ 12.372511] __kasan_slab_free+0x56/0x70 [ 12.372797] kfree+0x123/0x3d0 [ 12.372974] kmalloc_uaf_memset+0x12c/0x360 [ 12.373385] kunit_try_run_case+0x1a6/0x480 [ 12.373597] kunit_generic_run_threadfn_adapter+0x85/0xf0 [ 12.373947] kthread+0x257/0x310 [ 12.374278] ret_from_fork+0x41/0x80 [ 12.374523] ret_from_fork_asm+0x1a/0x30 [ 12.374850] [ 12.374991] The buggy address belongs to the object at ffff88810261a700 [ 12.374991] which belongs to the cache kmalloc-64 of size 64 [ 12.375455] The buggy address is located 0 bytes inside of [ 12.375455] freed 64-byte region [ffff88810261a700, ffff88810261a740) [ 12.376096] [ 12.376238] The buggy address belongs to the physical page: [ 12.376481] page: refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x10261a [ 12.377317] flags: 0x200000000000000(node=0|zone=2) [ 12.377692] page_type: f5(slab) [ 12.377963] raw: 0200000000000000 ffff8881000418c0 dead000000000122 0000000000000000 [ 12.378400] raw: 0000000000000000 0000000080200020 00000001f5000000 0000000000000000 [ 12.378646] page dumped because: kasan: bad access detected [ 12.379019] [ 12.379272] Memory state around the buggy address: [ 12.379603] ffff88810261a600: 00 00 00 00 00 fc fc fc fc fc fc fc fc fc fc fc [ 12.380073] ffff88810261a680: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc [ 12.380527] >ffff88810261a700: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc [ 12.380885] ^ [ 12.381042] ffff88810261a780: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc [ 12.381828] ffff88810261a800: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc [ 12.382164] ==================================================================