Hay
Date
July 15, 2025, 11:35 a.m.

Environment
e850-96
qemu-x86_64

[   58.138114] ==================================================================
[   58.145128] BUG: KASAN: slab-use-after-free in strnlen+0x80/0x88
[   58.151115] Read of size 1 at addr ffff0008085305d0 by task kunit_try_catch/340
[   58.158405] 
[   58.159887] CPU: 0 UID: 0 PID: 340 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc6-next-20250715 #1 PREEMPT 
[   58.159942] Tainted: [B]=BAD_PAGE, [N]=TEST
[   58.159957] Hardware name: WinLink E850-96 board (DT)
[   58.159974] Call trace:
[   58.159988]  show_stack+0x20/0x38 (C)
[   58.160022]  dump_stack_lvl+0x8c/0xd0
[   58.160057]  print_report+0x118/0x5d0
[   58.160084]  kasan_report+0xdc/0x128
[   58.160112]  __asan_report_load1_noabort+0x20/0x30
[   58.160145]  strnlen+0x80/0x88
[   58.160172]  kasan_strings+0x478/0xb00
[   58.160206]  kunit_try_run_case+0x170/0x3f0
[   58.160237]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   58.160271]  kthread+0x328/0x630
[   58.160299]  ret_from_fork+0x10/0x20
[   58.160330] 
[   58.226546] Allocated by task 340:
[   58.229934]  kasan_save_stack+0x3c/0x68
[   58.233751]  kasan_save_track+0x20/0x40
[   58.237570]  kasan_save_alloc_info+0x40/0x58
[   58.241824]  __kasan_kmalloc+0xd4/0xd8
[   58.245556]  __kmalloc_cache_noprof+0x16c/0x3c0
[   58.250070]  kasan_strings+0xc8/0xb00
[   58.253716]  kunit_try_run_case+0x170/0x3f0
[   58.257883]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   58.263351]  kthread+0x328/0x630
[   58.266563]  ret_from_fork+0x10/0x20
[   58.270122] 
[   58.271598] Freed by task 340:
[   58.274638]  kasan_save_stack+0x3c/0x68
[   58.278455]  kasan_save_track+0x20/0x40
[   58.282274]  kasan_save_free_info+0x4c/0x78
[   58.286441]  __kasan_slab_free+0x6c/0x98
[   58.290347]  kfree+0x214/0x3c8
[   58.293385]  kasan_strings+0x24c/0xb00
[   58.297118]  kunit_try_run_case+0x170/0x3f0
[   58.301285]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   58.306755]  kthread+0x328/0x630
[   58.309965]  ret_from_fork+0x10/0x20
[   58.313524] 
[   58.315000] The buggy address belongs to the object at ffff0008085305c0
[   58.315000]  which belongs to the cache kmalloc-32 of size 32
[   58.327326] The buggy address is located 16 bytes inside of
[   58.327326]  freed 32-byte region [ffff0008085305c0, ffff0008085305e0)
[   58.339392] 
[   58.340870] The buggy address belongs to the physical page:
[   58.346426] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x888530
[   58.354409] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   58.360919] page_type: f5(slab)
[   58.364052] raw: 0bfffe0000000000 ffff000800002780 dead000000000122 0000000000000000
[   58.371777] raw: 0000000000000000 0000000080400040 00000000f5000000 0000000000000000
[   58.379495] page dumped because: kasan: bad access detected
[   58.385051] 
[   58.386526] Memory state around the buggy address:
[   58.391306]  ffff000808530480: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc
[   58.398509]  ffff000808530500: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc
[   58.405714] >ffff000808530580: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc
[   58.412915]                                                  ^
[   58.418735]  ffff000808530600: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc
[   58.425939]  ffff000808530680: 00 00 00 fc fc fc fc fc fa fb fb fb fc fc fc fc
[   58.433140] ==================================================================

