Hay
Date
June 2, 2025, 2:11 p.m.

Environment
e850-96
qemu-x86_64

[   38.965084] ==================================================================
[   38.972116] BUG: KASAN: slab-use-after-free in strnlen+0x80/0x88
[   38.978101] Read of size 1 at addr ffff00080394fc10 by task kunit_try_catch/306
[   38.985393] 
[   38.986876] CPU: 7 UID: 0 PID: 306 Comm: kunit_try_catch Tainted: G    B            N  6.15.1-rc1 #1 PREEMPT 
[   38.986931] Tainted: [B]=BAD_PAGE, [N]=TEST
[   38.986948] Hardware name: WinLink E850-96 board (DT)
[   38.986970] Call trace:
[   38.986982]  show_stack+0x20/0x38 (C)
[   38.987014]  dump_stack_lvl+0x8c/0xd0
[   38.987045]  print_report+0x118/0x608
[   38.987077]  kasan_report+0xdc/0x128
[   38.987104]  __asan_report_load1_noabort+0x20/0x30
[   38.987138]  strnlen+0x80/0x88
[   38.987163]  kasan_strings+0x478/0xb00
[   38.987198]  kunit_try_run_case+0x170/0x3f0
[   38.987230]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   38.987269]  kthread+0x328/0x630
[   38.987299]  ret_from_fork+0x10/0x20
[   38.987334] 
[   39.052319] Allocated by task 306:
[   39.055704]  kasan_save_stack+0x3c/0x68
[   39.059524]  kasan_save_track+0x20/0x40
[   39.063343]  kasan_save_alloc_info+0x40/0x58
[   39.067596]  __kasan_kmalloc+0xd4/0xd8
[   39.071329]  __kmalloc_cache_noprof+0x16c/0x3c0
[   39.075843]  kasan_strings+0xc8/0xb00
[   39.079489]  kunit_try_run_case+0x170/0x3f0
[   39.083655]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   39.089124]  kthread+0x328/0x630
[   39.092335]  ret_from_fork+0x10/0x20
[   39.095895] 
[   39.097370] Freed by task 306:
[   39.100410]  kasan_save_stack+0x3c/0x68
[   39.104228]  kasan_save_track+0x20/0x40
[   39.108047]  kasan_save_free_info+0x4c/0x78
[   39.112214]  __kasan_slab_free+0x6c/0x98
[   39.116120]  kfree+0x214/0x3c8
[   39.119158]  kasan_strings+0x24c/0xb00
[   39.122891]  kunit_try_run_case+0x170/0x3f0
[   39.127057]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   39.132526]  kthread+0x328/0x630
[   39.135738]  ret_from_fork+0x10/0x20
[   39.139296] 
[   39.140772] The buggy address belongs to the object at ffff00080394fc00
[   39.140772]  which belongs to the cache kmalloc-32 of size 32
[   39.153099] The buggy address is located 16 bytes inside of
[   39.153099]  freed 32-byte region [ffff00080394fc00, ffff00080394fc20)
[   39.165164] 
[   39.166643] The buggy address belongs to the physical page:
[   39.172196] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x88394f
[   39.180182] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   39.186691] page_type: f5(slab)
[   39.189826] raw: 0bfffe0000000000 ffff000800002780 dead000000000122 0000000000000000
[   39.197549] raw: 0000000000000000 0000000080400040 00000000f5000000 0000000000000000
[   39.205268] page dumped because: kasan: bad access detected
[   39.210823] 
[   39.212299] Memory state around the buggy address:
[   39.217080]  ffff00080394fb00: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc
[   39.224282]  ffff00080394fb80: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc
[   39.231486] >ffff00080394fc00: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc
[   39.238688]                          ^
[   39.242423]  ffff00080394fc80: fa fb fb fb fc fc fc fc 00 00 00 fc fc fc fc fc
[   39.249628]  ffff00080394fd00: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc
[   39.256830] ==================================================================

