Hay
Date
July 3, 2025, 11:10 p.m.

Environment
qemu-arm64
qemu-x86_64

[   22.614422] ==================================================================
[   22.614535] BUG: KASAN: slab-use-after-free in strnlen+0x80/0x88
[   22.614677] Read of size 1 at addr fff00000c6376cd0 by task kunit_try_catch/259
[   22.614789] 
[   22.614861] CPU: 0 UID: 0 PID: 259 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc4 #1 PREEMPT 
[   22.615049] Tainted: [B]=BAD_PAGE, [N]=TEST
[   22.615108] Hardware name: linux,dummy-virt (DT)
[   22.615182] Call trace:
[   22.615239]  show_stack+0x20/0x38 (C)
[   22.615363]  dump_stack_lvl+0x8c/0xd0
[   22.615489]  print_report+0x118/0x608
[   22.615651]  kasan_report+0xdc/0x128
[   22.615783]  __asan_report_load1_noabort+0x20/0x30
[   22.615880]  strnlen+0x80/0x88
[   22.615981]  kasan_strings+0x478/0xb00
[   22.616093]  kunit_try_run_case+0x170/0x3f0
[   22.616190]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   22.616301]  kthread+0x328/0x630
[   22.616397]  ret_from_fork+0x10/0x20
[   22.616520] 
[   22.616569] Allocated by task 259:
[   22.616687]  kasan_save_stack+0x3c/0x68
[   22.616790]  kasan_save_track+0x20/0x40
[   22.616892]  kasan_save_alloc_info+0x40/0x58
[   22.617005]  __kasan_kmalloc+0xd4/0xd8
[   22.617163]  __kmalloc_cache_noprof+0x16c/0x3c0
[   22.617287]  kasan_strings+0xc8/0xb00
[   22.617366]  kunit_try_run_case+0x170/0x3f0
[   22.617445]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   22.617536]  kthread+0x328/0x630
[   22.617606]  ret_from_fork+0x10/0x20
[   22.617720] 
[   22.617800] Freed by task 259:
[   22.617973]  kasan_save_stack+0x3c/0x68
[   22.618193]  kasan_save_track+0x20/0x40
[   22.618498]  kasan_save_free_info+0x4c/0x78
[   22.618596]  __kasan_slab_free+0x6c/0x98
[   22.618689]  kfree+0x214/0x3c8
[   22.618792]  kasan_strings+0x24c/0xb00
[   22.618871]  kunit_try_run_case+0x170/0x3f0
[   22.618993]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   22.619154]  kthread+0x328/0x630
[   22.619271]  ret_from_fork+0x10/0x20
[   22.619394] 
[   22.619443] The buggy address belongs to the object at fff00000c6376cc0
[   22.619443]  which belongs to the cache kmalloc-32 of size 32
[   22.619583] The buggy address is located 16 bytes inside of
[   22.619583]  freed 32-byte region [fff00000c6376cc0, fff00000c6376ce0)
[   22.619734] 
[   22.619787] The buggy address belongs to the physical page:
[   22.619861] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x106376
[   22.619988] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   22.620120] page_type: f5(slab)
[   22.620212] raw: 0bfffe0000000000 fff00000c0001780 dead000000000122 0000000000000000
[   22.620334] raw: 0000000000000000 0000000080400040 00000000f5000000 0000000000000000
[   22.620438] page dumped because: kasan: bad access detected
[   22.620537] 
[   22.620627] Memory state around the buggy address:
[   22.620750]  fff00000c6376b80: fa fb fb fb fc fc fc fc 00 00 00 fc fc fc fc fc
[   22.620860]  fff00000c6376c00: 00 00 00 fc fc fc fc fc 00 00 00 fc fc fc fc fc
[   22.620967] >fff00000c6376c80: 00 00 07 fc fc fc fc fc fa fb fb fb fc fc fc fc
[   22.621067]                                                  ^
[   22.621154]  fff00000c6376d00: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc
[   22.621258]  fff00000c6376d80: 00 00 00 fc fc fc fc fc fa fb fb fb fc fc fc fc
[   22.621345] ==================================================================

