Hay
Date
June 7, 2025, 10:40 a.m.

Environment
qemu-arm64
qemu-x86_64

[   24.197934] ==================================================================
[   24.199329] BUG: KASAN: slab-use-after-free in strnlen+0x80/0x88
[   24.200120] Read of size 1 at addr fff00000c41f1950 by task kunit_try_catch/247
[   24.201656] 
[   24.202155] CPU: 1 UID: 0 PID: 247 Comm: kunit_try_catch Tainted: G    B            N 6.12.33-rc1 #1
[   24.202377] Tainted: [B]=BAD_PAGE, [N]=TEST
[   24.202458] Hardware name: linux,dummy-virt (DT)
[   24.202505] Call trace:
[   24.202535]  dump_backtrace+0x9c/0x128
[   24.202592]  show_stack+0x20/0x38
[   24.202637]  dump_stack_lvl+0x8c/0xd0
[   24.202686]  print_report+0x118/0x5f0
[   24.202732]  kasan_report+0xdc/0x128
[   24.202778]  __asan_report_load1_noabort+0x20/0x30
[   24.202831]  strnlen+0x80/0x88
[   24.202878]  kasan_strings+0x398/0x938
[   24.202925]  kunit_try_run_case+0x170/0x3f0
[   24.203001]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   24.203065]  kthread+0x24c/0x2d0
[   24.203111]  ret_from_fork+0x10/0x20
[   24.203161] 
[   24.211891] Allocated by task 247:
[   24.212981]  kasan_save_stack+0x3c/0x68
[   24.214094]  kasan_save_track+0x20/0x40
[   24.214709]  kasan_save_alloc_info+0x40/0x58
[   24.215140]  __kasan_kmalloc+0xd4/0xd8
[   24.216090]  __kmalloc_cache_noprof+0x154/0x320
[   24.216945]  kasan_strings+0xb0/0x938
[   24.217514]  kunit_try_run_case+0x170/0x3f0
[   24.218136]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   24.218809]  kthread+0x24c/0x2d0
[   24.219316]  ret_from_fork+0x10/0x20
[   24.220329] 
[   24.220476] Freed by task 247:
[   24.220657]  kasan_save_stack+0x3c/0x68
[   24.220896]  kasan_save_track+0x20/0x40
[   24.221294]  kasan_save_free_info+0x4c/0x78
[   24.221863]  __kasan_slab_free+0x6c/0x98
[   24.222638]  kfree+0x110/0x3b8
[   24.223067]  kasan_strings+0x128/0x938
[   24.223759]  kunit_try_run_case+0x170/0x3f0
[   24.224354]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   24.225036]  kthread+0x24c/0x2d0
[   24.225502]  ret_from_fork+0x10/0x20
[   24.226375] 
[   24.226752] The buggy address belongs to the object at fff00000c41f1940
[   24.226752]  which belongs to the cache kmalloc-32 of size 32
[   24.228635] The buggy address is located 16 bytes inside of
[   24.228635]  freed 32-byte region [fff00000c41f1940, fff00000c41f1960)
[   24.229892] 
[   24.230298] The buggy address belongs to the physical page:
[   24.230871] page: refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1041f1
[   24.231921] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   24.232939] page_type: f5(slab)
[   24.233497] raw: 0bfffe0000000000 fff00000c0001780 dead000000000122 0000000000000000
[   24.234397] raw: 0000000000000000 0000000080400040 00000001f5000000 0000000000000000
[   24.235193] page dumped because: kasan: bad access detected
[   24.236349] 
[   24.236746] Memory state around the buggy address:
[   24.237420]  fff00000c41f1800: fa fb fb fb fc fc fc fc 00 00 00 fc fc fc fc fc
[   24.238253]  fff00000c41f1880: 00 00 00 fc fc fc fc fc 00 00 00 fc fc fc fc fc
[   24.239042] >fff00000c41f1900: 00 00 07 fc fc fc fc fc fa fb fb fb fc fc fc fc
[   24.240039]                                                  ^
[   24.241070]  fff00000c41f1980: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   24.241807]  fff00000c41f1a00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   24.242480] ==================================================================

