Hay
Date
June 17, 2025, 6:35 a.m.

Environment
qemu-arm64
qemu-x86_64

[   19.248311] ==================================================================
[   19.248358] BUG: KASAN: slab-use-after-free in strnlen+0x80/0x88
[   19.248404] Read of size 1 at addr fff00000c5211590 by task kunit_try_catch/268
[   19.248455] 
[   19.248485] CPU: 1 UID: 0 PID: 268 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc2-next-20250617 #1 PREEMPT 
[   19.248573] Tainted: [B]=BAD_PAGE, [N]=TEST
[   19.248603] Hardware name: linux,dummy-virt (DT)
[   19.248636] Call trace:
[   19.248659]  show_stack+0x20/0x38 (C)
[   19.248707]  dump_stack_lvl+0x8c/0xd0
[   19.248756]  print_report+0x118/0x608
[   19.248803]  kasan_report+0xdc/0x128
[   19.248852]  __asan_report_load1_noabort+0x20/0x30
[   19.248901]  strnlen+0x80/0x88
[   19.248961]  kasan_strings+0x478/0xb00
[   19.249007]  kunit_try_run_case+0x170/0x3f0
[   19.249056]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   19.249111]  kthread+0x328/0x630
[   19.249153]  ret_from_fork+0x10/0x20
[   19.249203] 
[   19.249222] Allocated by task 268:
[   19.249251]  kasan_save_stack+0x3c/0x68
[   19.249294]  kasan_save_track+0x20/0x40
[   19.249334]  kasan_save_alloc_info+0x40/0x58
[   19.249373]  __kasan_kmalloc+0xd4/0xd8
[   19.249412]  __kmalloc_cache_noprof+0x16c/0x3c0
[   19.249454]  kasan_strings+0xc8/0xb00
[   19.249491]  kunit_try_run_case+0x170/0x3f0
[   19.249532]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   19.249581]  kthread+0x328/0x630
[   19.249615]  ret_from_fork+0x10/0x20
[   19.249652] 
[   19.249673] Freed by task 268:
[   19.249700]  kasan_save_stack+0x3c/0x68
[   19.249740]  kasan_save_track+0x20/0x40
[   19.249781]  kasan_save_free_info+0x4c/0x78
[   19.249820]  __kasan_slab_free+0x6c/0x98
[   19.249861]  kfree+0x214/0x3c8
[   19.249896]  kasan_strings+0x24c/0xb00
[   19.249946]  kunit_try_run_case+0x170/0x3f0
[   19.250138]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   19.250198]  kthread+0x328/0x630
[   19.250233]  ret_from_fork+0x10/0x20
[   19.250271] 
[   19.250293] The buggy address belongs to the object at fff00000c5211580
[   19.250293]  which belongs to the cache kmalloc-32 of size 32
[   19.250353] The buggy address is located 16 bytes inside of
[   19.250353]  freed 32-byte region [fff00000c5211580, fff00000c52115a0)
[   19.250418] 
[   19.250448] The buggy address belongs to the physical page:
[   19.250606] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x105211
[   19.250683] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   19.250733] page_type: f5(slab)
[   19.250780] raw: 0bfffe0000000000 fff00000c0001780 dead000000000122 0000000000000000
[   19.251031] raw: 0000000000000000 0000000080400040 00000000f5000000 0000000000000000
[   19.251087] page dumped because: kasan: bad access detected
[   19.251120] 
[   19.251141] Memory state around the buggy address:
[   19.251172]  fff00000c5211480: 00 00 00 fc fc fc fc fc 00 00 00 fc fc fc fc fc
[   19.251217]  fff00000c5211500: 00 00 00 fc fc fc fc fc 00 00 07 fc fc fc fc fc
[   19.251268] >fff00000c5211580: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc
[   19.262894] CPU: 1 UID: 0 PID: 270 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc2-next-20250617 #1 PREEMPT 
[   19.264268]  kunit_try_run_case+0x170/0x3f0
[   19.264850] Allocated by task 270:
[   19.265217]  kasan_save_alloc_info+0x40/0x58
[   19.265380]  __kmalloc_cache_noprof+0x16c/0x3c0
[   19.265694]  kthread+0x328/0x630
[   19.265920] The buggy address is located 8 bytes inside of
[   19.265920]  allocated 9-byte region [fff00000c1193720, fff00000c1193729)
[   19.267165]  fff00000c1193600: fa fb fc fc fa fb fc fc fa fb fc fc fa fb fc fc
[   19.269852] ==================================================================

