Hay
Date
July 9, 2025, 12:11 a.m.

Environment
qemu-arm64
qemu-x86_64

[   21.923505] ==================================================================
[   21.923569] BUG: KASAN: slab-use-after-free in strnlen+0x80/0x88
[   21.923809] Read of size 1 at addr fff00000c6e97810 by task kunit_try_catch/260
[   21.923946] 
[   21.923983] CPU: 1 UID: 0 PID: 260 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc5 #1 PREEMPT 
[   21.924213] Tainted: [B]=BAD_PAGE, [N]=TEST
[   21.924261] Hardware name: linux,dummy-virt (DT)
[   21.924299] Call trace:
[   21.924326]  show_stack+0x20/0x38 (C)
[   21.924534]  dump_stack_lvl+0x8c/0xd0
[   21.924638]  print_report+0x118/0x608
[   21.924764]  kasan_report+0xdc/0x128
[   21.924852]  __asan_report_load1_noabort+0x20/0x30
[   21.925080]  strnlen+0x80/0x88
[   21.925211]  kasan_strings+0x478/0xb00
[   21.925298]  kunit_try_run_case+0x170/0x3f0
[   21.925454]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   21.925541]  kthread+0x328/0x630
[   21.925762]  ret_from_fork+0x10/0x20
[   21.925918] 
[   21.925982] Allocated by task 260:
[   21.926115]  kasan_save_stack+0x3c/0x68
[   21.926193]  kasan_save_track+0x20/0x40
[   21.926304]  kasan_save_alloc_info+0x40/0x58
[   21.926356]  __kasan_kmalloc+0xd4/0xd8
[   21.926580]  __kmalloc_cache_noprof+0x16c/0x3c0
[   21.926734]  kasan_strings+0xc8/0xb00
[   21.926838]  kunit_try_run_case+0x170/0x3f0
[   21.926924]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   21.927191]  kthread+0x328/0x630
[   21.927327]  ret_from_fork+0x10/0x20
[   21.927464] 
[   21.927530] Freed by task 260:
[   21.927623]  kasan_save_stack+0x3c/0x68
[   21.927812]  kasan_save_track+0x20/0x40
[   21.927921]  kasan_save_free_info+0x4c/0x78
[   21.928056]  __kasan_slab_free+0x6c/0x98
[   21.928126]  kfree+0x214/0x3c8
[   21.928246]  kasan_strings+0x24c/0xb00
[   21.928325]  kunit_try_run_case+0x170/0x3f0
[   21.928528]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   21.928648]  kthread+0x328/0x630
[   21.928816]  ret_from_fork+0x10/0x20
[   21.928880] 
[   21.928955] The buggy address belongs to the object at fff00000c6e97800
[   21.928955]  which belongs to the cache kmalloc-32 of size 32
[   21.929038] The buggy address is located 16 bytes inside of
[   21.929038]  freed 32-byte region [fff00000c6e97800, fff00000c6e97820)
[   21.929123] 
[   21.929147] The buggy address belongs to the physical page:
[   21.929190] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x106e97
[   21.929248] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   21.929311] page_type: f5(slab)
[   21.929353] raw: 0bfffe0000000000 fff00000c0001780 dead000000000122 0000000000000000
[   21.929431] raw: 0000000000000000 0000000080400040 00000000f5000000 0000000000000000
[   21.929477] page dumped because: kasan: bad access detected
[   21.929517] 
[   21.929540] Memory state around the buggy address:
[   21.929584]  fff00000c6e97700: 00 00 00 fc fc fc fc fc 00 00 00 fc fc fc fc fc
[   21.929631]  fff00000c6e97780: 00 00 00 fc fc fc fc fc 00 00 07 fc fc fc fc fc
[   21.929677] >fff00000c6e97800: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc
[   21.929727]                          ^
[   21.929759]  fff00000c6e97880: fa fb fb fb fc fc fc fc 00 00 00 fc fc fc fc fc
[   21.929805]  fff00000c6e97900: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc
[   21.929848] ==================================================================