[   26.076830] ==================================================================
[   26.077174] BUG: KASAN: slab-use-after-free in strnlen+0x73/0x80
[   26.077458] Read of size 1 at addr ffff88810591fe50 by task kunit_try_catch/307
[   26.078193] 
[   26.078298] CPU: 0 UID: 0 PID: 307 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc6-next-20250715 #1 PREEMPT(voluntary) 
[   26.078347] Tainted: [B]=BAD_PAGE, [N]=TEST
[   26.078360] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   26.078384] Call Trace:
[   26.078400]  <TASK>
[   26.078416]  dump_stack_lvl+0x73/0xb0
[   26.078447]  print_report+0xd1/0x610
[   26.078480]  ? __virt_addr_valid+0x1db/0x2d0
[   26.078508]  ? strnlen+0x73/0x80
[   26.078543]  ? kasan_complete_mode_report_info+0x64/0x200
[   26.078575]  ? strnlen+0x73/0x80
[   26.078600]  kasan_report+0x141/0x180
[   26.078628]  ? strnlen+0x73/0x80
[   26.078661]  __asan_report_load1_noabort+0x18/0x20
[   26.078690]  strnlen+0x73/0x80
[   26.078717]  kasan_strings+0x615/0xe80
[   26.078741]  ? trace_hardirqs_on+0x37/0xe0
[   26.078769]  ? __pfx_kasan_strings+0x10/0x10
[   26.078794]  ? finish_task_switch.isra.0+0x153/0x700
[   26.078820]  ? __switch_to+0x47/0xf80
[   26.078852]  ? __schedule+0x10cc/0x2b60
[   26.078878]  ? __pfx_read_tsc+0x10/0x10
[   26.078904]  ? ktime_get_ts64+0x86/0x230
[   26.078987]  kunit_try_run_case+0x1a5/0x480
[   26.079017]  ? __pfx_kunit_try_run_case+0x10/0x10
[   26.079044]  ? _raw_spin_lock_irqsave+0xa1/0x100
[   26.079072]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   26.079099]  ? __kthread_parkme+0x82/0x180
[   26.079135]  ? preempt_count_sub+0x50/0x80
[   26.079164]  ? __pfx_kunit_try_run_case+0x10/0x10
[   26.079203]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   26.079236]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   26.079267]  kthread+0x337/0x6f0
[   26.079291]  ? trace_preempt_on+0x20/0xc0
[   26.079319]  ? __pfx_kthread+0x10/0x10
[   26.079344]  ? _raw_spin_unlock_irq+0x47/0x80
[   26.079374]  ? calculate_sigpending+0x7b/0xa0
[   26.079412]  ? __pfx_kthread+0x10/0x10
[   26.079440]  ret_from_fork+0x116/0x1d0
[   26.079473]  ? __pfx_kthread+0x10/0x10
[   26.079499]  ret_from_fork_asm+0x1a/0x30
[   26.079547]  </TASK>
[   26.079560] 
[   26.087403] Allocated by task 307:
[   26.087554]  kasan_save_stack+0x45/0x70
[   26.087705]  kasan_save_track+0x18/0x40
[   26.088064]  kasan_save_alloc_info+0x3b/0x50
[   26.088291]  __kasan_kmalloc+0xb7/0xc0
[   26.088671]  __kmalloc_cache_noprof+0x189/0x420
[   26.089139]  kasan_strings+0xc0/0xe80
[   26.089288]  kunit_try_run_case+0x1a5/0x480
[   26.089435]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   26.089827]  kthread+0x337/0x6f0
[   26.090065]  ret_from_fork+0x116/0x1d0
[   26.090280]  ret_from_fork_asm+0x1a/0x30
[   26.090449] 
[   26.090572] Freed by task 307:
[   26.090748]  kasan_save_stack+0x45/0x70
[   26.090951]  kasan_save_track+0x18/0x40
[   26.091126]  kasan_save_free_info+0x3f/0x60
[   26.091332]  __kasan_slab_free+0x56/0x70
[   26.091540]  kfree+0x222/0x3f0
[   26.091745]  kasan_strings+0x2aa/0xe80
[   26.091953]  kunit_try_run_case+0x1a5/0x480
[   26.092156]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   26.092388]  kthread+0x337/0x6f0
[   26.092510]  ret_from_fork+0x116/0x1d0
[   26.092654]  ret_from_fork_asm+0x1a/0x30
[   26.092794] 
[   26.092861] The buggy address belongs to the object at ffff88810591fe40
[   26.092861]  which belongs to the cache kmalloc-32 of size 32
[   26.093449] The buggy address is located 16 bytes inside of
[   26.093449]  freed 32-byte region [ffff88810591fe40, ffff88810591fe60)
[   26.093966] 
[   26.094057] The buggy address belongs to the physical page:
[   26.094435] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x10591f
[   26.094992] flags: 0x200000000000000(node=0|zone=2)
[   26.095184] page_type: f5(slab)
[   26.095303] raw: 0200000000000000 ffff888100041780 dead000000000122 0000000000000000
[   26.096149] raw: 0000000000000000 0000000000400040 00000000f5000000 0000000000000000
[   26.096758] page dumped because: kasan: bad access detected
[   26.097146] 
[   26.097231] Memory state around the buggy address:
[   26.097437]  ffff88810591fd00: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc
[   26.098240]  ffff88810591fd80: 00 00 00 fc fc fc fc fc 00 00 00 fc fc fc fc fc
[   26.099014] >ffff88810591fe00: 00 00 07 fc fc fc fc fc fa fb fb fb fc fc fc fc
[   26.099330]                                                  ^
[   26.099828]  ffff88810591fe80: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc
[   26.100287]  ffff88810591ff00: 00 00 00 fc fc fc fc fc fa fb fb fb fc fc fc fc
[   26.101001] ==================================================================