Date
July 8, 2025, 4:38 p.m.
Environment | |
---|---|
qemu-arm64 | |
qemu-x86_64 |
[ 17.997987] ================================================================== [ 17.998118] BUG: KASAN: slab-use-after-free in kmalloc_uaf2+0x3f4/0x468 [ 17.998203] Read of size 1 at addr fff00000c638a728 by task kunit_try_catch/190 [ 17.998255] [ 17.998353] CPU: 1 UID: 0 PID: 190 Comm: kunit_try_catch Tainted: G B N 6.15.6-rc1 #1 PREEMPT [ 17.998472] Tainted: [B]=BAD_PAGE, [N]=TEST [ 17.998546] Hardware name: linux,dummy-virt (DT) [ 17.998594] Call trace: [ 17.998634] show_stack+0x20/0x38 (C) [ 17.998687] dump_stack_lvl+0x8c/0xd0 [ 17.998743] print_report+0x118/0x608 [ 17.998991] kasan_report+0xdc/0x128 [ 17.999149] __asan_report_load1_noabort+0x20/0x30 [ 17.999214] kmalloc_uaf2+0x3f4/0x468 [ 17.999279] kunit_try_run_case+0x170/0x3f0 [ 17.999348] kunit_generic_run_threadfn_adapter+0x88/0x100 [ 17.999454] kthread+0x328/0x630 [ 17.999521] ret_from_fork+0x10/0x20 [ 17.999587] [ 17.999672] Allocated by task 190: [ 17.999709] kasan_save_stack+0x3c/0x68 [ 17.999767] kasan_save_track+0x20/0x40 [ 17.999958] kasan_save_alloc_info+0x40/0x58 [ 18.000004] __kasan_kmalloc+0xd4/0xd8 [ 18.000142] __kmalloc_cache_noprof+0x16c/0x3c0 [ 18.000185] kmalloc_uaf2+0xc4/0x468 [ 18.000230] kunit_try_run_case+0x170/0x3f0 [ 18.000360] kunit_generic_run_threadfn_adapter+0x88/0x100 [ 18.000456] kthread+0x328/0x630 [ 18.000537] ret_from_fork+0x10/0x20 [ 18.000623] [ 18.000681] Freed by task 190: [ 18.000756] kasan_save_stack+0x3c/0x68 [ 18.000880] kasan_save_track+0x20/0x40 [ 18.000963] kasan_save_free_info+0x4c/0x78 [ 18.001002] __kasan_slab_free+0x6c/0x98 [ 18.001169] kfree+0x214/0x3c8 [ 18.001441] kmalloc_uaf2+0x134/0x468 [ 18.001632] kunit_try_run_case+0x170/0x3f0 [ 18.001719] kunit_generic_run_threadfn_adapter+0x88/0x100 [ 18.001865] kthread+0x328/0x630 [ 18.001942] ret_from_fork+0x10/0x20 [ 18.002022] [ 18.002110] The buggy address belongs to the object at fff00000c638a700 [ 18.002110] which belongs to the cache kmalloc-64 of size 64 [ 18.002212] The buggy address is located 40 bytes inside of [ 18.002212] freed 64-byte region [fff00000c638a700, fff00000c638a740) [ 18.002277] [ 18.002298] The buggy address belongs to the physical page: [ 18.002561] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x10638a [ 18.002687] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff) [ 18.002756] page_type: f5(slab) [ 18.002795] raw: 0bfffe0000000000 fff00000c00018c0 dead000000000122 0000000000000000 [ 18.002914] raw: 0000000000000000 0000000080200020 00000000f5000000 0000000000000000 [ 18.002957] page dumped because: kasan: bad access detected [ 18.002988] [ 18.003021] Memory state around the buggy address: [ 18.003064] fff00000c638a600: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc [ 18.003108] fff00000c638a680: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc [ 18.003150] >fff00000c638a700: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc [ 18.003189] ^ [ 18.003222] fff00000c638a780: 00 00 00 00 00 03 fc fc fc fc fc fc fc fc fc fc [ 18.003275] fff00000c638a800: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc [ 18.003313] ==================================================================
[ 11.600464] ================================================================== [ 11.601202] BUG: KASAN: slab-use-after-free in kmalloc_uaf2+0x4a8/0x520 [ 11.601431] Read of size 1 at addr ffff8881029d6228 by task kunit_try_catch/208 [ 11.601727] [ 11.601832] CPU: 1 UID: 0 PID: 208 Comm: kunit_try_catch Tainted: G B N 6.15.6-rc1 #1 PREEMPT(voluntary) [ 11.601892] Tainted: [B]=BAD_PAGE, [N]=TEST [ 11.601904] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014 [ 11.601925] Call Trace: [ 11.601937] <TASK> [ 11.601956] dump_stack_lvl+0x73/0xb0 [ 11.601984] print_report+0xd1/0x650 [ 11.602008] ? __virt_addr_valid+0x1db/0x2d0 [ 11.602095] ? kmalloc_uaf2+0x4a8/0x520 [ 11.602116] ? kasan_complete_mode_report_info+0x64/0x200 [ 11.602139] ? kmalloc_uaf2+0x4a8/0x520 [ 11.602160] kasan_report+0x141/0x180 [ 11.602183] ? kmalloc_uaf2+0x4a8/0x520 [ 11.602209] __asan_report_load1_noabort+0x18/0x20 [ 11.602230] kmalloc_uaf2+0x4a8/0x520 [ 11.602251] ? __pfx_kmalloc_uaf2+0x10/0x10 [ 11.602271] ? finish_task_switch.isra.0+0x153/0x700 [ 11.602296] ? __switch_to+0x5d9/0xf60 [ 11.602317] ? dequeue_task_fair+0x156/0x4e0 [ 11.602341] ? __schedule+0x10cc/0x2b60 [ 11.602365] ? __pfx_read_tsc+0x10/0x10 [ 11.602386] ? ktime_get_ts64+0x86/0x230 [ 11.602411] kunit_try_run_case+0x1a5/0x480 [ 11.602433] ? __pfx_kunit_try_run_case+0x10/0x10 [ 11.602451] ? _raw_spin_lock_irqsave+0xa1/0x100 [ 11.602476] ? _raw_spin_unlock_irqrestore+0x5f/0x90 [ 11.602500] ? __kthread_parkme+0x82/0x180 [ 11.602538] ? preempt_count_sub+0x50/0x80 [ 11.602563] ? __pfx_kunit_try_run_case+0x10/0x10 [ 11.602583] kunit_generic_run_threadfn_adapter+0x85/0xf0 [ 11.602606] ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10 [ 11.602629] kthread+0x337/0x6f0 [ 11.602646] ? trace_preempt_on+0x20/0xc0 [ 11.602670] ? __pfx_kthread+0x10/0x10 [ 11.602688] ? _raw_spin_unlock_irq+0x47/0x80 [ 11.602710] ? calculate_sigpending+0x7b/0xa0 [ 11.602732] ? __pfx_kthread+0x10/0x10 [ 11.602750] ret_from_fork+0x41/0x80 [ 11.602771] ? __pfx_kthread+0x10/0x10 [ 11.602789] ret_from_fork_asm+0x1a/0x30 [ 11.602819] </TASK> [ 11.602830] [ 11.613182] Allocated by task 208: [ 11.613353] kasan_save_stack+0x45/0x70 [ 11.613757] kasan_save_track+0x18/0x40 [ 11.614224] kasan_save_alloc_info+0x3b/0x50 [ 11.614557] __kasan_kmalloc+0xb7/0xc0 [ 11.614769] __kmalloc_cache_noprof+0x189/0x420 [ 11.615133] kmalloc_uaf2+0xc6/0x520 [ 11.615428] kunit_try_run_case+0x1a5/0x480 [ 11.615739] kunit_generic_run_threadfn_adapter+0x85/0xf0 [ 11.616121] kthread+0x337/0x6f0 [ 11.616282] ret_from_fork+0x41/0x80 [ 11.616453] ret_from_fork_asm+0x1a/0x30 [ 11.616965] [ 11.617205] Freed by task 208: [ 11.617489] kasan_save_stack+0x45/0x70 [ 11.617809] kasan_save_track+0x18/0x40 [ 11.618116] kasan_save_free_info+0x3f/0x60 [ 11.618312] __kasan_slab_free+0x56/0x70 [ 11.618496] kfree+0x222/0x3f0 [ 11.618969] kmalloc_uaf2+0x14c/0x520 [ 11.619238] kunit_try_run_case+0x1a5/0x480 [ 11.619439] kunit_generic_run_threadfn_adapter+0x85/0xf0 [ 11.619962] kthread+0x337/0x6f0 [ 11.620366] ret_from_fork+0x41/0x80 [ 11.620651] ret_from_fork_asm+0x1a/0x30 [ 11.621016] [ 11.621118] The buggy address belongs to the object at ffff8881029d6200 [ 11.621118] which belongs to the cache kmalloc-64 of size 64 [ 11.621893] The buggy address is located 40 bytes inside of [ 11.621893] freed 64-byte region [ffff8881029d6200, ffff8881029d6240) [ 11.622795] [ 11.622909] The buggy address belongs to the physical page: [ 11.623506] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1029d6 [ 11.624181] flags: 0x200000000000000(node=0|zone=2) [ 11.624667] page_type: f5(slab) [ 11.625037] raw: 0200000000000000 ffff8881000418c0 dead000000000122 0000000000000000 [ 11.625350] raw: 0000000000000000 0000000080200020 00000000f5000000 0000000000000000 [ 11.626032] page dumped because: kasan: bad access detected [ 11.626524] [ 11.626777] Memory state around the buggy address: [ 11.627425] ffff8881029d6100: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc [ 11.627980] ffff8881029d6180: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc [ 11.628535] >ffff8881029d6200: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc [ 11.629025] ^ [ 11.629297] ffff8881029d6280: 00 00 00 00 00 03 fc fc fc fc fc fc fc fc fc fc [ 11.629796] ffff8881029d6300: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc [ 11.630294] ==================================================================