Hay
Date
July 22, 2025, 5:13 a.m.

Environment
qemu-arm64
qemu-x86_64

[   32.645998] ==================================================================
[   32.646409] BUG: KASAN: slab-use-after-free in strnlen+0x80/0x88
[   32.646485] Read of size 1 at addr fff00000c9227a10 by task kunit_try_catch/290
[   32.646546] 
[   32.646707] CPU: 1 UID: 0 PID: 290 Comm: kunit_try_catch Tainted: G    B   W        N  6.16.0-rc7-next-20250722 #1 PREEMPT 
[   32.646935] Tainted: [B]=BAD_PAGE, [W]=WARN, [N]=TEST
[   32.647002] Hardware name: linux,dummy-virt (DT)
[   32.647036] Call trace:
[   32.647106]  show_stack+0x20/0x38 (C)
[   32.647422]  dump_stack_lvl+0x8c/0xd0
[   32.647502]  print_report+0x118/0x5e8
[   32.647616]  kasan_report+0xdc/0x128
[   32.647669]  __asan_report_load1_noabort+0x20/0x30
[   32.647747]  strnlen+0x80/0x88
[   32.648067]  kasan_strings+0x478/0xb00
[   32.648230]  kunit_try_run_case+0x170/0x3f0
[   32.648286]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   32.648340]  kthread+0x328/0x630
[   32.648624]  ret_from_fork+0x10/0x20
[   32.648706] 
[   32.648838] Allocated by task 290:
[   32.648910]  kasan_save_stack+0x3c/0x68
[   32.649022]  kasan_save_track+0x20/0x40
[   32.649240]  kasan_save_alloc_info+0x40/0x58
[   32.649443]  __kasan_kmalloc+0xd4/0xd8
[   32.649538]  __kmalloc_cache_noprof+0x16c/0x3c0
[   32.649648]  kasan_strings+0xc8/0xb00
[   32.649737]  kunit_try_run_case+0x170/0x3f0
[   32.649872]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   32.649972]  kthread+0x328/0x630
[   32.650025]  ret_from_fork+0x10/0x20
[   32.650330] 
[   32.650379] Freed by task 290:
[   32.650525]  kasan_save_stack+0x3c/0x68
[   32.650640]  kasan_save_track+0x20/0x40
[   32.650685]  kasan_save_free_info+0x4c/0x78
[   32.650986]  __kasan_slab_free+0x6c/0x98
[   32.651165]  kfree+0x214/0x3c8
[   32.651273]  kasan_strings+0x24c/0xb00
[   32.651399]  kunit_try_run_case+0x170/0x3f0
[   32.651442]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   32.651679]  kthread+0x328/0x630
[   32.651864]  ret_from_fork+0x10/0x20
[   32.651937] 
[   32.651961] The buggy address belongs to the object at fff00000c9227a00
[   32.651961]  which belongs to the cache kmalloc-32 of size 32
[   32.652144] The buggy address is located 16 bytes inside of
[   32.652144]  freed 32-byte region [fff00000c9227a00, fff00000c9227a20)
[   32.652214] 
[   32.652248] The buggy address belongs to the physical page:
[   32.652286] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x109227
[   32.652372] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   32.652421] page_type: f5(slab)
[   32.652469] raw: 0bfffe0000000000 fff00000c0001780 dead000000000122 0000000000000000
[   32.652523] raw: 0000000000000000 0000000080400040 00000000f5000000 0000000000000000
[   32.652566] page dumped because: kasan: bad access detected
[   32.652599] 
[   32.652633] Memory state around the buggy address:
[   32.652675]  fff00000c9227900: 00 00 00 fc fc fc fc fc 00 00 00 fc fc fc fc fc
[   32.652721]  fff00000c9227980: 00 00 07 fc fc fc fc fc 00 00 00 fc fc fc fc fc
[   32.652766] >fff00000c9227a00: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc
[   32.652828]                          ^
[   32.652859]  fff00000c9227a80: fa fb fb fb fc fc fc fc 00 00 00 fc fc fc fc fc
[   32.653426]  fff00000c9227b00: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc
[   32.653498] ==================================================================

