Hay
Date
July 11, 2025, 10:11 a.m.

Environment
e850-96
qemu-x86_64

[   58.210660] ==================================================================
[   58.217672] BUG: KASAN: slab-use-after-free in strnlen+0x80/0x88
[   58.223658] Read of size 1 at addr ffff0008016ffe10 by task kunit_try_catch/343
[   58.230949] 
[   58.232432] CPU: 5 UID: 0 PID: 343 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc5-next-20250711 #1 PREEMPT 
[   58.232486] Tainted: [B]=BAD_PAGE, [N]=TEST
[   58.232503] Hardware name: WinLink E850-96 board (DT)
[   58.232522] Call trace:
[   58.232536]  show_stack+0x20/0x38 (C)
[   58.232569]  dump_stack_lvl+0x8c/0xd0
[   58.232601]  print_report+0x118/0x5d0
[   58.232631]  kasan_report+0xdc/0x128
[   58.232660]  __asan_report_load1_noabort+0x20/0x30
[   58.232694]  strnlen+0x80/0x88
[   58.232729]  kasan_strings+0x478/0xb00
[   58.232760]  kunit_try_run_case+0x170/0x3f0
[   58.232798]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   58.232832]  kthread+0x328/0x630
[   58.232860]  ret_from_fork+0x10/0x20
[   58.232894] 
[   58.299089] Allocated by task 343:
[   58.302478]  kasan_save_stack+0x3c/0x68
[   58.306295]  kasan_save_track+0x20/0x40
[   58.310114]  kasan_save_alloc_info+0x40/0x58
[   58.314367]  __kasan_kmalloc+0xd4/0xd8
[   58.318100]  __kmalloc_cache_noprof+0x16c/0x3c0
[   58.322614]  kasan_strings+0xc8/0xb00
[   58.326259]  kunit_try_run_case+0x170/0x3f0
[   58.330426]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   58.335895]  kthread+0x328/0x630
[   58.339107]  ret_from_fork+0x10/0x20
[   58.342666] 
[   58.344143] Freed by task 343:
[   58.347180]  kasan_save_stack+0x3c/0x68
[   58.350999]  kasan_save_track+0x20/0x40
[   58.354818]  kasan_save_free_info+0x4c/0x78
[   58.358985]  __kasan_slab_free+0x6c/0x98
[   58.362891]  kfree+0x214/0x3c8
[   58.365929]  kasan_strings+0x24c/0xb00
[   58.369662]  kunit_try_run_case+0x170/0x3f0
[   58.373828]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   58.379297]  kthread+0x328/0x630
[   58.382509]  ret_from_fork+0x10/0x20
[   58.386068] 
[   58.387543] The buggy address belongs to the object at ffff0008016ffe00
[   58.387543]  which belongs to the cache kmalloc-32 of size 32
[   58.399870] The buggy address is located 16 bytes inside of
[   58.399870]  freed 32-byte region [ffff0008016ffe00, ffff0008016ffe20)
[   58.411936] 
[   58.413413] The buggy address belongs to the physical page:
[   58.418971] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x8816ff
[   58.426955] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   58.433464] page_type: f5(slab)
[   58.436602] raw: 0bfffe0000000000 ffff000800002780 dead000000000100 dead000000000122
[   58.444320] raw: 0000000000000000 0000000000400040 00000000f5000000 0000000000000000
[   58.452039] page dumped because: kasan: bad access detected
[   58.457594] 
[   58.459070] Memory state around the buggy address:
[   58.463851]  ffff0008016ffd00: 00 00 00 00 fc fc fc fc fa fb fb fb fc fc fc fc
[   58.471053]  ffff0008016ffd80: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc
[   58.478258] >ffff0008016ffe00: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc
[   58.485459]                          ^
[   58.489195]  ffff0008016ffe80: fa fb fb fb fc fc fc fc 00 00 00 fc fc fc fc fc
[   58.496400]  ffff0008016fff00: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc
[   58.503601] ==================================================================