[   19.097606] ==================================================================
[   19.098046] BUG: KASAN: slab-use-after-free in strnlen+0x73/0x80
[   19.098454] Read of size 1 at addr ffff888101e064d0 by task kunit_try_catch/280
[   19.099045] 
[   19.099279] CPU: 1 UID: 0 PID: 280 Comm: kunit_try_catch Tainted: G    B            N  6.15.1-rc1 #1 PREEMPT(voluntary) 
[   19.099470] Tainted: [B]=BAD_PAGE, [N]=TEST
[   19.099501] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   19.099564] Call Trace:
[   19.099602]  <TASK>
[   19.099666]  dump_stack_lvl+0x73/0xb0
[   19.099736]  print_report+0xd1/0x650
[   19.099798]  ? __virt_addr_valid+0x1db/0x2d0
[   19.099854]  ? strnlen+0x73/0x80
[   19.099935]  ? kasan_complete_mode_report_info+0x64/0x200
[   19.100012]  ? strnlen+0x73/0x80
[   19.100067]  kasan_report+0x141/0x180
[   19.100121]  ? strnlen+0x73/0x80
[   19.100277]  __asan_report_load1_noabort+0x18/0x20
[   19.100312]  strnlen+0x73/0x80
[   19.100336]  kasan_strings+0x615/0xe80
[   19.100358]  ? trace_hardirqs_on+0x37/0xe0
[   19.100386]  ? __pfx_kasan_strings+0x10/0x10
[   19.100409]  ? finish_task_switch.isra.0+0x153/0x700
[   19.100434]  ? __switch_to+0x5d9/0xf60
[   19.100457]  ? dequeue_task_fair+0x166/0x4e0
[   19.100484]  ? __schedule+0x10cc/0x2b30
[   19.100509]  ? __pfx_read_tsc+0x10/0x10
[   19.100530]  ? ktime_get_ts64+0x86/0x230
[   19.100559]  kunit_try_run_case+0x1a5/0x480
[   19.100586]  ? __pfx_kunit_try_run_case+0x10/0x10
[   19.100609]  ? _raw_spin_lock_irqsave+0xa1/0x100
[   19.100635]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   19.100660]  ? __kthread_parkme+0x82/0x180
[   19.100683]  ? preempt_count_sub+0x50/0x80
[   19.100710]  ? __pfx_kunit_try_run_case+0x10/0x10
[   19.100735]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   19.100786]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   19.100813]  kthread+0x337/0x6f0
[   19.100834]  ? trace_preempt_on+0x20/0xc0
[   19.100858]  ? __pfx_kthread+0x10/0x10
[   19.100879]  ? _raw_spin_unlock_irq+0x47/0x80
[   19.100903]  ? calculate_sigpending+0x7b/0xa0
[   19.100927]  ? __pfx_kthread+0x10/0x10
[   19.100948]  ret_from_fork+0x41/0x80
[   19.100971]  ? __pfx_kthread+0x10/0x10
[   19.100992]  ret_from_fork_asm+0x1a/0x30
[   19.101028]  </TASK>
[   19.101043] 
[   19.114393] Allocated by task 280:
[   19.114856]  kasan_save_stack+0x45/0x70
[   19.115311]  kasan_save_track+0x18/0x40
[   19.115716]  kasan_save_alloc_info+0x3b/0x50
[   19.116015]  __kasan_kmalloc+0xb7/0xc0
[   19.116317]  __kmalloc_cache_noprof+0x189/0x420
[   19.116561]  kasan_strings+0xc0/0xe80
[   19.116772]  kunit_try_run_case+0x1a5/0x480
[   19.117011]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   19.117510]  kthread+0x337/0x6f0
[   19.117877]  ret_from_fork+0x41/0x80
[   19.118251]  ret_from_fork_asm+0x1a/0x30
[   19.118630] 
[   19.118824] Freed by task 280:
[   19.119166]  kasan_save_stack+0x45/0x70
[   19.119464]  kasan_save_track+0x18/0x40
[   19.119762]  kasan_save_free_info+0x3f/0x60
[   19.120151]  __kasan_slab_free+0x56/0x70
[   19.120510]  kfree+0x222/0x3f0
[   19.120720]  kasan_strings+0x2aa/0xe80
[   19.120921]  kunit_try_run_case+0x1a5/0x480
[   19.121173]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   19.121425]  kthread+0x337/0x6f0
[   19.121710]  ret_from_fork+0x41/0x80
[   19.122050]  ret_from_fork_asm+0x1a/0x30
[   19.122460] 
[   19.122661] The buggy address belongs to the object at ffff888101e064c0
[   19.122661]  which belongs to the cache kmalloc-32 of size 32
[   19.123655] The buggy address is located 16 bytes inside of
[   19.123655]  freed 32-byte region [ffff888101e064c0, ffff888101e064e0)
[   19.124554] 
[   19.124741] The buggy address belongs to the physical page:
[   19.125166] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x101e06
[   19.125632] flags: 0x200000000000000(node=0|zone=2)
[   19.126061] page_type: f5(slab)
[   19.126422] raw: 0200000000000000 ffff888100041780 dead000000000122 0000000000000000
[   19.127009] raw: 0000000000000000 0000000080400040 00000000f5000000 0000000000000000
[   19.127420] page dumped because: kasan: bad access detected
[   19.127670] 
[   19.127823] Memory state around the buggy address:
[   19.128268]  ffff888101e06380: 00 00 00 04 fc fc fc fc fa fb fb fb fc fc fc fc
[   19.128828]  ffff888101e06400: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc
[   19.129415] >ffff888101e06480: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc
[   19.129904]                                                  ^
[   19.130226]  ffff888101e06500: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc
[   19.130519]  ffff888101e06580: 00 00 00 fc fc fc fc fc fa fb fb fb fc fc fc fc
[   19.131088] ==================================================================