Date
July 5, 2025, 5:09 p.m.
Environment | |
---|---|
qemu-arm64 | |
qemu-x86_64 |
[ 18.448856] ================================================================== [ 18.449383] BUG: KASAN: slab-use-after-free in kmalloc_double_kzfree+0x168/0x308 [ 18.449558] Read of size 1 at addr fff00000c5cb3720 by task kunit_try_catch/192 [ 18.449656] [ 18.449870] CPU: 1 UID: 0 PID: 192 Comm: kunit_try_catch Tainted: G B N 6.16.0-rc4 #1 PREEMPT [ 18.449953] Tainted: [B]=BAD_PAGE, [N]=TEST [ 18.449978] Hardware name: linux,dummy-virt (DT) [ 18.450010] Call trace: [ 18.450031] show_stack+0x20/0x38 (C) [ 18.450079] dump_stack_lvl+0x8c/0xd0 [ 18.450125] print_report+0x118/0x608 [ 18.450171] kasan_report+0xdc/0x128 [ 18.450225] __kasan_check_byte+0x54/0x70 [ 18.450272] kfree_sensitive+0x30/0xb0 [ 18.450318] kmalloc_double_kzfree+0x168/0x308 [ 18.450363] kunit_try_run_case+0x170/0x3f0 [ 18.450409] kunit_generic_run_threadfn_adapter+0x88/0x100 [ 18.450460] kthread+0x328/0x630 [ 18.450603] ret_from_fork+0x10/0x20 [ 18.450655] [ 18.450675] Allocated by task 192: [ 18.450762] kasan_save_stack+0x3c/0x68 [ 18.450854] kasan_save_track+0x20/0x40 [ 18.450902] kasan_save_alloc_info+0x40/0x58 [ 18.451010] __kasan_kmalloc+0xd4/0xd8 [ 18.451047] __kmalloc_cache_noprof+0x16c/0x3c0 [ 18.451086] kmalloc_double_kzfree+0xb8/0x308 [ 18.451125] kunit_try_run_case+0x170/0x3f0 [ 18.451163] kunit_generic_run_threadfn_adapter+0x88/0x100 [ 18.451206] kthread+0x328/0x630 [ 18.451238] ret_from_fork+0x10/0x20 [ 18.451274] [ 18.451292] Freed by task 192: [ 18.451317] kasan_save_stack+0x3c/0x68 [ 18.451353] kasan_save_track+0x20/0x40 [ 18.451407] kasan_save_free_info+0x4c/0x78 [ 18.451459] __kasan_slab_free+0x6c/0x98 [ 18.451506] kfree+0x214/0x3c8 [ 18.451608] kfree_sensitive+0x80/0xb0 [ 18.451675] kmalloc_double_kzfree+0x11c/0x308 [ 18.451733] kunit_try_run_case+0x170/0x3f0 [ 18.452005] kunit_generic_run_threadfn_adapter+0x88/0x100 [ 18.452090] kthread+0x328/0x630 [ 18.452123] ret_from_fork+0x10/0x20 [ 18.452159] [ 18.452177] The buggy address belongs to the object at fff00000c5cb3720 [ 18.452177] which belongs to the cache kmalloc-16 of size 16 [ 18.452233] The buggy address is located 0 bytes inside of [ 18.452233] freed 16-byte region [fff00000c5cb3720, fff00000c5cb3730) [ 18.452292] [ 18.452311] The buggy address belongs to the physical page: [ 18.452342] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x105cb3 [ 18.452392] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff) [ 18.452437] page_type: f5(slab) [ 18.452472] raw: 0bfffe0000000000 fff00000c0001640 dead000000000122 0000000000000000 [ 18.452521] raw: 0000000000000000 0000000080800080 00000000f5000000 0000000000000000 [ 18.452561] page dumped because: kasan: bad access detected [ 18.452677] [ 18.452695] Memory state around the buggy address: [ 18.452726] fff00000c5cb3600: fa fb fc fc fa fb fc fc fa fb fc fc fa fb fc fc [ 18.452774] fff00000c5cb3680: fa fb fc fc fa fb fc fc fa fb fc fc fa fb fc fc [ 18.452815] >fff00000c5cb3700: fa fb fc fc fa fb fc fc fc fc fc fc fc fc fc fc [ 18.452852] ^ [ 18.452953] fff00000c5cb3780: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc [ 18.453168] fff00000c5cb3800: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc [ 18.453319] ==================================================================
[ 11.942930] ================================================================== [ 11.943651] BUG: KASAN: slab-use-after-free in kmalloc_double_kzfree+0x19c/0x350 [ 11.943984] Read of size 1 at addr ffff88810274c260 by task kunit_try_catch/210 [ 11.944555] [ 11.944653] CPU: 1 UID: 0 PID: 210 Comm: kunit_try_catch Tainted: G B N 6.16.0-rc4 #1 PREEMPT(voluntary) [ 11.944697] Tainted: [B]=BAD_PAGE, [N]=TEST [ 11.944709] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014 [ 11.944730] Call Trace: [ 11.944741] <TASK> [ 11.944756] dump_stack_lvl+0x73/0xb0 [ 11.944784] print_report+0xd1/0x650 [ 11.944805] ? __virt_addr_valid+0x1db/0x2d0 [ 11.944827] ? kmalloc_double_kzfree+0x19c/0x350 [ 11.944850] ? kasan_complete_mode_report_info+0x64/0x200 [ 11.944871] ? kmalloc_double_kzfree+0x19c/0x350 [ 11.944894] kasan_report+0x141/0x180 [ 11.944916] ? kmalloc_double_kzfree+0x19c/0x350 [ 11.944940] ? kmalloc_double_kzfree+0x19c/0x350 [ 11.944962] __kasan_check_byte+0x3d/0x50 [ 11.944983] kfree_sensitive+0x22/0x90 [ 11.945005] kmalloc_double_kzfree+0x19c/0x350 [ 11.945027] ? __pfx_kmalloc_double_kzfree+0x10/0x10 [ 11.945050] ? __schedule+0x10cc/0x2b60 [ 11.945071] ? __pfx_read_tsc+0x10/0x10 [ 11.945091] ? ktime_get_ts64+0x86/0x230 [ 11.945114] kunit_try_run_case+0x1a5/0x480 [ 11.945137] ? __pfx_kunit_try_run_case+0x10/0x10 [ 11.945157] ? _raw_spin_lock_irqsave+0xa1/0x100 [ 11.945179] ? _raw_spin_unlock_irqrestore+0x5f/0x90 [ 11.945244] ? __kthread_parkme+0x82/0x180 [ 11.945267] ? preempt_count_sub+0x50/0x80 [ 11.945289] ? __pfx_kunit_try_run_case+0x10/0x10 [ 11.945312] kunit_generic_run_threadfn_adapter+0x85/0xf0 [ 11.945334] ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10 [ 11.945356] kthread+0x337/0x6f0 [ 11.945381] ? trace_preempt_on+0x20/0xc0 [ 11.945403] ? __pfx_kthread+0x10/0x10 [ 11.945423] ? _raw_spin_unlock_irq+0x47/0x80 [ 11.945443] ? calculate_sigpending+0x7b/0xa0 [ 11.945477] ? __pfx_kthread+0x10/0x10 [ 11.945498] ret_from_fork+0x116/0x1d0 [ 11.945515] ? __pfx_kthread+0x10/0x10 [ 11.945535] ret_from_fork_asm+0x1a/0x30 [ 11.945565] </TASK> [ 11.945577] [ 11.953314] Allocated by task 210: [ 11.953520] kasan_save_stack+0x45/0x70 [ 11.953720] kasan_save_track+0x18/0x40 [ 11.953912] kasan_save_alloc_info+0x3b/0x50 [ 11.954130] __kasan_kmalloc+0xb7/0xc0 [ 11.954481] __kmalloc_cache_noprof+0x189/0x420 [ 11.954640] kmalloc_double_kzfree+0xa9/0x350 [ 11.955003] kunit_try_run_case+0x1a5/0x480 [ 11.955219] kunit_generic_run_threadfn_adapter+0x85/0xf0 [ 11.955495] kthread+0x337/0x6f0 [ 11.955666] ret_from_fork+0x116/0x1d0 [ 11.955812] ret_from_fork_asm+0x1a/0x30 [ 11.955953] [ 11.956026] Freed by task 210: [ 11.956138] kasan_save_stack+0x45/0x70 [ 11.956305] kasan_save_track+0x18/0x40 [ 11.956504] kasan_save_free_info+0x3f/0x60 [ 11.956708] __kasan_slab_free+0x56/0x70 [ 11.956907] kfree+0x222/0x3f0 [ 11.957128] kfree_sensitive+0x67/0x90 [ 11.957313] kmalloc_double_kzfree+0x12b/0x350 [ 11.957515] kunit_try_run_case+0x1a5/0x480 [ 11.957661] kunit_generic_run_threadfn_adapter+0x85/0xf0 [ 11.958169] kthread+0x337/0x6f0 [ 11.958389] ret_from_fork+0x116/0x1d0 [ 11.958596] ret_from_fork_asm+0x1a/0x30 [ 11.958850] [ 11.958923] The buggy address belongs to the object at ffff88810274c260 [ 11.958923] which belongs to the cache kmalloc-16 of size 16 [ 11.959301] The buggy address is located 0 bytes inside of [ 11.959301] freed 16-byte region [ffff88810274c260, ffff88810274c270) [ 11.959845] [ 11.959939] The buggy address belongs to the physical page: [ 11.960219] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x10274c [ 11.960554] flags: 0x200000000000000(node=0|zone=2) [ 11.960813] page_type: f5(slab) [ 11.960938] raw: 0200000000000000 ffff888100041640 dead000000000122 0000000000000000 [ 11.961284] raw: 0000000000000000 0000000080800080 00000000f5000000 0000000000000000 [ 11.961645] page dumped because: kasan: bad access detected [ 11.961961] [ 11.962039] Memory state around the buggy address: [ 11.962217] ffff88810274c100: 00 02 fc fc 00 02 fc fc 00 02 fc fc 00 02 fc fc [ 11.962433] ffff88810274c180: fa fb fc fc fa fb fc fc fa fb fc fc fa fb fc fc [ 11.962757] >ffff88810274c200: fa fb fc fc fa fb fc fc fa fb fc fc fa fb fc fc [ 11.963302] ^ [ 11.963593] ffff88810274c280: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc [ 11.964011] ffff88810274c300: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc [ 11.964357] ==================================================================