[   25.846351] ==================================================================
[   25.847811] BUG: KASAN: slab-use-after-free in strnlen+0x73/0x80
[   25.848654] Read of size 1 at addr ffff88810613f2d0 by task kunit_try_catch/309
[   25.849495] 
[   25.849612] CPU: 1 UID: 0 PID: 309 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc5-next-20250711 #1 PREEMPT(voluntary) 
[   25.849667] Tainted: [B]=BAD_PAGE, [N]=TEST
[   25.849681] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   25.849704] Call Trace:
[   25.849725]  <TASK>
[   25.849752]  dump_stack_lvl+0x73/0xb0
[   25.849785]  print_report+0xd1/0x610
[   25.849808]  ? __virt_addr_valid+0x1db/0x2d0
[   25.849833]  ? strnlen+0x73/0x80
[   25.849852]  ? kasan_complete_mode_report_info+0x64/0x200
[   25.849878]  ? strnlen+0x73/0x80
[   25.849898]  kasan_report+0x141/0x180
[   25.849920]  ? strnlen+0x73/0x80
[   25.849944]  __asan_report_load1_noabort+0x18/0x20
[   25.849969]  strnlen+0x73/0x80
[   25.849988]  kasan_strings+0x615/0xe80
[   25.850009]  ? trace_hardirqs_on+0x37/0xe0
[   25.850032]  ? __pfx_kasan_strings+0x10/0x10
[   25.850052]  ? finish_task_switch.isra.0+0x153/0x700
[   25.850075]  ? __switch_to+0x47/0xf80
[   25.850101]  ? __schedule+0x10cc/0x2b60
[   25.850125]  ? __pfx_read_tsc+0x10/0x10
[   25.850148]  ? ktime_get_ts64+0x86/0x230
[   25.850173]  kunit_try_run_case+0x1a5/0x480
[   25.850195]  ? __pfx_kunit_try_run_case+0x10/0x10
[   25.850216]  ? _raw_spin_lock_irqsave+0xa1/0x100
[   25.850240]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   25.850263]  ? __kthread_parkme+0x82/0x180
[   25.850284]  ? preempt_count_sub+0x50/0x80
[   25.850306]  ? __pfx_kunit_try_run_case+0x10/0x10
[   25.850327]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   25.850355]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   25.850379]  kthread+0x337/0x6f0
[   25.850401]  ? trace_preempt_on+0x20/0xc0
[   25.850422]  ? __pfx_kthread+0x10/0x10
[   25.850444]  ? _raw_spin_unlock_irq+0x47/0x80
[   25.850465]  ? calculate_sigpending+0x7b/0xa0
[   25.850489]  ? __pfx_kthread+0x10/0x10
[   25.850511]  ret_from_fork+0x116/0x1d0
[   25.850530]  ? __pfx_kthread+0x10/0x10
[   25.850552]  ret_from_fork_asm+0x1a/0x30
[   25.850583]  </TASK>
[   25.850595] 
[   25.860457] Allocated by task 309:
[   25.860832]  kasan_save_stack+0x45/0x70
[   25.861043]  kasan_save_track+0x18/0x40
[   25.861230]  kasan_save_alloc_info+0x3b/0x50
[   25.861434]  __kasan_kmalloc+0xb7/0xc0
[   25.861862]  __kmalloc_cache_noprof+0x189/0x420
[   25.862135]  kasan_strings+0xc0/0xe80
[   25.862280]  kunit_try_run_case+0x1a5/0x480
[   25.862742]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   25.863085]  kthread+0x337/0x6f0
[   25.863227]  ret_from_fork+0x116/0x1d0
[   25.863403]  ret_from_fork_asm+0x1a/0x30
[   25.863787] 
[   25.863889] Freed by task 309:
[   25.864198]  kasan_save_stack+0x45/0x70
[   25.864544]  kasan_save_track+0x18/0x40
[   25.864721]  kasan_save_free_info+0x3f/0x60
[   25.865075]  __kasan_slab_free+0x56/0x70
[   25.865342]  kfree+0x222/0x3f0
[   25.865479]  kasan_strings+0x2aa/0xe80
[   25.865727]  kunit_try_run_case+0x1a5/0x480
[   25.865940]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   25.866176]  kthread+0x337/0x6f0
[   25.866323]  ret_from_fork+0x116/0x1d0
[   25.866814]  ret_from_fork_asm+0x1a/0x30
[   25.867000] 
[   25.867069] The buggy address belongs to the object at ffff88810613f2c0
[   25.867069]  which belongs to the cache kmalloc-32 of size 32
[   25.867923] The buggy address is located 16 bytes inside of
[   25.867923]  freed 32-byte region [ffff88810613f2c0, ffff88810613f2e0)
[   25.868615] 
[   25.868857] The buggy address belongs to the physical page:
[   25.869097] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x10613f
[   25.869514] flags: 0x200000000000000(node=0|zone=2)
[   25.869760] page_type: f5(slab)
[   25.869916] raw: 0200000000000000 ffff888100041780 dead000000000122 0000000000000000
[   25.870233] raw: 0000000000000000 0000000080400040 00000000f5000000 0000000000000000
[   25.870801] page dumped because: kasan: bad access detected
[   25.871108] 
[   25.871207] Memory state around the buggy address:
[   25.871555]  ffff88810613f180: 00 00 00 fc fc fc fc fc fa fb fb fb fc fc fc fc
[   25.871959]  ffff88810613f200: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc
[   25.872313] >ffff88810613f280: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc
[   25.872765]                                                  ^
[   25.873044]  ffff88810613f300: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc
[   25.873330]  ffff88810613f380: 00 00 00 fc fc fc fc fc fa fb fb fb fc fc fc fc
[   25.873822] ==================================================================