Date
July 9, 2025, 2:07 p.m.
Environment | |
---|---|
qemu-arm64 | |
qemu-x86_64 |
[ 19.501346] ================================================================== [ 19.501408] BUG: KASAN: slab-use-after-free in strnlen+0x80/0x88 [ 19.501464] Read of size 1 at addr fff00000c7753290 by task kunit_try_catch/259 [ 19.501519] [ 19.501551] CPU: 1 UID: 0 PID: 259 Comm: kunit_try_catch Tainted: G B W N 6.16.0-rc5 #1 PREEMPT [ 19.501890] Tainted: [B]=BAD_PAGE, [W]=WARN, [N]=TEST [ 19.501969] Hardware name: linux,dummy-virt (DT) [ 19.502295] Call trace: [ 19.504150] show_stack+0x20/0x38 (C) [ 19.504388] dump_stack_lvl+0x8c/0xd0 [ 19.505115] print_report+0x118/0x608 [ 19.505192] kasan_report+0xdc/0x128 [ 19.505242] __asan_report_load1_noabort+0x20/0x30 [ 19.505764] strnlen+0x80/0x88 [ 19.505966] kasan_strings+0x478/0xb00 [ 19.506019] kunit_try_run_case+0x170/0x3f0 [ 19.506658] kunit_generic_run_threadfn_adapter+0x88/0x100 [ 19.506955] kthread+0x328/0x630 [ 19.507291] ret_from_fork+0x10/0x20 [ 19.507535] [ 19.508152] Allocated by task 259: [ 19.508438] kasan_save_stack+0x3c/0x68 [ 19.509188] kasan_save_track+0x20/0x40 [ 19.509262] kasan_save_alloc_info+0x40/0x58 [ 19.509308] __kasan_kmalloc+0xd4/0xd8 [ 19.509665] __kmalloc_cache_noprof+0x16c/0x3c0 [ 19.509789] kasan_strings+0xc8/0xb00 [ 19.509848] kunit_try_run_case+0x170/0x3f0 [ 19.509933] kunit_generic_run_threadfn_adapter+0x88/0x100 [ 19.510017] kthread+0x328/0x630 [ 19.510056] ret_from_fork+0x10/0x20 [ 19.510120] [ 19.510144] Freed by task 259: [ 19.510174] kasan_save_stack+0x3c/0x68 [ 19.510510] kasan_save_track+0x20/0x40 [ 19.510559] kasan_save_free_info+0x4c/0x78 [ 19.510602] __kasan_slab_free+0x6c/0x98 [ 19.510641] kfree+0x214/0x3c8 [ 19.510676] kasan_strings+0x24c/0xb00 [ 19.510714] kunit_try_run_case+0x170/0x3f0 [ 19.510755] kunit_generic_run_threadfn_adapter+0x88/0x100 [ 19.510800] kthread+0x328/0x630 [ 19.510835] ret_from_fork+0x10/0x20 [ 19.510873] [ 19.510893] The buggy address belongs to the object at fff00000c7753280 [ 19.510893] which belongs to the cache kmalloc-32 of size 32 [ 19.510959] The buggy address is located 16 bytes inside of [ 19.510959] freed 32-byte region [fff00000c7753280, fff00000c77532a0) [ 19.511026] [ 19.511049] The buggy address belongs to the physical page: [ 19.511099] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x107753 [ 19.511181] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff) [ 19.511269] page_type: f5(slab) [ 19.511368] raw: 0bfffe0000000000 fff00000c0001780 dead000000000122 0000000000000000 [ 19.511463] raw: 0000000000000000 0000000080400040 00000000f5000000 0000000000000000 [ 19.511649] page dumped because: kasan: bad access detected [ 19.511685] [ 19.511876] Memory state around the buggy address: [ 19.511975] fff00000c7753180: 00 00 00 fc fc fc fc fc 00 00 00 fc fc fc fc fc [ 19.512057] fff00000c7753200: 00 00 07 fc fc fc fc fc 00 00 00 fc fc fc fc fc [ 19.512155] >fff00000c7753280: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc [ 19.512222] ^ [ 19.512309] fff00000c7753300: fa fb fb fb fc fc fc fc 00 00 00 fc fc fc fc fc [ 19.512437] fff00000c7753380: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc [ 19.512491] ==================================================================
[ 14.720646] ================================================================== [ 14.721227] BUG: KASAN: slab-use-after-free in strnlen+0x73/0x80 [ 14.721500] Read of size 1 at addr ffff8881029cc7d0 by task kunit_try_catch/276 [ 14.721901] [ 14.722038] CPU: 0 UID: 0 PID: 276 Comm: kunit_try_catch Tainted: G B N 6.16.0-rc5 #1 PREEMPT(voluntary) [ 14.722084] Tainted: [B]=BAD_PAGE, [N]=TEST [ 14.722097] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014 [ 14.722119] Call Trace: [ 14.722136] <TASK> [ 14.722153] dump_stack_lvl+0x73/0xb0 [ 14.722181] print_report+0xd1/0x650 [ 14.722202] ? __virt_addr_valid+0x1db/0x2d0 [ 14.722226] ? strnlen+0x73/0x80 [ 14.722243] ? kasan_complete_mode_report_info+0x64/0x200 [ 14.722267] ? strnlen+0x73/0x80 [ 14.722284] kasan_report+0x141/0x180 [ 14.722306] ? strnlen+0x73/0x80 [ 14.722327] __asan_report_load1_noabort+0x18/0x20 [ 14.722352] strnlen+0x73/0x80 [ 14.722369] kasan_strings+0x615/0xe80 [ 14.722389] ? trace_hardirqs_on+0x37/0xe0 [ 14.722424] ? __pfx_kasan_strings+0x10/0x10 [ 14.722444] ? finish_task_switch.isra.0+0x153/0x700 [ 14.722468] ? __switch_to+0x47/0xf50 [ 14.722504] ? __schedule+0x10cc/0x2b60 [ 14.722525] ? __pfx_read_tsc+0x10/0x10 [ 14.722546] ? ktime_get_ts64+0x86/0x230 [ 14.722570] kunit_try_run_case+0x1a5/0x480 [ 14.722603] ? __pfx_kunit_try_run_case+0x10/0x10 [ 14.722626] ? _raw_spin_lock_irqsave+0xa1/0x100 [ 14.722650] ? _raw_spin_unlock_irqrestore+0x5f/0x90 [ 14.722674] ? __kthread_parkme+0x82/0x180 [ 14.722695] ? preempt_count_sub+0x50/0x80 [ 14.722718] ? __pfx_kunit_try_run_case+0x10/0x10 [ 14.722741] kunit_generic_run_threadfn_adapter+0x85/0xf0 [ 14.722785] ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10 [ 14.722811] kthread+0x337/0x6f0 [ 14.722832] ? trace_preempt_on+0x20/0xc0 [ 14.722855] ? __pfx_kthread+0x10/0x10 [ 14.722876] ? _raw_spin_unlock_irq+0x47/0x80 [ 14.722898] ? calculate_sigpending+0x7b/0xa0 [ 14.722922] ? __pfx_kthread+0x10/0x10 [ 14.722943] ret_from_fork+0x116/0x1d0 [ 14.722971] ? __pfx_kthread+0x10/0x10 [ 14.722992] ret_from_fork_asm+0x1a/0x30 [ 14.723023] </TASK> [ 14.723043] [ 14.730399] Allocated by task 276: [ 14.730585] kasan_save_stack+0x45/0x70 [ 14.730740] kasan_save_track+0x18/0x40 [ 14.730898] kasan_save_alloc_info+0x3b/0x50 [ 14.731047] __kasan_kmalloc+0xb7/0xc0 [ 14.731225] __kmalloc_cache_noprof+0x189/0x420 [ 14.731458] kasan_strings+0xc0/0xe80 [ 14.731650] kunit_try_run_case+0x1a5/0x480 [ 14.731882] kunit_generic_run_threadfn_adapter+0x85/0xf0 [ 14.732135] kthread+0x337/0x6f0 [ 14.732307] ret_from_fork+0x116/0x1d0 [ 14.732492] ret_from_fork_asm+0x1a/0x30 [ 14.732657] [ 14.732751] Freed by task 276: [ 14.732935] kasan_save_stack+0x45/0x70 [ 14.733105] kasan_save_track+0x18/0x40 [ 14.733306] kasan_save_free_info+0x3f/0x60 [ 14.733453] __kasan_slab_free+0x56/0x70 [ 14.733628] kfree+0x222/0x3f0 [ 14.733830] kasan_strings+0x2aa/0xe80 [ 14.734033] kunit_try_run_case+0x1a5/0x480 [ 14.734209] kunit_generic_run_threadfn_adapter+0x85/0xf0 [ 14.734467] kthread+0x337/0x6f0 [ 14.734630] ret_from_fork+0x116/0x1d0 [ 14.734866] ret_from_fork_asm+0x1a/0x30 [ 14.735039] [ 14.735144] The buggy address belongs to the object at ffff8881029cc7c0 [ 14.735144] which belongs to the cache kmalloc-32 of size 32 [ 14.735636] The buggy address is located 16 bytes inside of [ 14.735636] freed 32-byte region [ffff8881029cc7c0, ffff8881029cc7e0) [ 14.736154] [ 14.736244] The buggy address belongs to the physical page: [ 14.736495] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1029cc [ 14.736785] flags: 0x200000000000000(node=0|zone=2) [ 14.736951] page_type: f5(slab) [ 14.737068] raw: 0200000000000000 ffff888100041780 dead000000000122 0000000000000000 [ 14.737298] raw: 0000000000000000 0000000080400040 00000000f5000000 0000000000000000 [ 14.737586] page dumped because: kasan: bad access detected [ 14.737877] [ 14.737969] Memory state around the buggy address: [ 14.738191] ffff8881029cc680: fa fb fb fb fc fc fc fc 00 00 00 fc fc fc fc fc [ 14.738509] ffff8881029cc700: 00 00 00 fc fc fc fc fc 00 00 07 fc fc fc fc fc [ 14.738879] >ffff8881029cc780: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc [ 14.739183] ^ [ 14.739361] ffff8881029cc800: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc [ 14.739583] ffff8881029cc880: 00 00 00 fc fc fc fc fc fa fb fb fb fc fc fc fc [ 14.740785] ==================================================================