[   20.961454] ==================================================================
[   20.961903] BUG: KASAN: slab-use-after-free in strnlen+0x73/0x80
[   20.963106] Read of size 1 at addr ffff88810383f710 by task kunit_try_catch/286
[   20.964393] 
[   20.965106] CPU: 1 UID: 0 PID: 286 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc2-next-20250617 #1 PREEMPT(voluntary) 
[   20.965239] Tainted: [B]=BAD_PAGE, [N]=TEST
[   20.965275] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   20.965334] Call Trace:
[   20.965382]  <TASK>
[   20.965430]  dump_stack_lvl+0x73/0xb0
[   20.965516]  print_report+0xd1/0x650
[   20.965586]  ? __virt_addr_valid+0x1db/0x2d0
[   20.965623]  ? strnlen+0x73/0x80
[   20.965651]  ? kasan_complete_mode_report_info+0x64/0x200
[   20.965684]  ? strnlen+0x73/0x80
[   20.965712]  kasan_report+0x141/0x180
[   20.965741]  ? strnlen+0x73/0x80
[   20.965777]  __asan_report_load1_noabort+0x18/0x20
[   20.965811]  strnlen+0x73/0x80
[   20.965869]  kasan_strings+0x615/0xe80
[   20.965901]  ? trace_hardirqs_on+0x37/0xe0
[   20.965937]  ? __pfx_kasan_strings+0x10/0x10
[   20.965966]  ? finish_task_switch.isra.0+0x153/0x700
[   20.965999]  ? __switch_to+0x47/0xf50
[   20.966033]  ? __schedule+0x10cc/0x2b60
[   20.966060]  ? __pfx_read_tsc+0x10/0x10
[   20.966090]  ? ktime_get_ts64+0x86/0x230
[   20.966122]  kunit_try_run_case+0x1a5/0x480
[   20.966158]  ? __pfx_kunit_try_run_case+0x10/0x10
[   20.966190]  ? _raw_spin_lock_irqsave+0xa1/0x100
[   20.966228]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   20.966309]  ? __kthread_parkme+0x82/0x180
[   20.966362]  ? preempt_count_sub+0x50/0x80
[   20.966395]  ? __pfx_kunit_try_run_case+0x10/0x10
[   20.966429]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   20.966463]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   20.966496]  kthread+0x337/0x6f0
[   20.966524]  ? trace_preempt_on+0x20/0xc0
[   20.966556]  ? __pfx_kthread+0x10/0x10
[   20.966583]  ? _raw_spin_unlock_irq+0x47/0x80
[   20.966618]  ? calculate_sigpending+0x7b/0xa0
[   20.966651]  ? __pfx_kthread+0x10/0x10
[   20.966679]  ret_from_fork+0x116/0x1d0
[   20.966705]  ? __pfx_kthread+0x10/0x10
[   20.966732]  ret_from_fork_asm+0x1a/0x30
[   20.966773]  </TASK>
[   20.966787] 
[   20.985939] Allocated by task 286:
[   20.986337]  kasan_save_stack+0x45/0x70
[   20.986754]  kasan_save_track+0x18/0x40
[   20.987589]  kasan_save_alloc_info+0x3b/0x50
[   20.987964]  __kasan_kmalloc+0xb7/0xc0
[   20.988930]  __kmalloc_cache_noprof+0x189/0x420
[   20.989626]  kasan_strings+0xc0/0xe80
[   20.990040]  kunit_try_run_case+0x1a5/0x480
[   20.990653]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   20.991587]  kthread+0x337/0x6f0
[   20.991946]  ret_from_fork+0x116/0x1d0
[   20.992664]  ret_from_fork_asm+0x1a/0x30
[   20.993077] 
[   20.993291] Freed by task 286:
[   20.993559]  kasan_save_stack+0x45/0x70
[   20.993943]  kasan_save_track+0x18/0x40
[   20.994335]  kasan_save_free_info+0x3f/0x60
[   20.994740]  __kasan_slab_free+0x56/0x70
[   20.995361]  kfree+0x222/0x3f0
[   20.995626]  kasan_strings+0x2aa/0xe80
[   20.996003]  kunit_try_run_case+0x1a5/0x480
[   20.996904]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   20.997589]  kthread+0x337/0x6f0
[   20.997931]  ret_from_fork+0x116/0x1d0
[   20.998544]  ret_from_fork_asm+0x1a/0x30
[   20.998942] 
[   20.999114] The buggy address belongs to the object at ffff88810383f700
[   20.999114]  which belongs to the cache kmalloc-32 of size 32
[   21.000259] The buggy address is located 16 bytes inside of
[   21.000259]  freed 32-byte region [ffff88810383f700, ffff88810383f720)
[   21.001539] 
[   21.001910] The buggy address belongs to the physical page:
[   21.002584] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x10383f
[   21.003293] flags: 0x200000000000000(node=0|zone=2)
[   21.003723] page_type: f5(slab)
[   21.004205] raw: 0200000000000000 ffff888100041780 dead000000000122 0000000000000000
[   21.005081] raw: 0000000000000000 0000000080400040 00000000f5000000 0000000000000000
[   21.005811] page dumped because: kasan: bad access detected
[   21.006370] 
[   21.006720] Memory state around the buggy address:
[   21.007150]  ffff88810383f600: fa fb fb fb fc fc fc fc 00 00 00 fc fc fc fc fc
[   21.007930]  ffff88810383f680: 00 00 00 fc fc fc fc fc 00 00 07 fc fc fc fc fc
[   21.008571] >ffff88810383f700: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc
[   21.009618]                          ^
[   21.009993]  ffff88810383f780: fa fb fb fb fc fc fc fc 00 00 00 fc fc fc fc fc
[   21.010717]  ffff88810383f800: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc
[   21.011448] ==================================================================