Date
July 6, 2025, 11:09 a.m.
Environment | |
---|---|
qemu-arm64 | |
qemu-x86_64 |
[ 18.033293] ================================================================== [ 18.033372] BUG: KASAN: slab-use-after-free in kmalloc_uaf_16+0x3bc/0x438 [ 18.033421] Read of size 16 at addr fff00000c1cea920 by task kunit_try_catch/168 [ 18.033469] [ 18.033499] CPU: 1 UID: 0 PID: 168 Comm: kunit_try_catch Tainted: G B N 6.16.0-rc4 #1 PREEMPT [ 18.033846] Tainted: [B]=BAD_PAGE, [N]=TEST [ 18.034138] Hardware name: linux,dummy-virt (DT) [ 18.034176] Call trace: [ 18.034212] show_stack+0x20/0x38 (C) [ 18.034445] dump_stack_lvl+0x8c/0xd0 [ 18.034516] print_report+0x118/0x608 [ 18.034667] kasan_report+0xdc/0x128 [ 18.034717] __asan_report_load16_noabort+0x20/0x30 [ 18.035143] kmalloc_uaf_16+0x3bc/0x438 [ 18.035753] kunit_try_run_case+0x170/0x3f0 [ 18.036063] kunit_generic_run_threadfn_adapter+0x88/0x100 [ 18.036232] kthread+0x328/0x630 [ 18.036333] ret_from_fork+0x10/0x20 [ 18.036696] [ 18.036754] Allocated by task 168: [ 18.036806] kasan_save_stack+0x3c/0x68 [ 18.036923] kasan_save_track+0x20/0x40 [ 18.037337] kasan_save_alloc_info+0x40/0x58 [ 18.037518] __kasan_kmalloc+0xd4/0xd8 [ 18.037689] __kmalloc_cache_noprof+0x16c/0x3c0 [ 18.037781] kmalloc_uaf_16+0x140/0x438 [ 18.038040] kunit_try_run_case+0x170/0x3f0 [ 18.038109] kunit_generic_run_threadfn_adapter+0x88/0x100 [ 18.038266] kthread+0x328/0x630 [ 18.038447] ret_from_fork+0x10/0x20 [ 18.038592] [ 18.038688] Freed by task 168: [ 18.038749] kasan_save_stack+0x3c/0x68 [ 18.038788] kasan_save_track+0x20/0x40 [ 18.038849] kasan_save_free_info+0x4c/0x78 [ 18.039058] __kasan_slab_free+0x6c/0x98 [ 18.039123] kfree+0x214/0x3c8 [ 18.039275] kmalloc_uaf_16+0x190/0x438 [ 18.039352] kunit_try_run_case+0x170/0x3f0 [ 18.039557] kunit_generic_run_threadfn_adapter+0x88/0x100 [ 18.039862] kthread+0x328/0x630 [ 18.040046] ret_from_fork+0x10/0x20 [ 18.040246] [ 18.040357] The buggy address belongs to the object at fff00000c1cea920 [ 18.040357] which belongs to the cache kmalloc-16 of size 16 [ 18.040512] The buggy address is located 0 bytes inside of [ 18.040512] freed 16-byte region [fff00000c1cea920, fff00000c1cea930) [ 18.040693] [ 18.040792] The buggy address belongs to the physical page: [ 18.040885] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x101cea [ 18.041004] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff) [ 18.041266] page_type: f5(slab) [ 18.041355] raw: 0bfffe0000000000 fff00000c0001640 dead000000000122 0000000000000000 [ 18.041601] raw: 0000000000000000 0000000080800080 00000000f5000000 0000000000000000 [ 18.041782] page dumped because: kasan: bad access detected [ 18.041822] [ 18.041840] Memory state around the buggy address: [ 18.041872] fff00000c1cea800: fa fb fc fc 00 04 fc fc fa fb fc fc fa fb fc fc [ 18.042214] fff00000c1cea880: fa fb fc fc fa fb fc fc fa fb fc fc fa fb fc fc [ 18.042326] >fff00000c1cea900: 00 00 fc fc fa fb fc fc fc fc fc fc fc fc fc fc [ 18.042365] ^ [ 18.042615] fff00000c1cea980: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc [ 18.042901] fff00000c1ceaa00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc [ 18.043040] ==================================================================
[ 11.631279] ================================================================== [ 11.631769] BUG: KASAN: slab-use-after-free in kmalloc_uaf_16+0x47b/0x4c0 [ 11.632184] Read of size 16 at addr ffff888101e8f4a0 by task kunit_try_catch/185 [ 11.632495] [ 11.632685] CPU: 0 UID: 0 PID: 185 Comm: kunit_try_catch Tainted: G B N 6.16.0-rc4 #1 PREEMPT(voluntary) [ 11.632733] Tainted: [B]=BAD_PAGE, [N]=TEST [ 11.632745] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014 [ 11.632766] Call Trace: [ 11.632780] <TASK> [ 11.632797] dump_stack_lvl+0x73/0xb0 [ 11.632826] print_report+0xd1/0x650 [ 11.632849] ? __virt_addr_valid+0x1db/0x2d0 [ 11.632872] ? kmalloc_uaf_16+0x47b/0x4c0 [ 11.632892] ? kasan_complete_mode_report_info+0x64/0x200 [ 11.632914] ? kmalloc_uaf_16+0x47b/0x4c0 [ 11.632948] kasan_report+0x141/0x180 [ 11.632970] ? kmalloc_uaf_16+0x47b/0x4c0 [ 11.632995] __asan_report_load16_noabort+0x18/0x20 [ 11.633019] kmalloc_uaf_16+0x47b/0x4c0 [ 11.633040] ? __pfx_kmalloc_uaf_16+0x10/0x10 [ 11.633072] ? __schedule+0x10cc/0x2b60 [ 11.633094] ? __pfx_read_tsc+0x10/0x10 [ 11.633115] ? ktime_get_ts64+0x86/0x230 [ 11.633139] kunit_try_run_case+0x1a5/0x480 [ 11.633163] ? __pfx_kunit_try_run_case+0x10/0x10 [ 11.633185] ? _raw_spin_lock_irqsave+0xa1/0x100 [ 11.633207] ? _raw_spin_unlock_irqrestore+0x5f/0x90 [ 11.633230] ? __kthread_parkme+0x82/0x180 [ 11.633250] ? preempt_count_sub+0x50/0x80 [ 11.633275] ? __pfx_kunit_try_run_case+0x10/0x10 [ 11.633298] kunit_generic_run_threadfn_adapter+0x85/0xf0 [ 11.633320] ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10 [ 11.633342] kthread+0x337/0x6f0 [ 11.633361] ? trace_preempt_on+0x20/0xc0 [ 11.633385] ? __pfx_kthread+0x10/0x10 [ 11.633405] ? _raw_spin_unlock_irq+0x47/0x80 [ 11.633425] ? calculate_sigpending+0x7b/0xa0 [ 11.633449] ? __pfx_kthread+0x10/0x10 [ 11.633509] ret_from_fork+0x116/0x1d0 [ 11.633532] ? __pfx_kthread+0x10/0x10 [ 11.633552] ret_from_fork_asm+0x1a/0x30 [ 11.633583] </TASK> [ 11.633595] [ 11.641072] Allocated by task 185: [ 11.641207] kasan_save_stack+0x45/0x70 [ 11.641355] kasan_save_track+0x18/0x40 [ 11.641504] kasan_save_alloc_info+0x3b/0x50 [ 11.641716] __kasan_kmalloc+0xb7/0xc0 [ 11.641960] __kmalloc_cache_noprof+0x189/0x420 [ 11.642313] kmalloc_uaf_16+0x15b/0x4c0 [ 11.642474] kunit_try_run_case+0x1a5/0x480 [ 11.642619] kunit_generic_run_threadfn_adapter+0x85/0xf0 [ 11.642789] kthread+0x337/0x6f0 [ 11.642968] ret_from_fork+0x116/0x1d0 [ 11.643307] ret_from_fork_asm+0x1a/0x30 [ 11.643568] [ 11.643671] Freed by task 185: [ 11.643837] kasan_save_stack+0x45/0x70 [ 11.644048] kasan_save_track+0x18/0x40 [ 11.644253] kasan_save_free_info+0x3f/0x60 [ 11.644494] __kasan_slab_free+0x56/0x70 [ 11.644702] kfree+0x222/0x3f0 [ 11.644863] kmalloc_uaf_16+0x1d6/0x4c0 [ 11.645041] kunit_try_run_case+0x1a5/0x480 [ 11.645233] kunit_generic_run_threadfn_adapter+0x85/0xf0 [ 11.645406] kthread+0x337/0x6f0 [ 11.645846] ret_from_fork+0x116/0x1d0 [ 11.646079] ret_from_fork_asm+0x1a/0x30 [ 11.646264] [ 11.646353] The buggy address belongs to the object at ffff888101e8f4a0 [ 11.646353] which belongs to the cache kmalloc-16 of size 16 [ 11.646824] The buggy address is located 0 bytes inside of [ 11.646824] freed 16-byte region [ffff888101e8f4a0, ffff888101e8f4b0) [ 11.647363] [ 11.647441] The buggy address belongs to the physical page: [ 11.647776] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x101e8f [ 11.648113] flags: 0x200000000000000(node=0|zone=2) [ 11.648490] page_type: f5(slab) [ 11.648654] raw: 0200000000000000 ffff888100041640 dead000000000122 0000000000000000 [ 11.648946] raw: 0000000000000000 0000000080800080 00000000f5000000 0000000000000000 [ 11.649173] page dumped because: kasan: bad access detected [ 11.649344] [ 11.649414] Memory state around the buggy address: [ 11.649739] ffff888101e8f380: 00 02 fc fc 00 02 fc fc 00 02 fc fc fa fb fc fc [ 11.650065] ffff888101e8f400: fa fb fc fc fa fb fc fc fa fb fc fc fa fb fc fc [ 11.650475] >ffff888101e8f480: 00 00 fc fc fa fb fc fc fc fc fc fc fc fc fc fc [ 11.650685] ^ [ 11.650824] ffff888101e8f500: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc [ 11.651051] ffff888101e8f580: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc [ 11.651720] ==================================================================