Date
June 17, 2025, 6:35 a.m.
Environment | |
---|---|
qemu-arm64 | |
qemu-x86_64 |
[ 17.068600] ================================================================== [ 17.068685] BUG: KASAN: double-free in kfree_sensitive+0x3c/0xb0 [ 17.068743] Free of addr fff00000c1193700 by task kunit_try_catch/201 [ 17.069086] [ 17.069122] CPU: 1 UID: 0 PID: 201 Comm: kunit_try_catch Tainted: G B N 6.16.0-rc2-next-20250617 #1 PREEMPT [ 17.069297] Tainted: [B]=BAD_PAGE, [N]=TEST [ 17.069354] Hardware name: linux,dummy-virt (DT) [ 17.069389] Call trace: [ 17.069420] show_stack+0x20/0x38 (C) [ 17.069748] dump_stack_lvl+0x8c/0xd0 [ 17.069954] print_report+0x118/0x608 [ 17.070018] kasan_report_invalid_free+0xc0/0xe8 [ 17.070199] check_slab_allocation+0xd4/0x108 [ 17.070287] __kasan_slab_pre_free+0x2c/0x48 [ 17.070420] kfree+0xe8/0x3c8 [ 17.070466] kfree_sensitive+0x3c/0xb0 [ 17.070518] kmalloc_double_kzfree+0x168/0x308 [ 17.070709] kunit_try_run_case+0x170/0x3f0 [ 17.070978] kunit_generic_run_threadfn_adapter+0x88/0x100 [ 17.071105] kthread+0x328/0x630 [ 17.071194] ret_from_fork+0x10/0x20 [ 17.071342] [ 17.071363] Allocated by task 201: [ 17.071406] kasan_save_stack+0x3c/0x68 [ 17.071452] kasan_save_track+0x20/0x40 [ 17.071501] kasan_save_alloc_info+0x40/0x58 [ 17.071540] __kasan_kmalloc+0xd4/0xd8 [ 17.071589] __kmalloc_cache_noprof+0x16c/0x3c0 [ 17.071640] kmalloc_double_kzfree+0xb8/0x308 [ 17.071686] kunit_try_run_case+0x170/0x3f0 [ 17.071734] kunit_generic_run_threadfn_adapter+0x88/0x100 [ 17.071788] kthread+0x328/0x630 [ 17.071823] ret_from_fork+0x10/0x20 [ 17.071860] [ 17.071881] Freed by task 201: [ 17.071922] kasan_save_stack+0x3c/0x68 [ 17.072140] kasan_save_track+0x20/0x40 [ 17.072512] kasan_save_free_info+0x4c/0x78 [ 17.072658] __kasan_slab_free+0x6c/0x98 [ 17.072702] kfree+0x214/0x3c8 [ 17.072911] kfree_sensitive+0x80/0xb0 [ 17.073017] kmalloc_double_kzfree+0x11c/0x308 [ 17.073206] kunit_try_run_case+0x170/0x3f0 [ 17.073399] kunit_generic_run_threadfn_adapter+0x88/0x100 [ 17.073512] kthread+0x328/0x630 [ 17.073577] ret_from_fork+0x10/0x20 [ 17.073990] [ 17.074402] The buggy address belongs to the object at fff00000c1193700 [ 17.074402] which belongs to the cache kmalloc-16 of size 16 [ 17.074480] The buggy address is located 0 bytes inside of [ 17.074480] 16-byte region [fff00000c1193700, fff00000c1193710) [ 17.074899] [ 17.074986] The buggy address belongs to the physical page: [ 17.075051] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x101193 [ 17.075110] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff) [ 17.075161] page_type: f5(slab) [ 17.075404] raw: 0bfffe0000000000 fff00000c0001640 dead000000000100 dead000000000122 [ 17.075648] raw: 0000000000000000 0000000080800080 00000000f5000000 0000000000000000 [ 17.075722] page dumped because: kasan: bad access detected [ 17.076403] [ 17.076569] Memory state around the buggy address: [ 17.076649] fff00000c1193600: fa fb fc fc fa fb fc fc fa fb fc fc fa fb fc fc [ 17.076770] fff00000c1193680: fa fb fc fc fa fb fc fc fa fb fc fc fa fb fc fc [ 17.076826] >fff00000c1193700: fa fb fc fc fc fc fc fc fc fc fc fc fc fc fc fc [ 17.076975] ^ [ 17.077052] fff00000c1193780: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc [ 17.077119] fff00000c1193800: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc [ 17.077391] ==================================================================
[ 18.536431] ================================================================== [ 18.538169] BUG: KASAN: double-free in kfree_sensitive+0x2e/0x90 [ 18.539380] Free of addr ffff8881027b1d60 by task kunit_try_catch/219 [ 18.540212] [ 18.540577] CPU: 0 UID: 0 PID: 219 Comm: kunit_try_catch Tainted: G B N 6.16.0-rc2-next-20250617 #1 PREEMPT(voluntary) [ 18.540704] Tainted: [B]=BAD_PAGE, [N]=TEST [ 18.540724] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014 [ 18.540755] Call Trace: [ 18.540772] <TASK> [ 18.540791] dump_stack_lvl+0x73/0xb0 [ 18.540854] print_report+0xd1/0x650 [ 18.540948] ? __virt_addr_valid+0x1db/0x2d0 [ 18.541051] ? kasan_complete_mode_report_info+0x64/0x200 [ 18.541123] ? kfree_sensitive+0x2e/0x90 [ 18.541186] kasan_report_invalid_free+0x10a/0x130 [ 18.541294] ? kfree_sensitive+0x2e/0x90 [ 18.541375] ? kfree_sensitive+0x2e/0x90 [ 18.541444] check_slab_allocation+0x101/0x130 [ 18.541518] __kasan_slab_pre_free+0x28/0x40 [ 18.541589] kfree+0xf0/0x3f0 [ 18.541626] ? add_taint+0x2e/0xa0 [ 18.541651] ? kfree_sensitive+0x2e/0x90 [ 18.541679] kfree_sensitive+0x2e/0x90 [ 18.541704] kmalloc_double_kzfree+0x19c/0x350 [ 18.541735] ? __pfx_kmalloc_double_kzfree+0x10/0x10 [ 18.541770] ? __pfx_kmalloc_double_kzfree+0x10/0x10 [ 18.541805] kunit_try_run_case+0x1a5/0x480 [ 18.541865] ? __pfx_kunit_try_run_case+0x10/0x10 [ 18.541901] ? _raw_spin_lock_irqsave+0xa1/0x100 [ 18.541929] ? _raw_spin_unlock_irqrestore+0x5f/0x90 [ 18.541963] ? __kthread_parkme+0x82/0x180 [ 18.541989] ? preempt_count_sub+0x50/0x80 [ 18.542020] ? __pfx_kunit_try_run_case+0x10/0x10 [ 18.542052] kunit_generic_run_threadfn_adapter+0x85/0xf0 [ 18.542085] ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10 [ 18.542116] kthread+0x337/0x6f0 [ 18.542142] ? trace_preempt_on+0x20/0xc0 [ 18.542174] ? __pfx_kthread+0x10/0x10 [ 18.542201] ? _raw_spin_unlock_irq+0x47/0x80 [ 18.542279] ? calculate_sigpending+0x7b/0xa0 [ 18.542361] ? __pfx_kthread+0x10/0x10 [ 18.542396] ret_from_fork+0x116/0x1d0 [ 18.542423] ? __pfx_kthread+0x10/0x10 [ 18.542451] ret_from_fork_asm+0x1a/0x30 [ 18.542490] </TASK> [ 18.542504] [ 18.558885] Allocated by task 219: [ 18.559107] kasan_save_stack+0x45/0x70 [ 18.559487] kasan_save_track+0x18/0x40 [ 18.559956] kasan_save_alloc_info+0x3b/0x50 [ 18.560511] __kasan_kmalloc+0xb7/0xc0 [ 18.560903] __kmalloc_cache_noprof+0x189/0x420 [ 18.561730] kmalloc_double_kzfree+0xa9/0x350 [ 18.562517] kunit_try_run_case+0x1a5/0x480 [ 18.562776] kunit_generic_run_threadfn_adapter+0x85/0xf0 [ 18.563798] kthread+0x337/0x6f0 [ 18.564760] ret_from_fork+0x116/0x1d0 [ 18.565167] ret_from_fork_asm+0x1a/0x30 [ 18.567807] [ 18.568032] Freed by task 219: [ 18.568558] kasan_save_stack+0x45/0x70 [ 18.568798] kasan_save_track+0x18/0x40 [ 18.569127] kasan_save_free_info+0x3f/0x60 [ 18.569579] __kasan_slab_free+0x56/0x70 [ 18.569905] kfree+0x222/0x3f0 [ 18.570231] kfree_sensitive+0x67/0x90 [ 18.570781] kmalloc_double_kzfree+0x12b/0x350 [ 18.571389] kunit_try_run_case+0x1a5/0x480 [ 18.571863] kunit_generic_run_threadfn_adapter+0x85/0xf0 [ 18.572171] kthread+0x337/0x6f0 [ 18.573676] ret_from_fork+0x116/0x1d0 [ 18.574085] ret_from_fork_asm+0x1a/0x30 [ 18.575426] [ 18.575630] The buggy address belongs to the object at ffff8881027b1d60 [ 18.575630] which belongs to the cache kmalloc-16 of size 16 [ 18.576369] The buggy address is located 0 bytes inside of [ 18.576369] 16-byte region [ffff8881027b1d60, ffff8881027b1d70) [ 18.577616] [ 18.577821] The buggy address belongs to the physical page: [ 18.578509] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1027b1 [ 18.579154] flags: 0x200000000000000(node=0|zone=2) [ 18.579703] page_type: f5(slab) [ 18.580113] raw: 0200000000000000 ffff888100041640 dead000000000122 0000000000000000 [ 18.581365] raw: 0000000000000000 0000000080800080 00000000f5000000 0000000000000000 [ 18.581977] page dumped because: kasan: bad access detected [ 18.582611] [ 18.582878] Memory state around the buggy address: [ 18.583460] ffff8881027b1c00: fa fb fc fc fa fb fc fc fa fb fc fc fa fb fc fc [ 18.584073] ffff8881027b1c80: fa fb fc fc fa fb fc fc 00 05 fc fc fa fb fc fc [ 18.584790] >ffff8881027b1d00: fa fb fc fc fa fb fc fc fa fb fc fc fa fb fc fc [ 18.585484] ^ [ 18.585874] ffff8881027b1d80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc [ 18.586731] ffff8881027b1e00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc [ 18.587494] ==================================================================