Date
May 29, 2025, 7:10 a.m.
Environment | |
---|---|
qemu-arm64 | |
qemu-x86_64 |
[ 24.715853] ================================================================== [ 24.716181] BUG: KASAN: slab-use-after-free in strnlen+0x80/0x88 [ 24.716380] Read of size 1 at addr fff00000c7876250 by task kunit_try_catch/259 [ 24.716513] [ 24.716608] CPU: 1 UID: 0 PID: 259 Comm: kunit_try_catch Tainted: G B N 6.15.0-next-20250529 #1 PREEMPT [ 24.716832] Tainted: [B]=BAD_PAGE, [N]=TEST [ 24.716904] Hardware name: linux,dummy-virt (DT) [ 24.716988] Call trace: [ 24.717055] show_stack+0x20/0x38 (C) [ 24.718969] dump_stack_lvl+0x8c/0xd0 [ 24.719380] print_report+0x118/0x608 [ 24.719525] kasan_report+0xdc/0x128 [ 24.719862] __asan_report_load1_noabort+0x20/0x30 [ 24.720120] strnlen+0x80/0x88 [ 24.720248] kasan_strings+0x478/0xb00 [ 24.720367] kunit_try_run_case+0x170/0x3f0 [ 24.720648] kunit_generic_run_threadfn_adapter+0x88/0x100 [ 24.721268] kthread+0x328/0x630 [ 24.721880] ret_from_fork+0x10/0x20 [ 24.722576] [ 24.723012] Allocated by task 259: [ 24.723098] kasan_save_stack+0x3c/0x68 [ 24.723224] kasan_save_track+0x20/0x40 [ 24.723317] kasan_save_alloc_info+0x40/0x58 [ 24.723680] __kasan_kmalloc+0xd4/0xd8 [ 24.724570] __kmalloc_cache_noprof+0x15c/0x3c0 [ 24.724736] kasan_strings+0xc8/0xb00 [ 24.724843] kunit_try_run_case+0x170/0x3f0 [ 24.724963] kunit_generic_run_threadfn_adapter+0x88/0x100 [ 24.725077] kthread+0x328/0x630 [ 24.725167] ret_from_fork+0x10/0x20 [ 24.725260] [ 24.725980] Freed by task 259: [ 24.726071] kasan_save_stack+0x3c/0x68 [ 24.726602] kasan_save_track+0x20/0x40 [ 24.726773] kasan_save_free_info+0x4c/0x78 [ 24.726896] __kasan_slab_free+0x6c/0x98 [ 24.727009] kfree+0x214/0x3c8 [ 24.727102] kasan_strings+0x24c/0xb00 [ 24.727226] kunit_try_run_case+0x170/0x3f0 [ 24.727336] kunit_generic_run_threadfn_adapter+0x88/0x100 [ 24.727534] kthread+0x328/0x630 [ 24.727695] ret_from_fork+0x10/0x20 [ 24.728012] [ 24.728135] The buggy address belongs to the object at fff00000c7876240 [ 24.728135] which belongs to the cache kmalloc-32 of size 32 [ 24.728489] The buggy address is located 16 bytes inside of [ 24.728489] freed 32-byte region [fff00000c7876240, fff00000c7876260) [ 24.728756] [ 24.728911] The buggy address belongs to the physical page: [ 24.728996] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x107876 [ 24.729160] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff) [ 24.729674] page_type: f5(slab) [ 24.729809] raw: 0bfffe0000000000 fff00000c0001780 dead000000000122 0000000000000000 [ 24.729998] raw: 0000000000000000 0000000080400040 00000000f5000000 0000000000000000 [ 24.730318] page dumped because: kasan: bad access detected [ 24.730469] [ 24.730523] Memory state around the buggy address: [ 24.730575] fff00000c7876100: fa fb fb fb fc fc fc fc 00 00 00 fc fc fc fc fc [ 24.730633] fff00000c7876180: 00 00 00 fc fc fc fc fc 00 00 07 fc fc fc fc fc [ 24.730683] >fff00000c7876200: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc [ 24.730728] ^ [ 24.730773] fff00000c7876280: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc [ 24.730835] fff00000c7876300: 00 00 00 fc fc fc fc fc fa fb fb fb fc fc fc fc [ 24.730884] ==================================================================
[ 12.856423] ================================================================== [ 12.856808] BUG: KASAN: slab-use-after-free in strnlen+0x73/0x80 [ 12.857155] Read of size 1 at addr ffff888102fab010 by task kunit_try_catch/276 [ 12.857416] [ 12.857528] CPU: 0 UID: 0 PID: 276 Comm: kunit_try_catch Tainted: G B N 6.15.0-next-20250529 #1 PREEMPT(voluntary) [ 12.857574] Tainted: [B]=BAD_PAGE, [N]=TEST [ 12.857587] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014 [ 12.857620] Call Trace: [ 12.857635] <TASK> [ 12.857650] dump_stack_lvl+0x73/0xb0 [ 12.857674] print_report+0xd1/0x650 [ 12.857697] ? __virt_addr_valid+0x1db/0x2d0 [ 12.857720] ? strnlen+0x73/0x80 [ 12.857739] ? kasan_complete_mode_report_info+0x64/0x200 [ 12.857762] ? strnlen+0x73/0x80 [ 12.857843] kasan_report+0x141/0x180 [ 12.857867] ? strnlen+0x73/0x80 [ 12.857891] __asan_report_load1_noabort+0x18/0x20 [ 12.857912] strnlen+0x73/0x80 [ 12.857933] kasan_strings+0x615/0xe80 [ 12.857953] ? trace_hardirqs_on+0x37/0xe0 [ 12.857975] ? __pfx_kasan_strings+0x10/0x10 [ 12.857996] ? finish_task_switch.isra.0+0x153/0x700 [ 12.858018] ? __switch_to+0x47/0xf50 [ 12.858043] ? __schedule+0x10cc/0x2b60 [ 12.858066] ? __pfx_read_tsc+0x10/0x10 [ 12.858086] ? ktime_get_ts64+0x86/0x230 [ 12.858111] kunit_try_run_case+0x1a5/0x480 [ 12.858131] ? __pfx_kunit_try_run_case+0x10/0x10 [ 12.858151] ? _raw_spin_lock_irqsave+0xa1/0x100 [ 12.858175] ? _raw_spin_unlock_irqrestore+0x5f/0x90 [ 12.858200] ? __kthread_parkme+0x82/0x180 [ 12.858219] ? preempt_count_sub+0x50/0x80 [ 12.858242] ? __pfx_kunit_try_run_case+0x10/0x10 [ 12.858263] kunit_generic_run_threadfn_adapter+0x85/0xf0 [ 12.858287] ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10 [ 12.858311] kthread+0x337/0x6f0 [ 12.858330] ? trace_preempt_on+0x20/0xc0 [ 12.858352] ? __pfx_kthread+0x10/0x10 [ 12.858373] ? _raw_spin_unlock_irq+0x47/0x80 [ 12.858395] ? calculate_sigpending+0x7b/0xa0 [ 12.858418] ? __pfx_kthread+0x10/0x10 [ 12.858439] ret_from_fork+0x116/0x1d0 [ 12.858458] ? __pfx_kthread+0x10/0x10 [ 12.858479] ret_from_fork_asm+0x1a/0x30 [ 12.858510] </TASK> [ 12.858520] [ 12.866520] Allocated by task 276: [ 12.866828] kasan_save_stack+0x45/0x70 [ 12.867015] kasan_save_track+0x18/0x40 [ 12.867158] kasan_save_alloc_info+0x3b/0x50 [ 12.867311] __kasan_kmalloc+0xb7/0xc0 [ 12.867449] __kmalloc_cache_noprof+0x189/0x420 [ 12.867623] kasan_strings+0xc0/0xe80 [ 12.867800] kunit_try_run_case+0x1a5/0x480 [ 12.868122] kunit_generic_run_threadfn_adapter+0x85/0xf0 [ 12.868376] kthread+0x337/0x6f0 [ 12.868543] ret_from_fork+0x116/0x1d0 [ 12.868730] ret_from_fork_asm+0x1a/0x30 [ 12.869043] [ 12.869143] Freed by task 276: [ 12.869277] kasan_save_stack+0x45/0x70 [ 12.869466] kasan_save_track+0x18/0x40 [ 12.869652] kasan_save_free_info+0x3f/0x60 [ 12.870009] __kasan_slab_free+0x56/0x70 [ 12.870187] kfree+0x222/0x3f0 [ 12.870309] kasan_strings+0x2aa/0xe80 [ 12.870451] kunit_try_run_case+0x1a5/0x480 [ 12.870620] kunit_generic_run_threadfn_adapter+0x85/0xf0 [ 12.870804] kthread+0x337/0x6f0 [ 12.870960] ret_from_fork+0x116/0x1d0 [ 12.871322] ret_from_fork_asm+0x1a/0x30 [ 12.871534] [ 12.871642] The buggy address belongs to the object at ffff888102fab000 [ 12.871642] which belongs to the cache kmalloc-32 of size 32 [ 12.872378] The buggy address is located 16 bytes inside of [ 12.872378] freed 32-byte region [ffff888102fab000, ffff888102fab020) [ 12.873023] [ 12.873102] The buggy address belongs to the physical page: [ 12.873282] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x102fab [ 12.873588] flags: 0x200000000000000(node=0|zone=2) [ 12.873977] page_type: f5(slab) [ 12.874152] raw: 0200000000000000 ffff888100041780 dead000000000122 0000000000000000 [ 12.874498] raw: 0000000000000000 0000000080400040 00000000f5000000 0000000000000000 [ 12.874989] page dumped because: kasan: bad access detected [ 12.875248] [ 12.875345] Memory state around the buggy address: [ 12.875537] ffff888102faaf00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc [ 12.875895] ffff888102faaf80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc [ 12.876182] >ffff888102fab000: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc [ 12.876466] ^ [ 12.876658] ffff888102fab080: fa fb fb fb fc fc fc fc 00 00 00 fc fc fc fc fc [ 12.876934] ffff888102fab100: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc [ 12.877158] ==================================================================