Date
June 7, 2025, 10:40 a.m.
Environment | |
---|---|
qemu-arm64 | |
qemu-x86_64 |
[ 21.693884] ================================================================== [ 21.695008] BUG: KASAN: slab-use-after-free in kmalloc_uaf2+0x408/0x478 [ 21.695915] Read of size 1 at addr fff00000c41e2aa8 by task kunit_try_catch/176 [ 21.697623] [ 21.698094] CPU: 0 UID: 0 PID: 176 Comm: kunit_try_catch Tainted: G B N 6.12.33-rc1 #1 [ 21.698393] Tainted: [B]=BAD_PAGE, [N]=TEST [ 21.698433] Hardware name: linux,dummy-virt (DT) [ 21.698474] Call trace: [ 21.698504] dump_backtrace+0x9c/0x128 [ 21.698560] show_stack+0x20/0x38 [ 21.698603] dump_stack_lvl+0x8c/0xd0 [ 21.698649] print_report+0x118/0x5f0 [ 21.698695] kasan_report+0xdc/0x128 [ 21.698739] __asan_report_load1_noabort+0x20/0x30 [ 21.698790] kmalloc_uaf2+0x408/0x478 [ 21.698835] kunit_try_run_case+0x170/0x3f0 [ 21.698883] kunit_generic_run_threadfn_adapter+0x88/0x100 [ 21.698937] kthread+0x24c/0x2d0 [ 21.699014] ret_from_fork+0x10/0x20 [ 21.699065] [ 21.707264] Allocated by task 176: [ 21.707748] kasan_save_stack+0x3c/0x68 [ 21.708786] kasan_save_track+0x20/0x40 [ 21.709440] kasan_save_alloc_info+0x40/0x58 [ 21.709844] __kasan_kmalloc+0xd4/0xd8 [ 21.710220] __kmalloc_cache_noprof+0x154/0x320 [ 21.710638] kmalloc_uaf2+0xc4/0x478 [ 21.711478] kunit_try_run_case+0x170/0x3f0 [ 21.712383] kunit_generic_run_threadfn_adapter+0x88/0x100 [ 21.713404] kthread+0x24c/0x2d0 [ 21.713767] ret_from_fork+0x10/0x20 [ 21.714281] [ 21.714547] Freed by task 176: [ 21.715912] kasan_save_stack+0x3c/0x68 [ 21.716459] kasan_save_track+0x20/0x40 [ 21.717244] kasan_save_free_info+0x4c/0x78 [ 21.718125] __kasan_slab_free+0x6c/0x98 [ 21.718875] kfree+0x110/0x3b8 [ 21.720881] kmalloc_uaf2+0x138/0x478 [ 21.721603] kunit_try_run_case+0x170/0x3f0 [ 21.722331] kunit_generic_run_threadfn_adapter+0x88/0x100 [ 21.722804] kthread+0x24c/0x2d0 [ 21.723550] ret_from_fork+0x10/0x20 [ 21.724600] [ 21.724924] The buggy address belongs to the object at fff00000c41e2a80 [ 21.724924] which belongs to the cache kmalloc-64 of size 64 [ 21.726317] The buggy address is located 40 bytes inside of [ 21.726317] freed 64-byte region [fff00000c41e2a80, fff00000c41e2ac0) [ 21.728558] [ 21.729309] The buggy address belongs to the physical page: [ 21.729832] page: refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1041e2 [ 21.730527] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff) [ 21.732011] page_type: f5(slab) [ 21.732479] raw: 0bfffe0000000000 fff00000c00018c0 dead000000000122 0000000000000000 [ 21.733913] raw: 0000000000000000 0000000080200020 00000001f5000000 0000000000000000 [ 21.735712] page dumped because: kasan: bad access detected [ 21.736420] [ 21.737115] Memory state around the buggy address: [ 21.737912] fff00000c41e2980: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc [ 21.738759] fff00000c41e2a00: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc [ 21.739433] >fff00000c41e2a80: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc [ 21.740539] ^ [ 21.741033] fff00000c41e2b00: 00 00 00 00 00 03 fc fc fc fc fc fc fc fc fc fc [ 21.741879] fff00000c41e2b80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc [ 21.742686] ==================================================================
[ 18.104939] ================================================================== [ 18.105834] BUG: KASAN: slab-use-after-free in kmalloc_uaf2+0x4aa/0x520 [ 18.106368] Read of size 1 at addr ffff888102920b28 by task kunit_try_catch/193 [ 18.107750] [ 18.108054] CPU: 0 UID: 0 PID: 193 Comm: kunit_try_catch Tainted: G B N 6.12.33-rc1 #1 [ 18.108235] Tainted: [B]=BAD_PAGE, [N]=TEST [ 18.108276] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014 [ 18.108334] Call Trace: [ 18.108371] <TASK> [ 18.108415] dump_stack_lvl+0x73/0xb0 [ 18.108779] print_report+0xd1/0x640 [ 18.108892] ? __virt_addr_valid+0x1db/0x2d0 [ 18.108970] ? kmalloc_uaf2+0x4aa/0x520 [ 18.109037] ? kasan_complete_mode_report_info+0x64/0x200 [ 18.109106] ? kmalloc_uaf2+0x4aa/0x520 [ 18.109178] kasan_report+0x140/0x180 [ 18.109304] ? kmalloc_uaf2+0x4aa/0x520 [ 18.109394] __asan_report_load1_noabort+0x18/0x20 [ 18.109582] kmalloc_uaf2+0x4aa/0x520 [ 18.109621] ? __pfx_kmalloc_uaf2+0x10/0x10 [ 18.109653] ? irqentry_exit+0x2a/0x60 [ 18.109682] ? sysvec_apic_timer_interrupt+0x50/0x90 [ 18.109719] ? __pfx_read_tsc+0x10/0x10 [ 18.109747] ? ktime_get_ts64+0x84/0x230 [ 18.109783] kunit_try_run_case+0x1a6/0x480 [ 18.109848] ? __pfx_kunit_try_run_case+0x10/0x10 [ 18.109883] ? _raw_spin_lock_irqsave+0xa2/0x110 [ 18.109913] ? _raw_spin_unlock_irqrestore+0x5f/0x90 [ 18.109949] ? __kthread_parkme+0x82/0x160 [ 18.109976] ? preempt_count_sub+0x50/0x80 [ 18.110007] ? __pfx_kunit_try_run_case+0x10/0x10 [ 18.110035] ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10 [ 18.110072] kunit_generic_run_threadfn_adapter+0x85/0xf0 [ 18.110108] kthread+0x257/0x310 [ 18.110134] ? __pfx_kthread+0x10/0x10 [ 18.110160] ret_from_fork+0x41/0x80 [ 18.110189] ? __pfx_kthread+0x10/0x10 [ 18.110234] ret_from_fork_asm+0x1a/0x30 [ 18.110284] </TASK> [ 18.110297] [ 18.132193] Allocated by task 193: [ 18.133255] kasan_save_stack+0x45/0x70 [ 18.133627] kasan_save_track+0x18/0x40 [ 18.134115] kasan_save_alloc_info+0x3b/0x50 [ 18.134782] __kasan_kmalloc+0xb7/0xc0 [ 18.135696] __kmalloc_cache_noprof+0x168/0x350 [ 18.136186] kmalloc_uaf2+0xc7/0x520 [ 18.137271] kunit_try_run_case+0x1a6/0x480 [ 18.137647] kunit_generic_run_threadfn_adapter+0x85/0xf0 [ 18.138589] kthread+0x257/0x310 [ 18.138913] ret_from_fork+0x41/0x80 [ 18.139625] ret_from_fork_asm+0x1a/0x30 [ 18.140267] [ 18.140988] Freed by task 193: [ 18.141270] kasan_save_stack+0x45/0x70 [ 18.141728] kasan_save_track+0x18/0x40 [ 18.142795] kasan_save_free_info+0x3f/0x60 [ 18.143151] __kasan_slab_free+0x56/0x70 [ 18.144285] kfree+0x123/0x3d0 [ 18.144705] kmalloc_uaf2+0x14d/0x520 [ 18.145284] kunit_try_run_case+0x1a6/0x480 [ 18.145973] kunit_generic_run_threadfn_adapter+0x85/0xf0 [ 18.146951] kthread+0x257/0x310 [ 18.147206] ret_from_fork+0x41/0x80 [ 18.147661] ret_from_fork_asm+0x1a/0x30 [ 18.148905] [ 18.149062] The buggy address belongs to the object at ffff888102920b00 [ 18.149062] which belongs to the cache kmalloc-64 of size 64 [ 18.149940] The buggy address is located 40 bytes inside of [ 18.149940] freed 64-byte region [ffff888102920b00, ffff888102920b40) [ 18.150818] [ 18.151050] The buggy address belongs to the physical page: [ 18.151555] page: refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x102920 [ 18.153248] flags: 0x200000000000000(node=0|zone=2) [ 18.153720] page_type: f5(slab) [ 18.154102] raw: 0200000000000000 ffff8881000418c0 dead000000000122 0000000000000000 [ 18.154715] raw: 0000000000000000 0000000080200020 00000001f5000000 0000000000000000 [ 18.155597] page dumped because: kasan: bad access detected [ 18.156121] [ 18.156343] Memory state around the buggy address: [ 18.157051] ffff888102920a00: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc [ 18.158143] ffff888102920a80: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc [ 18.159082] >ffff888102920b00: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc [ 18.160209] ^ [ 18.160904] ffff888102920b80: 00 00 00 00 00 03 fc fc fc fc fc fc fc fc fc fc [ 18.161437] ffff888102920c00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc [ 18.162419] ==================================================================