Date
July 1, 2025, 11:08 a.m.
Environment | |
---|---|
qemu-arm64 | |
qemu-x86_64 |
[ 21.101464] ================================================================== [ 21.101914] BUG: KASAN: slab-use-after-free in strnlen+0x80/0x88 [ 21.102373] Read of size 1 at addr fff00000c76d9210 by task kunit_try_catch/260 [ 21.102819] [ 21.102876] CPU: 0 UID: 0 PID: 260 Comm: kunit_try_catch Tainted: G B N 6.16.0-rc4 #1 PREEMPT [ 21.103013] Tainted: [B]=BAD_PAGE, [N]=TEST [ 21.103150] Hardware name: linux,dummy-virt (DT) [ 21.103192] Call trace: [ 21.103220] show_stack+0x20/0x38 (C) [ 21.103437] dump_stack_lvl+0x8c/0xd0 [ 21.103567] print_report+0x118/0x608 [ 21.103694] kasan_report+0xdc/0x128 [ 21.103777] __asan_report_load1_noabort+0x20/0x30 [ 21.103834] strnlen+0x80/0x88 [ 21.103882] kasan_strings+0x478/0xb00 [ 21.104397] kunit_try_run_case+0x170/0x3f0 [ 21.104471] kunit_generic_run_threadfn_adapter+0x88/0x100 [ 21.104689] kthread+0x328/0x630 [ 21.104987] ret_from_fork+0x10/0x20 [ 21.105111] [ 21.105279] Allocated by task 260: [ 21.105432] kasan_save_stack+0x3c/0x68 [ 21.105670] kasan_save_track+0x20/0x40 [ 21.105966] kasan_save_alloc_info+0x40/0x58 [ 21.106052] __kasan_kmalloc+0xd4/0xd8 [ 21.106265] __kmalloc_cache_noprof+0x16c/0x3c0 [ 21.106475] kasan_strings+0xc8/0xb00 [ 21.106665] kunit_try_run_case+0x170/0x3f0 [ 21.106811] kunit_generic_run_threadfn_adapter+0x88/0x100 [ 21.106902] kthread+0x328/0x630 [ 21.107113] ret_from_fork+0x10/0x20 [ 21.107356] [ 21.107544] Freed by task 260: [ 21.107687] kasan_save_stack+0x3c/0x68 [ 21.107820] kasan_save_track+0x20/0x40 [ 21.107916] kasan_save_free_info+0x4c/0x78 [ 21.108246] __kasan_slab_free+0x6c/0x98 [ 21.108510] kfree+0x214/0x3c8 [ 21.108627] kasan_strings+0x24c/0xb00 [ 21.108820] kunit_try_run_case+0x170/0x3f0 [ 21.108962] kunit_generic_run_threadfn_adapter+0x88/0x100 [ 21.109077] kthread+0x328/0x630 [ 21.109124] ret_from_fork+0x10/0x20 [ 21.109181] [ 21.109207] The buggy address belongs to the object at fff00000c76d9200 [ 21.109207] which belongs to the cache kmalloc-32 of size 32 [ 21.109279] The buggy address is located 16 bytes inside of [ 21.109279] freed 32-byte region [fff00000c76d9200, fff00000c76d9220) [ 21.109562] [ 21.109979] The buggy address belongs to the physical page: [ 21.110061] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1076d9 [ 21.110250] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff) [ 21.110692] page_type: f5(slab) [ 21.110887] raw: 0bfffe0000000000 fff00000c0001780 dead000000000122 0000000000000000 [ 21.111047] raw: 0000000000000000 0000000080400040 00000000f5000000 0000000000000000 [ 21.111207] page dumped because: kasan: bad access detected [ 21.111338] [ 21.111499] Memory state around the buggy address: [ 21.111577] fff00000c76d9100: 00 00 00 fc fc fc fc fc 00 00 00 04 fc fc fc fc [ 21.111645] fff00000c76d9180: 00 00 07 fc fc fc fc fc 00 00 00 fc fc fc fc fc [ 21.111885] >fff00000c76d9200: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc [ 21.112242] ^ [ 21.112419] fff00000c76d9280: fa fb fb fb fc fc fc fc 00 00 00 fc fc fc fc fc [ 21.112557] fff00000c76d9300: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc [ 21.112656] ==================================================================
[ 13.489995] ================================================================== [ 13.490356] BUG: KASAN: slab-use-after-free in strnlen+0x73/0x80 [ 13.491018] Read of size 1 at addr ffff888103aaf390 by task kunit_try_catch/276 [ 13.491316] [ 13.491419] CPU: 1 UID: 0 PID: 276 Comm: kunit_try_catch Tainted: G B N 6.16.0-rc4 #1 PREEMPT(voluntary) [ 13.491464] Tainted: [B]=BAD_PAGE, [N]=TEST [ 13.491475] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014 [ 13.491496] Call Trace: [ 13.491515] <TASK> [ 13.491533] dump_stack_lvl+0x73/0xb0 [ 13.491559] print_report+0xd1/0x650 [ 13.491582] ? __virt_addr_valid+0x1db/0x2d0 [ 13.491605] ? strnlen+0x73/0x80 [ 13.491623] ? kasan_complete_mode_report_info+0x64/0x200 [ 13.491644] ? strnlen+0x73/0x80 [ 13.491662] kasan_report+0x141/0x180 [ 13.491683] ? strnlen+0x73/0x80 [ 13.491704] __asan_report_load1_noabort+0x18/0x20 [ 13.491728] strnlen+0x73/0x80 [ 13.491746] kasan_strings+0x615/0xe80 [ 13.491766] ? trace_hardirqs_on+0x37/0xe0 [ 13.491790] ? __pfx_kasan_strings+0x10/0x10 [ 13.491809] ? finish_task_switch.isra.0+0x153/0x700 [ 13.491831] ? __switch_to+0x47/0xf50 [ 13.491855] ? __schedule+0x10cc/0x2b60 [ 13.491877] ? __pfx_read_tsc+0x10/0x10 [ 13.491897] ? ktime_get_ts64+0x86/0x230 [ 13.491920] kunit_try_run_case+0x1a5/0x480 [ 13.491944] ? __pfx_kunit_try_run_case+0x10/0x10 [ 13.491966] ? _raw_spin_lock_irqsave+0xa1/0x100 [ 13.491989] ? _raw_spin_unlock_irqrestore+0x5f/0x90 [ 13.492011] ? __kthread_parkme+0x82/0x180 [ 13.492034] ? preempt_count_sub+0x50/0x80 [ 13.492058] ? __pfx_kunit_try_run_case+0x10/0x10 [ 13.492082] kunit_generic_run_threadfn_adapter+0x85/0xf0 [ 13.492104] ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10 [ 13.492127] kthread+0x337/0x6f0 [ 13.492145] ? trace_preempt_on+0x20/0xc0 [ 13.492166] ? __pfx_kthread+0x10/0x10 [ 13.492186] ? _raw_spin_unlock_irq+0x47/0x80 [ 13.492207] ? calculate_sigpending+0x7b/0xa0 [ 13.492230] ? __pfx_kthread+0x10/0x10 [ 13.492250] ret_from_fork+0x116/0x1d0 [ 13.492267] ? __pfx_kthread+0x10/0x10 [ 13.492287] ret_from_fork_asm+0x1a/0x30 [ 13.492316] </TASK> [ 13.492327] [ 13.499830] Allocated by task 276: [ 13.499957] kasan_save_stack+0x45/0x70 [ 13.500100] kasan_save_track+0x18/0x40 [ 13.500232] kasan_save_alloc_info+0x3b/0x50 [ 13.500385] __kasan_kmalloc+0xb7/0xc0 [ 13.500590] __kmalloc_cache_noprof+0x189/0x420 [ 13.500810] kasan_strings+0xc0/0xe80 [ 13.500987] kunit_try_run_case+0x1a5/0x480 [ 13.501188] kunit_generic_run_threadfn_adapter+0x85/0xf0 [ 13.501440] kthread+0x337/0x6f0 [ 13.501634] ret_from_fork+0x116/0x1d0 [ 13.501821] ret_from_fork_asm+0x1a/0x30 [ 13.502013] [ 13.502084] Freed by task 276: [ 13.502196] kasan_save_stack+0x45/0x70 [ 13.502333] kasan_save_track+0x18/0x40 [ 13.502479] kasan_save_free_info+0x3f/0x60 [ 13.502760] __kasan_slab_free+0x56/0x70 [ 13.502953] kfree+0x222/0x3f0 [ 13.503117] kasan_strings+0x2aa/0xe80 [ 13.503302] kunit_try_run_case+0x1a5/0x480 [ 13.503524] kunit_generic_run_threadfn_adapter+0x85/0xf0 [ 13.503914] kthread+0x337/0x6f0 [ 13.504076] ret_from_fork+0x116/0x1d0 [ 13.504252] ret_from_fork_asm+0x1a/0x30 [ 13.504461] [ 13.504554] The buggy address belongs to the object at ffff888103aaf380 [ 13.504554] which belongs to the cache kmalloc-32 of size 32 [ 13.504935] The buggy address is located 16 bytes inside of [ 13.504935] freed 32-byte region [ffff888103aaf380, ffff888103aaf3a0) [ 13.505287] [ 13.505389] The buggy address belongs to the physical page: [ 13.505690] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x103aaf [ 13.506044] flags: 0x200000000000000(node=0|zone=2) [ 13.506281] page_type: f5(slab) [ 13.506459] raw: 0200000000000000 ffff888100041780 dead000000000122 0000000000000000 [ 13.507072] raw: 0000000000000000 0000000080400040 00000000f5000000 0000000000000000 [ 13.507357] page dumped because: kasan: bad access detected [ 13.507582] [ 13.507665] Memory state around the buggy address: [ 13.507817] ffff888103aaf280: fa fb fb fb fc fc fc fc 00 00 07 fc fc fc fc fc [ 13.508047] ffff888103aaf300: fa fb fb fb fc fc fc fc 00 00 00 fc fc fc fc fc [ 13.508356] >ffff888103aaf380: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc [ 13.508824] ^ [ 13.508992] ffff888103aaf400: fa fb fb fb fc fc fc fc 00 00 00 fc fc fc fc fc [ 13.509260] ffff888103aaf480: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc [ 13.509511] ==================================================================