Date
July 4, 2025, 11:11 p.m.
Environment | |
---|---|
qemu-arm64 | |
qemu-x86_64 |
[ 18.263627] ================================================================== [ 18.263690] BUG: KASAN: slab-use-after-free in kmalloc_double_kzfree+0x168/0x308 [ 18.263754] Read of size 1 at addr fff00000c6173820 by task kunit_try_catch/192 [ 18.263819] [ 18.263857] CPU: 0 UID: 0 PID: 192 Comm: kunit_try_catch Tainted: G B N 6.16.0-rc4 #1 PREEMPT [ 18.263944] Tainted: [B]=BAD_PAGE, [N]=TEST [ 18.263970] Hardware name: linux,dummy-virt (DT) [ 18.264003] Call trace: [ 18.264028] show_stack+0x20/0x38 (C) [ 18.264076] dump_stack_lvl+0x8c/0xd0 [ 18.264868] print_report+0x118/0x608 [ 18.265012] kasan_report+0xdc/0x128 [ 18.265618] __kasan_check_byte+0x54/0x70 [ 18.265674] kfree_sensitive+0x30/0xb0 [ 18.265723] kmalloc_double_kzfree+0x168/0x308 [ 18.266181] kunit_try_run_case+0x170/0x3f0 [ 18.266339] kunit_generic_run_threadfn_adapter+0x88/0x100 [ 18.266438] kthread+0x328/0x630 [ 18.266527] ret_from_fork+0x10/0x20 [ 18.266681] [ 18.266702] Allocated by task 192: [ 18.266742] kasan_save_stack+0x3c/0x68 [ 18.266976] kasan_save_track+0x20/0x40 [ 18.267196] kasan_save_alloc_info+0x40/0x58 [ 18.267448] __kasan_kmalloc+0xd4/0xd8 [ 18.267524] __kmalloc_cache_noprof+0x16c/0x3c0 [ 18.267688] kmalloc_double_kzfree+0xb8/0x308 [ 18.267750] kunit_try_run_case+0x170/0x3f0 [ 18.267788] kunit_generic_run_threadfn_adapter+0x88/0x100 [ 18.267843] kthread+0x328/0x630 [ 18.267877] ret_from_fork+0x10/0x20 [ 18.268317] [ 18.268381] Freed by task 192: [ 18.268541] kasan_save_stack+0x3c/0x68 [ 18.268610] kasan_save_track+0x20/0x40 [ 18.268742] kasan_save_free_info+0x4c/0x78 [ 18.268856] __kasan_slab_free+0x6c/0x98 [ 18.268915] kfree+0x214/0x3c8 [ 18.269139] kfree_sensitive+0x80/0xb0 [ 18.270723] kmalloc_double_kzfree+0x11c/0x308 [ 18.270791] kunit_try_run_case+0x170/0x3f0 [ 18.270890] kunit_generic_run_threadfn_adapter+0x88/0x100 [ 18.271007] kthread+0x328/0x630 [ 18.271175] ret_from_fork+0x10/0x20 [ 18.271483] [ 18.271538] The buggy address belongs to the object at fff00000c6173820 [ 18.271538] which belongs to the cache kmalloc-16 of size 16 [ 18.271905] The buggy address is located 0 bytes inside of [ 18.271905] freed 16-byte region [fff00000c6173820, fff00000c6173830) [ 18.272077] [ 18.272132] The buggy address belongs to the physical page: [ 18.272343] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x106173 [ 18.272513] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff) [ 18.272597] page_type: f5(slab) [ 18.272658] raw: 0bfffe0000000000 fff00000c0001640 dead000000000122 0000000000000000 [ 18.272921] raw: 0000000000000000 0000000080800080 00000000f5000000 0000000000000000 [ 18.273112] page dumped because: kasan: bad access detected [ 18.273166] [ 18.273942] Memory state around the buggy address: [ 18.273992] fff00000c6173700: fa fb fc fc fa fb fc fc 00 04 fc fc fa fb fc fc [ 18.274039] fff00000c6173780: fa fb fc fc fa fb fc fc fa fb fc fc fa fb fc fc [ 18.274082] >fff00000c6173800: fa fb fc fc fa fb fc fc fc fc fc fc fc fc fc fc [ 18.274428] ^ [ 18.274481] fff00000c6173880: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc [ 18.274524] fff00000c6173900: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc [ 18.274573] ==================================================================
[ 12.311467] ================================================================== [ 12.312062] BUG: KASAN: slab-use-after-free in kmalloc_double_kzfree+0x19c/0x350 [ 12.312423] Read of size 1 at addr ffff88810298e100 by task kunit_try_catch/209 [ 12.312774] [ 12.313020] CPU: 1 UID: 0 PID: 209 Comm: kunit_try_catch Tainted: G B N 6.16.0-rc4 #1 PREEMPT(voluntary) [ 12.313074] Tainted: [B]=BAD_PAGE, [N]=TEST [ 12.313086] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014 [ 12.313109] Call Trace: [ 12.313123] <TASK> [ 12.313144] dump_stack_lvl+0x73/0xb0 [ 12.313181] print_report+0xd1/0x650 [ 12.313361] ? __virt_addr_valid+0x1db/0x2d0 [ 12.313414] ? kmalloc_double_kzfree+0x19c/0x350 [ 12.313450] ? kasan_complete_mode_report_info+0x64/0x200 [ 12.313472] ? kmalloc_double_kzfree+0x19c/0x350 [ 12.313493] kasan_report+0x141/0x180 [ 12.313515] ? kmalloc_double_kzfree+0x19c/0x350 [ 12.313539] ? kmalloc_double_kzfree+0x19c/0x350 [ 12.313561] __kasan_check_byte+0x3d/0x50 [ 12.313582] kfree_sensitive+0x22/0x90 [ 12.313605] kmalloc_double_kzfree+0x19c/0x350 [ 12.313626] ? __pfx_kmalloc_double_kzfree+0x10/0x10 [ 12.313651] ? __pfx_kmalloc_double_kzfree+0x10/0x10 [ 12.313676] kunit_try_run_case+0x1a5/0x480 [ 12.313702] ? __pfx_kunit_try_run_case+0x10/0x10 [ 12.313740] ? _raw_spin_lock_irqsave+0xa1/0x100 [ 12.313764] ? _raw_spin_unlock_irqrestore+0x5f/0x90 [ 12.313800] ? __kthread_parkme+0x82/0x180 [ 12.313821] ? preempt_count_sub+0x50/0x80 [ 12.313854] ? __pfx_kunit_try_run_case+0x10/0x10 [ 12.313876] kunit_generic_run_threadfn_adapter+0x85/0xf0 [ 12.313897] ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10 [ 12.313930] kthread+0x337/0x6f0 [ 12.313950] ? trace_preempt_on+0x20/0xc0 [ 12.313973] ? __pfx_kthread+0x10/0x10 [ 12.313992] ? _raw_spin_unlock_irq+0x47/0x80 [ 12.314012] ? calculate_sigpending+0x7b/0xa0 [ 12.314036] ? __pfx_kthread+0x10/0x10 [ 12.314056] ret_from_fork+0x116/0x1d0 [ 12.314074] ? __pfx_kthread+0x10/0x10 [ 12.314094] ret_from_fork_asm+0x1a/0x30 [ 12.314126] </TASK> [ 12.314137] [ 12.323938] Allocated by task 209: [ 12.324157] kasan_save_stack+0x45/0x70 [ 12.325021] kasan_save_track+0x18/0x40 [ 12.325185] kasan_save_alloc_info+0x3b/0x50 [ 12.325350] __kasan_kmalloc+0xb7/0xc0 [ 12.325905] __kmalloc_cache_noprof+0x189/0x420 [ 12.326123] kmalloc_double_kzfree+0xa9/0x350 [ 12.326622] kunit_try_run_case+0x1a5/0x480 [ 12.326829] kunit_generic_run_threadfn_adapter+0x85/0xf0 [ 12.327065] kthread+0x337/0x6f0 [ 12.327942] ret_from_fork+0x116/0x1d0 [ 12.328261] ret_from_fork_asm+0x1a/0x30 [ 12.328745] [ 12.329095] Freed by task 209: [ 12.329355] kasan_save_stack+0x45/0x70 [ 12.329552] kasan_save_track+0x18/0x40 [ 12.329730] kasan_save_free_info+0x3f/0x60 [ 12.329922] __kasan_slab_free+0x56/0x70 [ 12.330103] kfree+0x222/0x3f0 [ 12.330727] kfree_sensitive+0x67/0x90 [ 12.330896] kmalloc_double_kzfree+0x12b/0x350 [ 12.331098] kunit_try_run_case+0x1a5/0x480 [ 12.331367] kunit_generic_run_threadfn_adapter+0x85/0xf0 [ 12.331603] kthread+0x337/0x6f0 [ 12.331759] ret_from_fork+0x116/0x1d0 [ 12.331933] ret_from_fork_asm+0x1a/0x30 [ 12.332120] [ 12.333070] The buggy address belongs to the object at ffff88810298e100 [ 12.333070] which belongs to the cache kmalloc-16 of size 16 [ 12.333947] The buggy address is located 0 bytes inside of [ 12.333947] freed 16-byte region [ffff88810298e100, ffff88810298e110) [ 12.335122] [ 12.335413] The buggy address belongs to the physical page: [ 12.335905] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x10298e [ 12.336714] flags: 0x200000000000000(node=0|zone=2) [ 12.337147] page_type: f5(slab) [ 12.337726] raw: 0200000000000000 ffff888100041640 dead000000000122 0000000000000000 [ 12.338052] raw: 0000000000000000 0000000080800080 00000000f5000000 0000000000000000 [ 12.338827] page dumped because: kasan: bad access detected [ 12.339092] [ 12.339186] Memory state around the buggy address: [ 12.339670] ffff88810298e000: 00 01 fc fc 00 01 fc fc 00 04 fc fc 00 04 fc fc [ 12.339975] ffff88810298e080: fa fb fc fc fa fb fc fc fa fb fc fc fa fb fc fc [ 12.340561] >ffff88810298e100: fa fb fc fc fc fc fc fc fc fc fc fc fc fc fc fc [ 12.341195] ^ [ 12.341545] ffff88810298e180: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc [ 12.342034] ffff88810298e200: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc [ 12.342930] ==================================================================