[   27.058048] ==================================================================
[   27.059676] BUG: KASAN: slab-use-after-free in strnlen+0x73/0x80
[   27.059905] Read of size 1 at addr ffff888106006150 by task kunit_try_catch/307
[   27.060204] 
[   27.060305] CPU: 1 UID: 0 PID: 307 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc7-next-20250722 #1 PREEMPT(voluntary) 
[   27.060354] Tainted: [B]=BAD_PAGE, [N]=TEST
[   27.060366] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   27.060388] Call Trace:
[   27.060402]  <TASK>
[   27.060417]  dump_stack_lvl+0x73/0xb0
[   27.060444]  print_report+0xd1/0x640
[   27.060513]  ? __virt_addr_valid+0x1db/0x2d0
[   27.060540]  ? strnlen+0x73/0x80
[   27.060560]  ? kasan_complete_mode_report_info+0x64/0x200
[   27.060587]  ? strnlen+0x73/0x80
[   27.060609]  kasan_report+0x141/0x180
[   27.060633]  ? strnlen+0x73/0x80
[   27.060671]  __asan_report_load1_noabort+0x18/0x20
[   27.060697]  strnlen+0x73/0x80
[   27.060720]  kasan_strings+0x615/0xe80
[   27.060753]  ? trace_hardirqs_on+0x37/0xe0
[   27.060777]  ? __pfx_kasan_strings+0x10/0x10
[   27.060798]  ? finish_task_switch.isra.0+0x153/0x700
[   27.060820]  ? __switch_to+0x47/0xf80
[   27.060856]  ? __schedule+0x10da/0x2b60
[   27.060900]  ? __pfx_read_tsc+0x10/0x10
[   27.060923]  ? ktime_get_ts64+0x86/0x230
[   27.060948]  kunit_try_run_case+0x1a5/0x480
[   27.060985]  ? __pfx_kunit_try_run_case+0x10/0x10
[   27.061008]  ? _raw_spin_lock_irqsave+0xa1/0x100
[   27.061034]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   27.061061]  ? __kthread_parkme+0x82/0x180
[   27.061090]  ? preempt_count_sub+0x50/0x80
[   27.061113]  ? __pfx_kunit_try_run_case+0x10/0x10
[   27.061137]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   27.061171]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   27.061206]  kthread+0x337/0x6f0
[   27.061226]  ? trace_preempt_on+0x20/0xc0
[   27.061249]  ? __pfx_kthread+0x10/0x10
[   27.061270]  ? _raw_spin_unlock_irq+0x47/0x80
[   27.061303]  ? calculate_sigpending+0x7b/0xa0
[   27.061326]  ? __pfx_kthread+0x10/0x10
[   27.061348]  ret_from_fork+0x116/0x1d0
[   27.061381]  ? __pfx_kthread+0x10/0x10
[   27.061403]  ret_from_fork_asm+0x1a/0x30
[   27.061433]  </TASK>
[   27.061444] 
[   27.069907] Allocated by task 307:
[   27.070145]  kasan_save_stack+0x45/0x70
[   27.070336]  kasan_save_track+0x18/0x40
[   27.070636]  kasan_save_alloc_info+0x3b/0x50
[   27.070810]  __kasan_kmalloc+0xb7/0xc0
[   27.071007]  __kmalloc_cache_noprof+0x189/0x420
[   27.071270]  kasan_strings+0xc0/0xe80
[   27.071445]  kunit_try_run_case+0x1a5/0x480
[   27.071675]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   27.071951]  kthread+0x337/0x6f0
[   27.072133]  ret_from_fork+0x116/0x1d0
[   27.072316]  ret_from_fork_asm+0x1a/0x30
[   27.072459] 
[   27.072525] Freed by task 307:
[   27.072633]  kasan_save_stack+0x45/0x70
[   27.072768]  kasan_save_track+0x18/0x40
[   27.072918]  kasan_save_free_info+0x3f/0x60
[   27.073066]  __kasan_slab_free+0x56/0x70
[   27.073204]  kfree+0x222/0x3f0
[   27.073319]  kasan_strings+0x2aa/0xe80
[   27.073464]  kunit_try_run_case+0x1a5/0x480
[   27.073748]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   27.074018]  kthread+0x337/0x6f0
[   27.074195]  ret_from_fork+0x116/0x1d0
[   27.074384]  ret_from_fork_asm+0x1a/0x30
[   27.074761] 
[   27.074871] The buggy address belongs to the object at ffff888106006140
[   27.074871]  which belongs to the cache kmalloc-32 of size 32
[   27.075748] The buggy address is located 16 bytes inside of
[   27.075748]  freed 32-byte region [ffff888106006140, ffff888106006160)
[   27.076290] 
[   27.076385] The buggy address belongs to the physical page:
[   27.076906] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x106006
[   27.077430] flags: 0x200000000000000(node=0|zone=2)
[   27.077721] page_type: f5(slab)
[   27.077876] raw: 0200000000000000 ffff888100041780 dead000000000122 0000000000000000
[   27.078160] raw: 0000000000000000 0000000080400040 00000000f5000000 0000000000000000
[   27.078429] page dumped because: kasan: bad access detected
[   27.078801] 
[   27.078927] Memory state around the buggy address:
[   27.079151]  ffff888106006000: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc
[   27.079515]  ffff888106006080: 00 00 00 fc fc fc fc fc 00 00 00 fc fc fc fc fc
[   27.079969] >ffff888106006100: 00 00 07 fc fc fc fc fc fa fb fb fb fc fc fc fc
[   27.080563]                                                  ^
[   27.080878]  ffff888106006180: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc
[   27.081136]  ffff888106006200: 00 00 00 fc fc fc fc fc fa fb fb fb fc fc fc fc
[   27.081360] ==================================================================