Hay
Date
May 12, 2025, 6:12 p.m.

Environment
qemu-arm64
qemu-x86_64

[   20.834207] ==================================================================
[   20.834719] BUG: KASAN: slab-use-after-free in strnlen+0x80/0x88
[   20.836304] Read of size 1 at addr fff00000c66e72d0 by task kunit_try_catch/248
[   20.836866] 
[   20.837025] CPU: 1 UID: 0 PID: 248 Comm: kunit_try_catch Tainted: G    B            N 6.14.7-rc1 #1
[   20.837124] Tainted: [B]=BAD_PAGE, [N]=TEST
[   20.837158] Hardware name: linux,dummy-virt (DT)
[   20.837196] Call trace:
[   20.837224]  show_stack+0x20/0x38 (C)
[   20.837289]  dump_stack_lvl+0x8c/0xd0
[   20.837343]  print_report+0x118/0x608
[   20.837400]  kasan_report+0xdc/0x128
[   20.837453]  __asan_report_load1_noabort+0x20/0x30
[   20.837507]  strnlen+0x80/0x88
[   20.837556]  kasan_strings+0x364/0x8d8
[   20.837607]  kunit_try_run_case+0x170/0x3f0
[   20.837661]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   20.837718]  kthread+0x318/0x620
[   20.837795]  ret_from_fork+0x10/0x20
[   20.837852] 
[   20.841698] Allocated by task 248:
[   20.842018]  kasan_save_stack+0x3c/0x68
[   20.842295]  kasan_save_track+0x20/0x40
[   20.842658]  kasan_save_alloc_info+0x40/0x58
[   20.843028]  __kasan_kmalloc+0xd4/0xd8
[   20.843203]  __kmalloc_cache_noprof+0x15c/0x3c0
[   20.843573]  kasan_strings+0xb0/0x8d8
[   20.843783]  kunit_try_run_case+0x170/0x3f0
[   20.844044]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   20.844304]  kthread+0x318/0x620
[   20.844534]  ret_from_fork+0x10/0x20
[   20.844723] 
[   20.844998] Freed by task 248:
[   20.845297]  kasan_save_stack+0x3c/0x68
[   20.845516]  kasan_save_track+0x20/0x40
[   20.845782]  kasan_save_free_info+0x4c/0x78
[   20.845955]  __kasan_slab_free+0x6c/0x98
[   20.846135]  kfree+0x214/0x3c8
[   20.846366]  kasan_strings+0x124/0x8d8
[   20.846858]  kunit_try_run_case+0x170/0x3f0
[   20.847332]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   20.847696]  kthread+0x318/0x620
[   20.847869]  ret_from_fork+0x10/0x20
[   20.848232] 
[   20.848427] The buggy address belongs to the object at fff00000c66e72c0
[   20.848427]  which belongs to the cache kmalloc-32 of size 32
[   20.849106] The buggy address is located 16 bytes inside of
[   20.849106]  freed 32-byte region [fff00000c66e72c0, fff00000c66e72e0)
[   20.849596] 
[   20.849811] The buggy address belongs to the physical page:
[   20.850139] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1066e7
[   20.850816] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   20.851389] page_type: f5(slab)
[   20.851632] raw: 0bfffe0000000000 fff00000c0001780 dead000000000122 0000000000000000
[   20.852049] raw: 0000000000000000 0000000080400040 00000000f5000000 0000000000000000
[   20.852458] page dumped because: kasan: bad access detected
[   20.852775] 
[   20.852976] Memory state around the buggy address:
[   20.853204]  fff00000c66e7180: 00 00 00 fc fc fc fc fc fa fb fb fb fc fc fc fc
[   20.853678]  fff00000c66e7200: fa fb fb fb fc fc fc fc 00 00 07 fc fc fc fc fc
[   20.854236] >fff00000c66e7280: 00 00 00 fc fc fc fc fc fa fb fb fb fc fc fc fc
[   20.854983]                                                  ^
[   20.855268]  fff00000c66e7300: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc
[   20.855514]  fff00000c66e7380: 00 00 00 fc fc fc fc fc fa fb fb fb fc fc fc fc
[   20.855733] ==================================================================

