Date
July 11, 2025, 11:09 p.m.
Environment | |
---|---|
qemu-arm64 | |
qemu-x86_64 |
[ 16.917727] ================================================================== [ 16.917788] BUG: KASAN: slab-use-after-free in kmalloc_double_kzfree+0x168/0x308 [ 16.917866] Read of size 1 at addr fff00000c3f2f640 by task kunit_try_catch/193 [ 16.917916] [ 16.917954] CPU: 0 UID: 0 PID: 193 Comm: kunit_try_catch Tainted: G B N 6.16.0-rc5 #1 PREEMPT [ 16.918039] Tainted: [B]=BAD_PAGE, [N]=TEST [ 16.918066] Hardware name: linux,dummy-virt (DT) [ 16.918097] Call trace: [ 16.918120] show_stack+0x20/0x38 (C) [ 16.918171] dump_stack_lvl+0x8c/0xd0 [ 16.918218] print_report+0x118/0x608 [ 16.918264] kasan_report+0xdc/0x128 [ 16.918308] __kasan_check_byte+0x54/0x70 [ 16.918354] kfree_sensitive+0x30/0xb0 [ 16.918402] kmalloc_double_kzfree+0x168/0x308 [ 16.918447] kunit_try_run_case+0x170/0x3f0 [ 16.918494] kunit_generic_run_threadfn_adapter+0x88/0x100 [ 16.918547] kthread+0x328/0x630 [ 16.918587] ret_from_fork+0x10/0x20 [ 16.918638] [ 16.918656] Allocated by task 193: [ 16.918685] kasan_save_stack+0x3c/0x68 [ 16.918724] kasan_save_track+0x20/0x40 [ 16.918761] kasan_save_alloc_info+0x40/0x58 [ 16.918799] __kasan_kmalloc+0xd4/0xd8 [ 16.918836] __kmalloc_cache_noprof+0x16c/0x3c0 [ 16.921460] kmalloc_double_kzfree+0xb8/0x308 [ 16.921517] kunit_try_run_case+0x170/0x3f0 [ 16.921690] kunit_generic_run_threadfn_adapter+0x88/0x100 [ 16.921910] kthread+0x328/0x630 [ 16.922002] ret_from_fork+0x10/0x20 [ 16.922049] [ 16.922068] Freed by task 193: [ 16.922098] kasan_save_stack+0x3c/0x68 [ 16.922182] kasan_save_track+0x20/0x40 [ 16.922306] kasan_save_free_info+0x4c/0x78 [ 16.922502] __kasan_slab_free+0x6c/0x98 [ 16.922907] kfree+0x214/0x3c8 [ 16.923273] kfree_sensitive+0x80/0xb0 [ 16.923327] kmalloc_double_kzfree+0x11c/0x308 [ 16.923365] kunit_try_run_case+0x170/0x3f0 [ 16.923403] kunit_generic_run_threadfn_adapter+0x88/0x100 [ 16.923507] kthread+0x328/0x630 [ 16.923670] ret_from_fork+0x10/0x20 [ 16.923862] [ 16.924155] The buggy address belongs to the object at fff00000c3f2f640 [ 16.924155] which belongs to the cache kmalloc-16 of size 16 [ 16.924641] The buggy address is located 0 bytes inside of [ 16.924641] freed 16-byte region [fff00000c3f2f640, fff00000c3f2f650) [ 16.924704] [ 16.924726] The buggy address belongs to the physical page: [ 16.924759] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x103f2f [ 16.925143] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff) [ 16.925207] page_type: f5(slab) [ 16.925433] raw: 0bfffe0000000000 fff00000c0001640 dead000000000122 0000000000000000 [ 16.926150] raw: 0000000000000000 0000000080800080 00000000f5000000 0000000000000000 [ 16.926888] page dumped because: kasan: bad access detected [ 16.927218] [ 16.927528] Memory state around the buggy address: [ 16.927594] fff00000c3f2f500: fa fb fc fc fa fb fc fc fa fb fc fc 00 04 fc fc [ 16.928088] fff00000c3f2f580: fa fb fc fc fa fb fc fc fa fb fc fc fa fb fc fc [ 16.928409] >fff00000c3f2f600: fa fb fc fc fa fb fc fc fa fb fc fc fc fc fc fc [ 16.928633] ^ [ 16.928867] fff00000c3f2f680: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc [ 16.929103] fff00000c3f2f700: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc [ 16.929145] ==================================================================
[ 12.672238] ================================================================== [ 12.673892] BUG: KASAN: slab-use-after-free in kmalloc_double_kzfree+0x19c/0x350 [ 12.674158] Read of size 1 at addr ffff888100a6e1a0 by task kunit_try_catch/209 [ 12.674381] [ 12.674480] CPU: 0 UID: 0 PID: 209 Comm: kunit_try_catch Tainted: G B N 6.16.0-rc5 #1 PREEMPT(voluntary) [ 12.674531] Tainted: [B]=BAD_PAGE, [N]=TEST [ 12.674543] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014 [ 12.674563] Call Trace: [ 12.674576] <TASK> [ 12.674593] dump_stack_lvl+0x73/0xb0 [ 12.674623] print_report+0xd1/0x650 [ 12.674644] ? __virt_addr_valid+0x1db/0x2d0 [ 12.674667] ? kmalloc_double_kzfree+0x19c/0x350 [ 12.674690] ? kasan_complete_mode_report_info+0x64/0x200 [ 12.674714] ? kmalloc_double_kzfree+0x19c/0x350 [ 12.674738] kasan_report+0x141/0x180 [ 12.674759] ? kmalloc_double_kzfree+0x19c/0x350 [ 12.674785] ? kmalloc_double_kzfree+0x19c/0x350 [ 12.674808] __kasan_check_byte+0x3d/0x50 [ 12.674830] kfree_sensitive+0x22/0x90 [ 12.674853] kmalloc_double_kzfree+0x19c/0x350 [ 12.674876] ? __pfx_kmalloc_double_kzfree+0x10/0x10 [ 12.674901] ? __schedule+0x10cc/0x2b60 [ 12.674939] ? __pfx_read_tsc+0x10/0x10 [ 12.674960] ? ktime_get_ts64+0x86/0x230 [ 12.674984] kunit_try_run_case+0x1a5/0x480 [ 12.675008] ? __pfx_kunit_try_run_case+0x10/0x10 [ 12.675032] ? _raw_spin_lock_irqsave+0xa1/0x100 [ 12.675187] ? _raw_spin_unlock_irqrestore+0x5f/0x90 [ 12.675341] ? __kthread_parkme+0x82/0x180 [ 12.675364] ? preempt_count_sub+0x50/0x80 [ 12.675388] ? __pfx_kunit_try_run_case+0x10/0x10 [ 12.675413] kunit_generic_run_threadfn_adapter+0x85/0xf0 [ 12.675438] ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10 [ 12.675462] kthread+0x337/0x6f0 [ 12.675481] ? trace_preempt_on+0x20/0xc0 [ 12.675505] ? __pfx_kthread+0x10/0x10 [ 12.675526] ? _raw_spin_unlock_irq+0x47/0x80 [ 12.675547] ? calculate_sigpending+0x7b/0xa0 [ 12.675571] ? __pfx_kthread+0x10/0x10 [ 12.675592] ret_from_fork+0x116/0x1d0 [ 12.675610] ? __pfx_kthread+0x10/0x10 [ 12.675630] ret_from_fork_asm+0x1a/0x30 [ 12.675661] </TASK> [ 12.675672] [ 12.692160] Allocated by task 209: [ 12.692514] kasan_save_stack+0x45/0x70 [ 12.692788] kasan_save_track+0x18/0x40 [ 12.692936] kasan_save_alloc_info+0x3b/0x50 [ 12.693242] __kasan_kmalloc+0xb7/0xc0 [ 12.693703] __kmalloc_cache_noprof+0x189/0x420 [ 12.694172] kmalloc_double_kzfree+0xa9/0x350 [ 12.694617] kunit_try_run_case+0x1a5/0x480 [ 12.695090] kunit_generic_run_threadfn_adapter+0x85/0xf0 [ 12.695604] kthread+0x337/0x6f0 [ 12.695724] ret_from_fork+0x116/0x1d0 [ 12.696095] ret_from_fork_asm+0x1a/0x30 [ 12.696531] [ 12.696712] Freed by task 209: [ 12.697073] kasan_save_stack+0x45/0x70 [ 12.697476] kasan_save_track+0x18/0x40 [ 12.697648] kasan_save_free_info+0x3f/0x60 [ 12.698142] __kasan_slab_free+0x56/0x70 [ 12.698482] kfree+0x222/0x3f0 [ 12.698772] kfree_sensitive+0x67/0x90 [ 12.699160] kmalloc_double_kzfree+0x12b/0x350 [ 12.699684] kunit_try_run_case+0x1a5/0x480 [ 12.700026] kunit_generic_run_threadfn_adapter+0x85/0xf0 [ 12.700561] kthread+0x337/0x6f0 [ 12.700821] ret_from_fork+0x116/0x1d0 [ 12.701216] ret_from_fork_asm+0x1a/0x30 [ 12.701357] [ 12.701427] The buggy address belongs to the object at ffff888100a6e1a0 [ 12.701427] which belongs to the cache kmalloc-16 of size 16 [ 12.701801] The buggy address is located 0 bytes inside of [ 12.701801] freed 16-byte region [ffff888100a6e1a0, ffff888100a6e1b0) [ 12.702951] [ 12.703133] The buggy address belongs to the physical page: [ 12.703632] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x100a6e [ 12.704467] flags: 0x200000000000000(node=0|zone=2) [ 12.704952] page_type: f5(slab) [ 12.705305] raw: 0200000000000000 ffff888100041640 dead000000000122 0000000000000000 [ 12.706048] raw: 0000000000000000 0000000080800080 00000000f5000000 0000000000000000 [ 12.706712] page dumped because: kasan: bad access detected [ 12.706937] [ 12.707005] Memory state around the buggy address: [ 12.707409] ffff888100a6e080: fa fb fc fc fa fb fc fc fa fb fc fc fa fb fc fc [ 12.708095] ffff888100a6e100: 00 05 fc fc fa fb fc fc fa fb fc fc fa fb fc fc [ 12.708709] >ffff888100a6e180: fa fb fc fc fa fb fc fc fc fc fc fc fc fc fc fc [ 12.709415] ^ [ 12.709563] ffff888100a6e200: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc [ 12.709818] ffff888100a6e280: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc [ 12.710559] ==================================================================