Date
July 4, 2025, 11:11 p.m.
Environment | |
---|---|
qemu-arm64 | |
qemu-x86_64 |
[ 18.231261] ================================================================== [ 18.231373] BUG: KASAN: slab-use-after-free in kmalloc_uaf2+0x3f4/0x468 [ 18.231581] Read of size 1 at addr fff00000c7747b28 by task kunit_try_catch/188 [ 18.231674] [ 18.231721] CPU: 0 UID: 0 PID: 188 Comm: kunit_try_catch Tainted: G B N 6.16.0-rc4 #1 PREEMPT [ 18.231910] Tainted: [B]=BAD_PAGE, [N]=TEST [ 18.231966] Hardware name: linux,dummy-virt (DT) [ 18.232004] Call trace: [ 18.232027] show_stack+0x20/0x38 (C) [ 18.232092] dump_stack_lvl+0x8c/0xd0 [ 18.232320] print_report+0x118/0x608 [ 18.232369] kasan_report+0xdc/0x128 [ 18.232459] __asan_report_load1_noabort+0x20/0x30 [ 18.232607] kmalloc_uaf2+0x3f4/0x468 [ 18.232893] kunit_try_run_case+0x170/0x3f0 [ 18.233161] kunit_generic_run_threadfn_adapter+0x88/0x100 [ 18.233275] kthread+0x328/0x630 [ 18.233327] ret_from_fork+0x10/0x20 [ 18.233647] [ 18.233698] Allocated by task 188: [ 18.234317] kasan_save_stack+0x3c/0x68 [ 18.234392] kasan_save_track+0x20/0x40 [ 18.234440] kasan_save_alloc_info+0x40/0x58 [ 18.234488] __kasan_kmalloc+0xd4/0xd8 [ 18.234525] __kmalloc_cache_noprof+0x16c/0x3c0 [ 18.234563] kmalloc_uaf2+0xc4/0x468 [ 18.234598] kunit_try_run_case+0x170/0x3f0 [ 18.234636] kunit_generic_run_threadfn_adapter+0x88/0x100 [ 18.234679] kthread+0x328/0x630 [ 18.234710] ret_from_fork+0x10/0x20 [ 18.234747] [ 18.234765] Freed by task 188: [ 18.234812] kasan_save_stack+0x3c/0x68 [ 18.235181] kasan_save_track+0x20/0x40 [ 18.235322] kasan_save_free_info+0x4c/0x78 [ 18.235361] __kasan_slab_free+0x6c/0x98 [ 18.235755] kfree+0x214/0x3c8 [ 18.236168] kmalloc_uaf2+0x134/0x468 [ 18.236335] kunit_try_run_case+0x170/0x3f0 [ 18.236764] kunit_generic_run_threadfn_adapter+0x88/0x100 [ 18.236927] kthread+0x328/0x630 [ 18.237118] ret_from_fork+0x10/0x20 [ 18.237155] [ 18.237175] The buggy address belongs to the object at fff00000c7747b00 [ 18.237175] which belongs to the cache kmalloc-64 of size 64 [ 18.237240] The buggy address is located 40 bytes inside of [ 18.237240] freed 64-byte region [fff00000c7747b00, fff00000c7747b40) [ 18.237782] [ 18.237816] The buggy address belongs to the physical page: [ 18.237849] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x107747 [ 18.237907] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff) [ 18.237958] page_type: f5(slab) [ 18.238000] raw: 0bfffe0000000000 fff00000c00018c0 dead000000000122 0000000000000000 [ 18.238050] raw: 0000000000000000 0000000080200020 00000000f5000000 0000000000000000 [ 18.238089] page dumped because: kasan: bad access detected [ 18.238120] [ 18.238138] Memory state around the buggy address: [ 18.238170] fff00000c7747a00: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc [ 18.238213] fff00000c7747a80: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc [ 18.238254] >fff00000c7747b00: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc [ 18.238292] ^ [ 18.238322] fff00000c7747b80: 00 00 00 00 00 03 fc fc fc fc fc fc fc fc fc fc [ 18.238364] fff00000c7747c00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc [ 18.238402] ==================================================================
[ 12.256758] ================================================================== [ 12.258522] BUG: KASAN: slab-use-after-free in kmalloc_uaf2+0x4a8/0x520 [ 12.259514] Read of size 1 at addr ffff888102639d28 by task kunit_try_catch/205 [ 12.260164] [ 12.260710] CPU: 0 UID: 0 PID: 205 Comm: kunit_try_catch Tainted: G B N 6.16.0-rc4 #1 PREEMPT(voluntary) [ 12.260768] Tainted: [B]=BAD_PAGE, [N]=TEST [ 12.260780] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014 [ 12.260813] Call Trace: [ 12.260830] <TASK> [ 12.260851] dump_stack_lvl+0x73/0xb0 [ 12.260891] print_report+0xd1/0x650 [ 12.260915] ? __virt_addr_valid+0x1db/0x2d0 [ 12.260937] ? kmalloc_uaf2+0x4a8/0x520 [ 12.260956] ? kasan_complete_mode_report_info+0x64/0x200 [ 12.260977] ? kmalloc_uaf2+0x4a8/0x520 [ 12.260996] kasan_report+0x141/0x180 [ 12.261016] ? kmalloc_uaf2+0x4a8/0x520 [ 12.261040] __asan_report_load1_noabort+0x18/0x20 [ 12.261062] kmalloc_uaf2+0x4a8/0x520 [ 12.261081] ? __pfx_kmalloc_uaf2+0x10/0x10 [ 12.261099] ? finish_task_switch.isra.0+0x153/0x700 [ 12.261120] ? __switch_to+0x47/0xf50 [ 12.261145] ? __schedule+0x10cc/0x2b60 [ 12.261166] ? __pfx_read_tsc+0x10/0x10 [ 12.261185] ? ktime_get_ts64+0x86/0x230 [ 12.261208] kunit_try_run_case+0x1a5/0x480 [ 12.261244] ? __pfx_kunit_try_run_case+0x10/0x10 [ 12.261264] ? _raw_spin_lock_irqsave+0xa1/0x100 [ 12.261435] ? _raw_spin_unlock_irqrestore+0x5f/0x90 [ 12.261469] ? __kthread_parkme+0x82/0x180 [ 12.261490] ? preempt_count_sub+0x50/0x80 [ 12.261527] ? __pfx_kunit_try_run_case+0x10/0x10 [ 12.261551] kunit_generic_run_threadfn_adapter+0x85/0xf0 [ 12.261617] ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10 [ 12.261639] kthread+0x337/0x6f0 [ 12.261658] ? trace_preempt_on+0x20/0xc0 [ 12.261680] ? __pfx_kthread+0x10/0x10 [ 12.261700] ? _raw_spin_unlock_irq+0x47/0x80 [ 12.261720] ? calculate_sigpending+0x7b/0xa0 [ 12.261743] ? __pfx_kthread+0x10/0x10 [ 12.261763] ret_from_fork+0x116/0x1d0 [ 12.261781] ? __pfx_kthread+0x10/0x10 [ 12.261799] ret_from_fork_asm+0x1a/0x30 [ 12.261830] </TASK> [ 12.261840] [ 12.275778] Allocated by task 205: [ 12.275949] kasan_save_stack+0x45/0x70 [ 12.276113] kasan_save_track+0x18/0x40 [ 12.276259] kasan_save_alloc_info+0x3b/0x50 [ 12.276580] __kasan_kmalloc+0xb7/0xc0 [ 12.277013] __kmalloc_cache_noprof+0x189/0x420 [ 12.277443] kmalloc_uaf2+0xc6/0x520 [ 12.277833] kunit_try_run_case+0x1a5/0x480 [ 12.278281] kunit_generic_run_threadfn_adapter+0x85/0xf0 [ 12.278735] kthread+0x337/0x6f0 [ 12.279073] ret_from_fork+0x116/0x1d0 [ 12.279668] ret_from_fork_asm+0x1a/0x30 [ 12.280119] [ 12.280313] Freed by task 205: [ 12.280748] kasan_save_stack+0x45/0x70 [ 12.281146] kasan_save_track+0x18/0x40 [ 12.281595] kasan_save_free_info+0x3f/0x60 [ 12.282187] __kasan_slab_free+0x56/0x70 [ 12.282734] kfree+0x222/0x3f0 [ 12.283112] kmalloc_uaf2+0x14c/0x520 [ 12.283510] kunit_try_run_case+0x1a5/0x480 [ 12.283846] kunit_generic_run_threadfn_adapter+0x85/0xf0 [ 12.284023] kthread+0x337/0x6f0 [ 12.284145] ret_from_fork+0x116/0x1d0 [ 12.284335] ret_from_fork_asm+0x1a/0x30 [ 12.284828] [ 12.284995] The buggy address belongs to the object at ffff888102639d00 [ 12.284995] which belongs to the cache kmalloc-64 of size 64 [ 12.286284] The buggy address is located 40 bytes inside of [ 12.286284] freed 64-byte region [ffff888102639d00, ffff888102639d40) [ 12.287754] [ 12.287886] The buggy address belongs to the physical page: [ 12.288437] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x102639 [ 12.288969] flags: 0x200000000000000(node=0|zone=2) [ 12.289142] page_type: f5(slab) [ 12.289506] raw: 0200000000000000 ffff8881000418c0 dead000000000122 0000000000000000 [ 12.290181] raw: 0000000000000000 0000000080200020 00000000f5000000 0000000000000000 [ 12.291024] page dumped because: kasan: bad access detected [ 12.291356] [ 12.291730] Memory state around the buggy address: [ 12.292263] ffff888102639c00: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc [ 12.292738] ffff888102639c80: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc [ 12.292973] >ffff888102639d00: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc [ 12.293186] ^ [ 12.293734] ffff888102639d80: 00 00 00 00 00 03 fc fc fc fc fc fc fc fc fc fc [ 12.294437] ffff888102639e00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc [ 12.295057] ==================================================================