[   14.704379] ==================================================================
[   14.704724] BUG: KASAN: slab-use-after-free in strnlen+0x73/0x80
[   14.705120] Read of size 1 at addr ffff888102ab8ed0 by task kunit_try_catch/276
[   14.705480] 
[   14.705629] CPU: 1 UID: 0 PID: 276 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc5 #1 PREEMPT(voluntary) 
[   14.705673] Tainted: [B]=BAD_PAGE, [N]=TEST
[   14.705685] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   14.705706] Call Trace:
[   14.705724]  <TASK>
[   14.705741]  dump_stack_lvl+0x73/0xb0
[   14.705806]  print_report+0xd1/0x650
[   14.705830]  ? __virt_addr_valid+0x1db/0x2d0
[   14.705853]  ? strnlen+0x73/0x80
[   14.705870]  ? kasan_complete_mode_report_info+0x64/0x200
[   14.705894]  ? strnlen+0x73/0x80
[   14.706012]  kasan_report+0x141/0x180
[   14.706041]  ? strnlen+0x73/0x80
[   14.706102]  __asan_report_load1_noabort+0x18/0x20
[   14.706129]  strnlen+0x73/0x80
[   14.706148]  kasan_strings+0x615/0xe80
[   14.706168]  ? trace_hardirqs_on+0x37/0xe0
[   14.706192]  ? __pfx_kasan_strings+0x10/0x10
[   14.706242]  ? finish_task_switch.isra.0+0x153/0x700
[   14.706280]  ? __switch_to+0x47/0xf50
[   14.706306]  ? __schedule+0x10cc/0x2b60
[   14.706328]  ? __pfx_read_tsc+0x10/0x10
[   14.706349]  ? ktime_get_ts64+0x86/0x230
[   14.706374]  kunit_try_run_case+0x1a5/0x480
[   14.706398]  ? __pfx_kunit_try_run_case+0x10/0x10
[   14.706421]  ? _raw_spin_lock_irqsave+0xa1/0x100
[   14.706446]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   14.706471]  ? __kthread_parkme+0x82/0x180
[   14.706491]  ? preempt_count_sub+0x50/0x80
[   14.706514]  ? __pfx_kunit_try_run_case+0x10/0x10
[   14.706540]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   14.706564]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   14.706590]  kthread+0x337/0x6f0
[   14.706609]  ? trace_preempt_on+0x20/0xc0
[   14.706631]  ? __pfx_kthread+0x10/0x10
[   14.706651]  ? _raw_spin_unlock_irq+0x47/0x80
[   14.706673]  ? calculate_sigpending+0x7b/0xa0
[   14.706697]  ? __pfx_kthread+0x10/0x10
[   14.706723]  ret_from_fork+0x116/0x1d0
[   14.706740]  ? __pfx_kthread+0x10/0x10
[   14.706761]  ret_from_fork_asm+0x1a/0x30
[   14.706792]  </TASK>
[   14.706803] 
[   14.715761] Allocated by task 276:
[   14.716042]  kasan_save_stack+0x45/0x70
[   14.716324]  kasan_save_track+0x18/0x40
[   14.716549]  kasan_save_alloc_info+0x3b/0x50
[   14.716737]  __kasan_kmalloc+0xb7/0xc0
[   14.717036]  __kmalloc_cache_noprof+0x189/0x420
[   14.717296]  kasan_strings+0xc0/0xe80
[   14.717515]  kunit_try_run_case+0x1a5/0x480
[   14.717738]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   14.718074]  kthread+0x337/0x6f0
[   14.718307]  ret_from_fork+0x116/0x1d0
[   14.718522]  ret_from_fork_asm+0x1a/0x30
[   14.718737] 
[   14.718831] Freed by task 276:
[   14.719089]  kasan_save_stack+0x45/0x70
[   14.719300]  kasan_save_track+0x18/0x40
[   14.719537]  kasan_save_free_info+0x3f/0x60
[   14.719768]  __kasan_slab_free+0x56/0x70
[   14.720227]  kfree+0x222/0x3f0
[   14.720426]  kasan_strings+0x2aa/0xe80
[   14.720615]  kunit_try_run_case+0x1a5/0x480
[   14.720790]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   14.721156]  kthread+0x337/0x6f0
[   14.721367]  ret_from_fork+0x116/0x1d0
[   14.721581]  ret_from_fork_asm+0x1a/0x30
[   14.721761] 
[   14.721886] The buggy address belongs to the object at ffff888102ab8ec0
[   14.721886]  which belongs to the cache kmalloc-32 of size 32
[   14.722518] The buggy address is located 16 bytes inside of
[   14.722518]  freed 32-byte region [ffff888102ab8ec0, ffff888102ab8ee0)
[   14.723064] 
[   14.723143] The buggy address belongs to the physical page:
[   14.723430] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x102ab8
[   14.723888] flags: 0x200000000000000(node=0|zone=2)
[   14.724171] page_type: f5(slab)
[   14.724322] raw: 0200000000000000 ffff888100041780 dead000000000122 0000000000000000
[   14.724733] raw: 0000000000000000 0000000000400040 00000000f5000000 0000000000000000
[   14.725276] page dumped because: kasan: bad access detected
[   14.725539] 
[   14.725650] Memory state around the buggy address:
[   14.725895]  ffff888102ab8d80: 00 00 07 fc fc fc fc fc 00 00 00 fc fc fc fc fc
[   14.726196]  ffff888102ab8e00: 00 00 00 fc fc fc fc fc 00 00 07 fc fc fc fc fc
[   14.726531] >ffff888102ab8e80: 00 00 00 fc fc fc fc fc fa fb fb fb fc fc fc fc
[   14.726856]                                                  ^
[   14.727203]  ffff888102ab8f00: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc
[   14.727500]  ffff888102ab8f80: 00 00 00 fc fc fc fc fc fa fb fb fb fc fc fc fc
[   14.727867] ==================================================================