Date
May 12, 2025, 11:48 a.m.
Environment | |
---|---|
qemu-arm64 | |
qemu-x86_64 |
[ 16.640679] ================================================================== [ 16.640797] BUG: KASAN: slab-use-after-free in kmalloc_uaf_16+0x3bc/0x438 [ 16.640905] Read of size 16 at addr fff00000c10cc820 by task kunit_try_catch/168 [ 16.641011] [ 16.641085] CPU: 1 UID: 0 PID: 168 Comm: kunit_try_catch Tainted: G B N 6.15.0-rc6-next-20250512 #1 PREEMPT [ 16.641259] Tainted: [B]=BAD_PAGE, [N]=TEST [ 16.641313] Hardware name: linux,dummy-virt (DT) [ 16.641374] Call trace: [ 16.641417] show_stack+0x20/0x38 (C) [ 16.641518] dump_stack_lvl+0x8c/0xd0 [ 16.641617] print_report+0x118/0x608 [ 16.641709] kasan_report+0xdc/0x128 [ 16.641808] __asan_report_load16_noabort+0x20/0x30 [ 16.642553] kmalloc_uaf_16+0x3bc/0x438 [ 16.642678] kunit_try_run_case+0x170/0x3f0 [ 16.642784] kunit_generic_run_threadfn_adapter+0x88/0x100 [ 16.642895] kthread+0x328/0x630 [ 16.642998] ret_from_fork+0x10/0x20 [ 16.643146] [ 16.643191] Allocated by task 168: [ 16.643358] kasan_save_stack+0x3c/0x68 [ 16.643451] kasan_save_track+0x20/0x40 [ 16.643516] kasan_save_alloc_info+0x40/0x58 [ 16.643579] __kasan_kmalloc+0xd4/0xd8 [ 16.643645] __kmalloc_cache_noprof+0x15c/0x3c0 [ 16.643713] kmalloc_uaf_16+0x140/0x438 [ 16.643780] kunit_try_run_case+0x170/0x3f0 [ 16.643851] kunit_generic_run_threadfn_adapter+0x88/0x100 [ 16.643939] kthread+0x328/0x630 [ 16.644407] ret_from_fork+0x10/0x20 [ 16.644691] [ 16.644754] Freed by task 168: [ 16.644834] kasan_save_stack+0x3c/0x68 [ 16.644916] kasan_save_track+0x20/0x40 [ 16.644990] kasan_save_free_info+0x4c/0x78 [ 16.645082] __kasan_slab_free+0x6c/0x98 [ 16.645153] kfree+0x214/0x3c8 [ 16.645220] kmalloc_uaf_16+0x190/0x438 [ 16.645296] kunit_try_run_case+0x170/0x3f0 [ 16.645369] kunit_generic_run_threadfn_adapter+0x88/0x100 [ 16.645454] kthread+0x328/0x630 [ 16.645524] ret_from_fork+0x10/0x20 [ 16.645596] [ 16.645645] The buggy address belongs to the object at fff00000c10cc820 [ 16.645645] which belongs to the cache kmalloc-16 of size 16 [ 16.645816] The buggy address is located 0 bytes inside of [ 16.645816] freed 16-byte region [fff00000c10cc820, fff00000c10cc830) [ 16.645985] [ 16.646026] The buggy address belongs to the physical page: [ 16.646459] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1010cc [ 16.646589] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff) [ 16.646866] page_type: f5(slab) [ 16.646955] raw: 0bfffe0000000000 fff00000c0001640 dead000000000122 0000000000000000 [ 16.647114] raw: 0000000000000000 0000000080800080 00000000f5000000 0000000000000000 [ 16.647221] page dumped because: kasan: bad access detected [ 16.647285] [ 16.647319] Memory state around the buggy address: [ 16.647383] fff00000c10cc700: fa fb fc fc 00 07 fc fc fa fb fc fc fa fb fc fc [ 16.647494] fff00000c10cc780: fa fb fc fc fa fb fc fc fa fb fc fc fa fb fc fc [ 16.647594] >fff00000c10cc800: 00 00 fc fc fa fb fc fc fc fc fc fc fc fc fc fc [ 16.647664] ^ [ 16.647725] fff00000c10cc880: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc [ 16.648053] fff00000c10cc900: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc [ 16.648165] ==================================================================
[ 16.610446] ================================================================== [ 16.610966] BUG: KASAN: slab-use-after-free in kmalloc_uaf_16+0x47b/0x4c0 [ 16.612152] Read of size 16 at addr ffff8881026fb940 by task kunit_try_catch/185 [ 16.612540] [ 16.612997] CPU: 1 UID: 0 PID: 185 Comm: kunit_try_catch Tainted: G B N 6.15.0-rc6-next-20250512 #1 PREEMPT(voluntary) [ 16.613101] Tainted: [B]=BAD_PAGE, [N]=TEST [ 16.613123] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014 [ 16.613161] Call Trace: [ 16.613188] <TASK> [ 16.613222] dump_stack_lvl+0x73/0xb0 [ 16.613308] print_report+0xd1/0x650 [ 16.613362] ? __virt_addr_valid+0x1db/0x2d0 [ 16.613415] ? kmalloc_uaf_16+0x47b/0x4c0 [ 16.613448] ? kasan_complete_mode_report_info+0x64/0x200 [ 16.613474] ? kmalloc_uaf_16+0x47b/0x4c0 [ 16.613497] kasan_report+0x141/0x180 [ 16.613521] ? kmalloc_uaf_16+0x47b/0x4c0 [ 16.613549] __asan_report_load16_noabort+0x18/0x20 [ 16.613571] kmalloc_uaf_16+0x47b/0x4c0 [ 16.613594] ? __pfx_kmalloc_uaf_16+0x10/0x10 [ 16.613619] ? __schedule+0x10cc/0x2b60 [ 16.613642] ? __pfx_read_tsc+0x10/0x10 [ 16.613664] ? ktime_get_ts64+0x86/0x230 [ 16.613692] kunit_try_run_case+0x1a5/0x480 [ 16.613720] ? __pfx_kunit_try_run_case+0x10/0x10 [ 16.613744] ? _raw_spin_lock_irqsave+0xa1/0x100 [ 16.613777] ? _raw_spin_unlock_irqrestore+0x5f/0x90 [ 16.613830] ? __kthread_parkme+0x82/0x180 [ 16.613855] ? preempt_count_sub+0x50/0x80 [ 16.613882] ? __pfx_kunit_try_run_case+0x10/0x10 [ 16.613907] kunit_generic_run_threadfn_adapter+0x85/0xf0 [ 16.613931] ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10 [ 16.613956] kthread+0x337/0x6f0 [ 16.613977] ? trace_preempt_on+0x20/0xc0 [ 16.614004] ? __pfx_kthread+0x10/0x10 [ 16.614026] ? _raw_spin_unlock_irq+0x47/0x80 [ 16.614060] ? calculate_sigpending+0x7b/0xa0 [ 16.614110] ? __pfx_kthread+0x10/0x10 [ 16.614144] ret_from_fork+0x116/0x1d0 [ 16.614174] ? __pfx_kthread+0x10/0x10 [ 16.614196] ret_from_fork_asm+0x1a/0x30 [ 16.614230] </TASK> [ 16.614245] [ 16.627100] Allocated by task 185: [ 16.627875] kasan_save_stack+0x45/0x70 [ 16.628553] kasan_save_track+0x18/0x40 [ 16.628815] kasan_save_alloc_info+0x3b/0x50 [ 16.629476] __kasan_kmalloc+0xb7/0xc0 [ 16.629822] __kmalloc_cache_noprof+0x189/0x420 [ 16.630164] kmalloc_uaf_16+0x15b/0x4c0 [ 16.630501] kunit_try_run_case+0x1a5/0x480 [ 16.630838] kunit_generic_run_threadfn_adapter+0x85/0xf0 [ 16.631212] kthread+0x337/0x6f0 [ 16.631719] ret_from_fork+0x116/0x1d0 [ 16.632238] ret_from_fork_asm+0x1a/0x30 [ 16.632489] [ 16.632679] Freed by task 185: [ 16.632966] kasan_save_stack+0x45/0x70 [ 16.633207] kasan_save_track+0x18/0x40 [ 16.633944] kasan_save_free_info+0x3f/0x60 [ 16.634435] __kasan_slab_free+0x56/0x70 [ 16.634981] kfree+0x222/0x3f0 [ 16.635532] kmalloc_uaf_16+0x1d6/0x4c0 [ 16.636008] kunit_try_run_case+0x1a5/0x480 [ 16.636559] kunit_generic_run_threadfn_adapter+0x85/0xf0 [ 16.637238] kthread+0x337/0x6f0 [ 16.637431] ret_from_fork+0x116/0x1d0 [ 16.637556] ret_from_fork_asm+0x1a/0x30 [ 16.637659] [ 16.637720] The buggy address belongs to the object at ffff8881026fb940 [ 16.637720] which belongs to the cache kmalloc-16 of size 16 [ 16.637945] The buggy address is located 0 bytes inside of [ 16.637945] freed 16-byte region [ffff8881026fb940, ffff8881026fb950) [ 16.638592] [ 16.638861] The buggy address belongs to the physical page: [ 16.639534] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1026fb [ 16.640382] flags: 0x200000000000000(node=0|zone=2) [ 16.640900] page_type: f5(slab) [ 16.641444] raw: 0200000000000000 ffff888100041640 dead000000000122 0000000000000000 [ 16.642385] raw: 0000000000000000 0000000080800080 00000000f5000000 0000000000000000 [ 16.643347] page dumped because: kasan: bad access detected [ 16.643843] [ 16.644025] Memory state around the buggy address: [ 16.644631] ffff8881026fb800: 00 03 fc fc fa fb fc fc 00 02 fc fc 00 05 fc fc [ 16.645002] ffff8881026fb880: 00 02 fc fc 00 02 fc fc 00 02 fc fc 00 02 fc fc [ 16.645651] >ffff8881026fb900: fa fb fc fc 00 00 fc fc fa fb fc fc fc fc fc fc [ 16.645981] ^ [ 16.646547] ffff8881026fb980: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc [ 16.647047] ffff8881026fba00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc [ 16.647689] ==================================================================