[   20.941586] ==================================================================
[   20.942247] BUG: KASAN: slab-use-after-free in strnlen+0x73/0x80
[   20.942674] Read of size 1 at addr ffff888102af74d0 by task kunit_try_catch/264
[   20.945100] 
[   20.945303] CPU: 1 UID: 0 PID: 264 Comm: kunit_try_catch Tainted: G    B            N 6.12.33-rc1 #1
[   20.945396] Tainted: [B]=BAD_PAGE, [N]=TEST
[   20.945437] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   20.945596] Call Trace:
[   20.945657]  <TASK>
[   20.945712]  dump_stack_lvl+0x73/0xb0
[   20.945799]  print_report+0xd1/0x640
[   20.945883]  ? __virt_addr_valid+0x1db/0x2d0
[   20.945959]  ? strnlen+0x73/0x80
[   20.945990]  ? kasan_complete_mode_report_info+0x64/0x200
[   20.946023]  ? strnlen+0x73/0x80
[   20.946050]  kasan_report+0x140/0x180
[   20.946085]  ? strnlen+0x73/0x80
[   20.946118]  __asan_report_load1_noabort+0x18/0x20
[   20.946149]  strnlen+0x73/0x80
[   20.946179]  kasan_strings+0x4cc/0xb60
[   20.946212]  ? __pfx_kasan_strings+0x10/0x10
[   20.946273]  ? __schedule+0xc49/0x27a0
[   20.946303]  ? __pfx_read_tsc+0x10/0x10
[   20.946329]  ? ktime_get_ts64+0x84/0x230
[   20.946364]  kunit_try_run_case+0x1a6/0x480
[   20.946396]  ? __pfx_kunit_try_run_case+0x10/0x10
[   20.946424]  ? _raw_spin_lock_irqsave+0xa2/0x110
[   20.946464]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   20.946750]  ? __kthread_parkme+0x82/0x160
[   20.946781]  ? preempt_count_sub+0x50/0x80
[   20.946818]  ? __pfx_kunit_try_run_case+0x10/0x10
[   20.946887]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   20.946926]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   20.946965]  kthread+0x257/0x310
[   20.946992]  ? __pfx_kthread+0x10/0x10
[   20.947018]  ret_from_fork+0x41/0x80
[   20.947048]  ? __pfx_kthread+0x10/0x10
[   20.947074]  ret_from_fork_asm+0x1a/0x30
[   20.947114]  </TASK>
[   20.947128] 
[   20.964351] Allocated by task 264:
[   20.965012]  kasan_save_stack+0x45/0x70
[   20.966015]  kasan_save_track+0x18/0x40
[   20.966349]  kasan_save_alloc_info+0x3b/0x50
[   20.967089]  __kasan_kmalloc+0xb7/0xc0
[   20.968046]  __kmalloc_cache_noprof+0x168/0x350
[   20.968725]  kasan_strings+0xb3/0xb60
[   20.969263]  kunit_try_run_case+0x1a6/0x480
[   20.969782]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   20.970596]  kthread+0x257/0x310
[   20.971049]  ret_from_fork+0x41/0x80
[   20.972034]  ret_from_fork_asm+0x1a/0x30
[   20.972453] 
[   20.972970] Freed by task 264:
[   20.973671]  kasan_save_stack+0x45/0x70
[   20.974424]  kasan_save_track+0x18/0x40
[   20.975162]  kasan_save_free_info+0x3f/0x60
[   20.976118]  __kasan_slab_free+0x56/0x70
[   20.976541]  kfree+0x123/0x3d0
[   20.977325]  kasan_strings+0x13a/0xb60
[   20.978103]  kunit_try_run_case+0x1a6/0x480
[   20.979061]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   20.979483]  kthread+0x257/0x310
[   20.979833]  ret_from_fork+0x41/0x80
[   20.980453]  ret_from_fork_asm+0x1a/0x30
[   20.980947] 
[   20.981190] The buggy address belongs to the object at ffff888102af74c0
[   20.981190]  which belongs to the cache kmalloc-32 of size 32
[   20.982924] The buggy address is located 16 bytes inside of
[   20.982924]  freed 32-byte region [ffff888102af74c0, ffff888102af74e0)
[   20.984450] 
[   20.984650] The buggy address belongs to the physical page:
[   20.985983] page: refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x102af7
[   20.986861] flags: 0x200000000000000(node=0|zone=2)
[   20.987292] page_type: f5(slab)
[   20.987690] raw: 0200000000000000 ffff888100041780 dead000000000122 0000000000000000
[   20.988987] raw: 0000000000000000 0000000080400040 00000001f5000000 0000000000000000
[   20.989879] page dumped because: kasan: bad access detected
[   20.990392] 
[   20.990662] Memory state around the buggy address:
[   20.991398]  ffff888102af7380: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc
[   20.992343]  ffff888102af7400: 00 00 00 fc fc fc fc fc 00 00 00 fc fc fc fc fc
[   20.992819] >ffff888102af7480: 00 00 07 fc fc fc fc fc fa fb fb fb fc fc fc fc
[   20.993336]                                                  ^
[   20.993751]  ffff888102af7500: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   20.994573]  ffff888102af7580: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   20.995135] ==================================================================