[   14.386432] ==================================================================
[   14.386813] BUG: KASAN: slab-use-after-free in strnlen+0x73/0x80
[   14.387764] Read of size 1 at addr ffff888101b3b550 by task kunit_try_catch/267
[   14.388076] 
[   14.388208] CPU: 1 UID: 0 PID: 267 Comm: kunit_try_catch Tainted: G    B            N 6.14.7-rc1 #1
[   14.388255] Tainted: [B]=BAD_PAGE, [N]=TEST
[   14.388267] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   14.388290] Call Trace:
[   14.388323]  <TASK>
[   14.388344]  dump_stack_lvl+0x73/0xb0
[   14.388373]  print_report+0xd1/0x650
[   14.388395]  ? __virt_addr_valid+0x1db/0x2d0
[   14.388417]  ? strnlen+0x73/0x80
[   14.388438]  ? kasan_complete_mode_report_info+0x64/0x200
[   14.388463]  ? strnlen+0x73/0x80
[   14.388483]  kasan_report+0x140/0x180
[   14.388504]  ? strnlen+0x73/0x80
[   14.388528]  __asan_report_load1_noabort+0x18/0x20
[   14.388550]  strnlen+0x73/0x80
[   14.388571]  kasan_strings+0x4c3/0xb60
[   14.388591]  ? __pfx_kasan_strings+0x10/0x10
[   14.388614]  ? ktime_get_ts64+0xfb/0x230
[   14.388637]  ? ktime_get_ts64+0x86/0x230
[   14.388660]  kunit_try_run_case+0x1a6/0x480
[   14.388684]  ? __pfx_kunit_try_run_case+0x10/0x10
[   14.388704]  ? _raw_spin_lock_irqsave+0xa2/0x110
[   14.388726]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   14.388751]  ? __kthread_parkme+0x82/0x160
[   14.388773]  ? preempt_count_sub+0x50/0x80
[   14.388797]  ? __pfx_kunit_try_run_case+0x10/0x10
[   14.388819]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   14.388876]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   14.388903]  kthread+0x324/0x6e0
[   14.388924]  ? trace_preempt_on+0x20/0xc0
[   14.388964]  ? __pfx_kthread+0x10/0x10
[   14.388986]  ? _raw_spin_unlock_irq+0x47/0x80
[   14.389009]  ? calculate_sigpending+0x7b/0xa0
[   14.389048]  ? __pfx_kthread+0x10/0x10
[   14.389070]  ret_from_fork+0x41/0x80
[   14.389089]  ? __pfx_kthread+0x10/0x10
[   14.389111]  ret_from_fork_asm+0x1a/0x30
[   14.389142]  </TASK>
[   14.389153] 
[   14.396008] Allocated by task 267:
[   14.396234]  kasan_save_stack+0x45/0x70
[   14.396444]  kasan_save_track+0x18/0x40
[   14.396618]  kasan_save_alloc_info+0x3b/0x50
[   14.396853]  __kasan_kmalloc+0xb7/0xc0
[   14.397001]  __kmalloc_cache_noprof+0x18a/0x420
[   14.397245]  kasan_strings+0xb9/0xb60
[   14.397440]  kunit_try_run_case+0x1a6/0x480
[   14.397613]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   14.397929]  kthread+0x324/0x6e0
[   14.398238]  ret_from_fork+0x41/0x80
[   14.398431]  ret_from_fork_asm+0x1a/0x30
[   14.398625] 
[   14.398713] Freed by task 267:
[   14.398873]  kasan_save_stack+0x45/0x70
[   14.399024]  kasan_save_track+0x18/0x40
[   14.399262]  kasan_save_free_info+0x3f/0x60
[   14.399509]  __kasan_slab_free+0x56/0x70
[   14.399644]  kfree+0x224/0x3f0
[   14.399761]  kasan_strings+0x13c/0xb60
[   14.399971]  kunit_try_run_case+0x1a6/0x480
[   14.400406]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   14.400682]  kthread+0x324/0x6e0
[   14.400898]  ret_from_fork+0x41/0x80
[   14.401029]  ret_from_fork_asm+0x1a/0x30
[   14.401249] 
[   14.401342] The buggy address belongs to the object at ffff888101b3b540
[   14.401342]  which belongs to the cache kmalloc-32 of size 32
[   14.401805] The buggy address is located 16 bytes inside of
[   14.401805]  freed 32-byte region [ffff888101b3b540, ffff888101b3b560)
[   14.402214] 
[   14.402332] The buggy address belongs to the physical page:
[   14.402609] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x101b3b
[   14.402993] flags: 0x200000000000000(node=0|zone=2)
[   14.403253] page_type: f5(slab)
[   14.403448] raw: 0200000000000000 ffff888100041780 dead000000000122 0000000000000000
[   14.403702] raw: 0000000000000000 0000000080400040 00000000f5000000 0000000000000000
[   14.404019] page dumped because: kasan: bad access detected
[   14.404366] 
[   14.404548] Memory state around the buggy address:
[   14.404771]  ffff888101b3b400: 00 00 00 04 fc fc fc fc fa fb fb fb fc fc fc fc
[   14.405083]  ffff888101b3b480: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc
[   14.405367] >ffff888101b3b500: 00 00 00 fc fc fc fc fc fa fb fb fb fc fc fc fc
[   14.405663]                                                  ^
[   14.405874]  ffff888101b3b580: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc
[   14.406200]  ffff888101b3b600: 00 00 00 fc fc fc fc fc fa fb fb fb fc fc fc fc
[   14.406514] ==================================================================