Date
June 25, 2025, 8:08 a.m.
Environment | |
---|---|
qemu-x86_64 |
[ 23.810074] ================================================================== [ 23.811040] BUG: KASAN: slab-use-after-free in strnlen+0x73/0x80 [ 23.811274] Read of size 1 at addr ffff888102596f90 by task kunit_try_catch/288 [ 23.811580] [ 23.811664] CPU: 0 UID: 0 PID: 288 Comm: kunit_try_catch Tainted: G B N 6.16.0-rc3-next-20250625 #1 PREEMPT(voluntary) [ 23.811713] Tainted: [B]=BAD_PAGE, [N]=TEST [ 23.811726] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014 [ 23.811748] Call Trace: [ 23.811767] <TASK> [ 23.811786] dump_stack_lvl+0x73/0xb0 [ 23.811810] print_report+0xd1/0x650 [ 23.811831] ? __virt_addr_valid+0x1db/0x2d0 [ 23.811854] ? strnlen+0x73/0x80 [ 23.811873] ? kasan_complete_mode_report_info+0x64/0x200 [ 23.811897] ? strnlen+0x73/0x80 [ 23.811917] kasan_report+0x141/0x180 [ 23.811952] ? strnlen+0x73/0x80 [ 23.812015] __asan_report_load1_noabort+0x18/0x20 [ 23.812041] strnlen+0x73/0x80 [ 23.812061] kasan_strings+0x615/0xe80 [ 23.812080] ? trace_hardirqs_on+0x37/0xe0 [ 23.812102] ? __pfx_kasan_strings+0x10/0x10 [ 23.812121] ? finish_task_switch.isra.0+0x153/0x700 [ 23.812143] ? __switch_to+0x47/0xf50 [ 23.812167] ? __schedule+0x10cc/0x2b60 [ 23.812192] ? __pfx_read_tsc+0x10/0x10 [ 23.812245] ? ktime_get_ts64+0x86/0x230 [ 23.812269] kunit_try_run_case+0x1a5/0x480 [ 23.812295] ? __pfx_kunit_try_run_case+0x10/0x10 [ 23.812317] ? _raw_spin_lock_irqsave+0xa1/0x100 [ 23.812344] ? _raw_spin_unlock_irqrestore+0x5f/0x90 [ 23.812369] ? __kthread_parkme+0x82/0x180 [ 23.812390] ? preempt_count_sub+0x50/0x80 [ 23.812411] ? __pfx_kunit_try_run_case+0x10/0x10 [ 23.812435] kunit_generic_run_threadfn_adapter+0x85/0xf0 [ 23.812467] ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10 [ 23.812490] kthread+0x337/0x6f0 [ 23.812508] ? trace_preempt_on+0x20/0xc0 [ 23.812529] ? __pfx_kthread+0x10/0x10 [ 23.812548] ? _raw_spin_unlock_irq+0x47/0x80 [ 23.812570] ? calculate_sigpending+0x7b/0xa0 [ 23.812592] ? __pfx_kthread+0x10/0x10 [ 23.812613] ret_from_fork+0x116/0x1d0 [ 23.812630] ? __pfx_kthread+0x10/0x10 [ 23.812649] ret_from_fork_asm+0x1a/0x30 [ 23.812678] </TASK> [ 23.812688] [ 23.820497] Allocated by task 288: [ 23.820639] kasan_save_stack+0x45/0x70 [ 23.820883] kasan_save_track+0x18/0x40 [ 23.821080] kasan_save_alloc_info+0x3b/0x50 [ 23.821302] __kasan_kmalloc+0xb7/0xc0 [ 23.821476] __kmalloc_cache_noprof+0x189/0x420 [ 23.821622] kasan_strings+0xc0/0xe80 [ 23.821744] kunit_try_run_case+0x1a5/0x480 [ 23.821887] kunit_generic_run_threadfn_adapter+0x85/0xf0 [ 23.822137] kthread+0x337/0x6f0 [ 23.822302] ret_from_fork+0x116/0x1d0 [ 23.822485] ret_from_fork_asm+0x1a/0x30 [ 23.822765] [ 23.822900] Freed by task 288: [ 23.823065] kasan_save_stack+0x45/0x70 [ 23.823266] kasan_save_track+0x18/0x40 [ 23.823688] kasan_save_free_info+0x3f/0x60 [ 23.823916] __kasan_slab_free+0x56/0x70 [ 23.824075] kfree+0x222/0x3f0 [ 23.824224] kasan_strings+0x2aa/0xe80 [ 23.824433] kunit_try_run_case+0x1a5/0x480 [ 23.824615] kunit_generic_run_threadfn_adapter+0x85/0xf0 [ 23.824836] kthread+0x337/0x6f0 [ 23.824996] ret_from_fork+0x116/0x1d0 [ 23.825120] ret_from_fork_asm+0x1a/0x30 [ 23.825250] [ 23.825313] The buggy address belongs to the object at ffff888102596f80 [ 23.825313] which belongs to the cache kmalloc-32 of size 32 [ 23.825776] The buggy address is located 16 bytes inside of [ 23.825776] freed 32-byte region [ffff888102596f80, ffff888102596fa0) [ 23.826227] [ 23.826293] The buggy address belongs to the physical page: [ 23.826456] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x102596 [ 23.826902] flags: 0x200000000000000(node=0|zone=2) [ 23.827258] page_type: f5(slab) [ 23.827422] raw: 0200000000000000 ffff888100041780 dead000000000122 0000000000000000 [ 23.827751] raw: 0000000000000000 0000000000400040 00000000f5000000 0000000000000000 [ 23.828108] page dumped because: kasan: bad access detected [ 23.828275] [ 23.828340] Memory state around the buggy address: [ 23.828489] ffff888102596e80: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc [ 23.828990] ffff888102596f00: 00 00 00 fc fc fc fc fc 00 00 07 fc fc fc fc fc [ 23.829307] >ffff888102596f80: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc [ 23.829621] ^ [ 23.829956] ffff888102597000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 23.830252] ffff888102597080: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc [ 23.830764] ==================================================================