[   13.589109] ==================================================================
[   13.589924] BUG: KASAN: slab-use-after-free in strnlen+0x73/0x80
[   13.590133] Read of size 1 at addr ffff8881039c45d0 by task kunit_try_catch/276
[   13.590450] 
[   13.590666] CPU: 1 UID: 0 PID: 276 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc4 #1 PREEMPT(voluntary) 
[   13.590711] Tainted: [B]=BAD_PAGE, [N]=TEST
[   13.590723] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   13.590742] Call Trace:
[   13.590758]  <TASK>
[   13.590772]  dump_stack_lvl+0x73/0xb0
[   13.590822]  print_report+0xd1/0x650
[   13.590844]  ? __virt_addr_valid+0x1db/0x2d0
[   13.590865]  ? strnlen+0x73/0x80
[   13.590882]  ? kasan_complete_mode_report_info+0x64/0x200
[   13.590905]  ? strnlen+0x73/0x80
[   13.590922]  kasan_report+0x141/0x180
[   13.590943]  ? strnlen+0x73/0x80
[   13.590965]  __asan_report_load1_noabort+0x18/0x20
[   13.590988]  strnlen+0x73/0x80
[   13.591006]  kasan_strings+0x615/0xe80
[   13.591025]  ? trace_hardirqs_on+0x37/0xe0
[   13.591047]  ? __pfx_kasan_strings+0x10/0x10
[   13.591068]  ? __kasan_check_write+0x18/0x20
[   13.591086]  ? queued_spin_lock_slowpath+0x116/0xb40
[   13.591108]  ? irqentry_exit+0x2a/0x60
[   13.591139]  ? sysvec_apic_timer_interrupt+0x50/0x90
[   13.591162]  ? trace_hardirqs_on+0x37/0xe0
[   13.591183]  ? __pfx_read_tsc+0x10/0x10
[   13.591204]  ? ktime_get_ts64+0x86/0x230
[   13.591227]  kunit_try_run_case+0x1a5/0x480
[   13.591251]  ? __pfx_kunit_try_run_case+0x10/0x10
[   13.591274]  ? queued_spin_lock_slowpath+0x116/0xb40
[   13.591296]  ? __kthread_parkme+0x82/0x180
[   13.591335]  ? preempt_count_sub+0x50/0x80
[   13.591374]  ? __pfx_kunit_try_run_case+0x10/0x10
[   13.591398]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   13.591420]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   13.591443]  kthread+0x337/0x6f0
[   13.591462]  ? trace_preempt_on+0x20/0xc0
[   13.591482]  ? __pfx_kthread+0x10/0x10
[   13.591503]  ? _raw_spin_unlock_irq+0x47/0x80
[   13.591523]  ? calculate_sigpending+0x7b/0xa0
[   13.591545]  ? __pfx_kthread+0x10/0x10
[   13.591566]  ret_from_fork+0x116/0x1d0
[   13.591583]  ? __pfx_kthread+0x10/0x10
[   13.591604]  ret_from_fork_asm+0x1a/0x30
[   13.591633]  </TASK>
[   13.591643] 
[   13.600136] Allocated by task 276:
[   13.600267]  kasan_save_stack+0x45/0x70
[   13.600486]  kasan_save_track+0x18/0x40
[   13.600678]  kasan_save_alloc_info+0x3b/0x50
[   13.600890]  __kasan_kmalloc+0xb7/0xc0
[   13.601279]  __kmalloc_cache_noprof+0x189/0x420
[   13.601447]  kasan_strings+0xc0/0xe80
[   13.601582]  kunit_try_run_case+0x1a5/0x480
[   13.601787]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   13.602039]  kthread+0x337/0x6f0
[   13.602505]  ret_from_fork+0x116/0x1d0
[   13.602706]  ret_from_fork_asm+0x1a/0x30
[   13.602879] 
[   13.602951] Freed by task 276:
[   13.603109]  kasan_save_stack+0x45/0x70
[   13.603410]  kasan_save_track+0x18/0x40
[   13.603600]  kasan_save_free_info+0x3f/0x60
[   13.603816]  __kasan_slab_free+0x56/0x70
[   13.603988]  kfree+0x222/0x3f0
[   13.604177]  kasan_strings+0x2aa/0xe80
[   13.604463]  kunit_try_run_case+0x1a5/0x480
[   13.604623]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   13.604798]  kthread+0x337/0x6f0
[   13.604918]  ret_from_fork+0x116/0x1d0
[   13.605049]  ret_from_fork_asm+0x1a/0x30
[   13.605417] 
[   13.605516] The buggy address belongs to the object at ffff8881039c45c0
[   13.605516]  which belongs to the cache kmalloc-32 of size 32
[   13.606037] The buggy address is located 16 bytes inside of
[   13.606037]  freed 32-byte region [ffff8881039c45c0, ffff8881039c45e0)
[   13.606971] 
[   13.607075] The buggy address belongs to the physical page:
[   13.607418] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1039c4
[   13.607755] flags: 0x200000000000000(node=0|zone=2)
[   13.607986] page_type: f5(slab)
[   13.608215] raw: 0200000000000000 ffff888100041780 dead000000000122 0000000000000000
[   13.608449] raw: 0000000000000000 0000000080400040 00000000f5000000 0000000000000000
[   13.608867] page dumped because: kasan: bad access detected
[   13.609160] 
[   13.609274] Memory state around the buggy address:
[   13.609525]  ffff8881039c4480: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc
[   13.609786]  ffff8881039c4500: 00 00 00 fc fc fc fc fc 00 00 00 fc fc fc fc fc
[   13.610151] >ffff8881039c4580: 00 00 07 fc fc fc fc fc fa fb fb fb fc fc fc fc
[   13.610487]                                                  ^
[   13.610850]  ffff8881039c4600: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc
[   13.611136]  ffff8881039c4680: 00 00 00 fc fc fc fc fc fa fb fb fb fc fc fc fc
[   13.611646] ==================================================================