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

Environment
qemu-arm64
qemu-x86_64

[   24.154210] ==================================================================
[   24.154925] BUG: KASAN: slab-use-after-free in strlen+0xa8/0xb0
[   24.155711] Read of size 1 at addr fff00000c41f1950 by task kunit_try_catch/247
[   24.156438] 
[   24.156664] CPU: 1 UID: 0 PID: 247 Comm: kunit_try_catch Tainted: G    B            N 6.12.33-rc1 #1
[   24.156774] Tainted: [B]=BAD_PAGE, [N]=TEST
[   24.156810] Hardware name: linux,dummy-virt (DT)
[   24.156849] Call trace:
[   24.156877]  dump_backtrace+0x9c/0x128
[   24.156935]  show_stack+0x20/0x38
[   24.157039]  dump_stack_lvl+0x8c/0xd0
[   24.157158]  print_report+0x118/0x5f0
[   24.157281]  kasan_report+0xdc/0x128
[   24.157397]  __asan_report_load1_noabort+0x20/0x30
[   24.157527]  strlen+0xa8/0xb0
[   24.157643]  kasan_strings+0x334/0x938
[   24.157771]  kunit_try_run_case+0x170/0x3f0
[   24.157893]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   24.158042]  kthread+0x24c/0x2d0
[   24.158157]  ret_from_fork+0x10/0x20
[   24.158275] 
[   24.166325] Allocated by task 247:
[   24.166817]  kasan_save_stack+0x3c/0x68
[   24.167281]  kasan_save_track+0x20/0x40
[   24.168035]  kasan_save_alloc_info+0x40/0x58
[   24.168654]  __kasan_kmalloc+0xd4/0xd8
[   24.169212]  __kmalloc_cache_noprof+0x154/0x320
[   24.169847]  kasan_strings+0xb0/0x938
[   24.170379]  kunit_try_run_case+0x170/0x3f0
[   24.170923]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   24.171666]  kthread+0x24c/0x2d0
[   24.172174]  ret_from_fork+0x10/0x20
[   24.172700] 
[   24.173037] Freed by task 247:
[   24.173464]  kasan_save_stack+0x3c/0x68
[   24.174930]  kasan_save_track+0x20/0x40
[   24.175343]  kasan_save_free_info+0x4c/0x78
[   24.176097]  __kasan_slab_free+0x6c/0x98
[   24.176622]  kfree+0x110/0x3b8
[   24.177509]  kasan_strings+0x128/0x938
[   24.177905]  kunit_try_run_case+0x170/0x3f0
[   24.178630]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   24.179423]  kthread+0x24c/0x2d0
[   24.180083]  ret_from_fork+0x10/0x20
[   24.180511] 
[   24.180797] The buggy address belongs to the object at fff00000c41f1940
[   24.180797]  which belongs to the cache kmalloc-32 of size 32
[   24.181887] The buggy address is located 16 bytes inside of
[   24.181887]  freed 32-byte region [fff00000c41f1940, fff00000c41f1960)
[   24.184130] 
[   24.184532] The buggy address belongs to the physical page:
[   24.185165] page: refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1041f1
[   24.185898] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   24.186825] page_type: f5(slab)
[   24.187265] raw: 0bfffe0000000000 fff00000c0001780 dead000000000122 0000000000000000
[   24.188521] raw: 0000000000000000 0000000080400040 00000001f5000000 0000000000000000
[   24.189240] page dumped because: kasan: bad access detected
[   24.189988] 
[   24.190460] Memory state around the buggy address:
[   24.191173]  fff00000c41f1800: fa fb fb fb fc fc fc fc 00 00 00 fc fc fc fc fc
[   24.192155]  fff00000c41f1880: 00 00 00 fc fc fc fc fc 00 00 00 fc fc fc fc fc
[   24.192876] >fff00000c41f1900: 00 00 07 fc fc fc fc fc fa fb fb fb fc fc fc fc
[   24.193606]                                                  ^
[   24.194205]  fff00000c41f1980: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   24.195127]  fff00000c41f1a00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   24.196205] ==================================================================

[   20.890202] ==================================================================
[   20.890987] BUG: KASAN: slab-use-after-free in strlen+0x8f/0xb0
[   20.891851] Read of size 1 at addr ffff888102af74d0 by task kunit_try_catch/264
[   20.892421] 
[   20.892691] CPU: 1 UID: 0 PID: 264 Comm: kunit_try_catch Tainted: G    B            N 6.12.33-rc1 #1
[   20.892849] Tainted: [B]=BAD_PAGE, [N]=TEST
[   20.892982] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   20.893043] Call Trace:
[   20.893099]  <TASK>
[   20.893150]  dump_stack_lvl+0x73/0xb0
[   20.893247]  print_report+0xd1/0x640
[   20.893332]  ? __virt_addr_valid+0x1db/0x2d0
[   20.893408]  ? strlen+0x8f/0xb0
[   20.893916]  ? kasan_complete_mode_report_info+0x64/0x200
[   20.893993]  ? strlen+0x8f/0xb0
[   20.894063]  kasan_report+0x140/0x180
[   20.894111]  ? strlen+0x8f/0xb0
[   20.894147]  __asan_report_load1_noabort+0x18/0x20
[   20.894179]  strlen+0x8f/0xb0
[   20.894208]  kasan_strings+0x432/0xb60
[   20.894273]  ? __pfx_kasan_strings+0x10/0x10
[   20.894308]  ? __schedule+0xc49/0x27a0
[   20.894336]  ? __pfx_read_tsc+0x10/0x10
[   20.894362]  ? ktime_get_ts64+0x84/0x230
[   20.894398]  kunit_try_run_case+0x1a6/0x480
[   20.894431]  ? __pfx_kunit_try_run_case+0x10/0x10
[   20.894528]  ? _raw_spin_lock_irqsave+0xa2/0x110
[   20.894597]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   20.894633]  ? __kthread_parkme+0x82/0x160
[   20.894663]  ? preempt_count_sub+0x50/0x80
[   20.894695]  ? __pfx_kunit_try_run_case+0x10/0x10
[   20.894724]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   20.894761]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   20.894798]  kthread+0x257/0x310
[   20.894862]  ? __pfx_kthread+0x10/0x10
[   20.894893]  ret_from_fork+0x41/0x80
[   20.894922]  ? __pfx_kthread+0x10/0x10
[   20.894947]  ret_from_fork_asm+0x1a/0x30
[   20.894987]  </TASK>
[   20.895002] 
[   20.910850] Allocated by task 264:
[   20.911627]  kasan_save_stack+0x45/0x70
[   20.912055]  kasan_save_track+0x18/0x40
[   20.912704]  kasan_save_alloc_info+0x3b/0x50
[   20.913216]  __kasan_kmalloc+0xb7/0xc0
[   20.913737]  __kmalloc_cache_noprof+0x168/0x350
[   20.914700]  kasan_strings+0xb3/0xb60
[   20.915304]  kunit_try_run_case+0x1a6/0x480
[   20.916026]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   20.916678]  kthread+0x257/0x310
[   20.917128]  ret_from_fork+0x41/0x80
[   20.917968]  ret_from_fork_asm+0x1a/0x30
[   20.918393] 
[   20.918622] Freed by task 264:
[   20.918988]  kasan_save_stack+0x45/0x70
[   20.919756]  kasan_save_track+0x18/0x40
[   20.920177]  kasan_save_free_info+0x3f/0x60
[   20.920806]  __kasan_slab_free+0x56/0x70
[   20.921238]  kfree+0x123/0x3d0
[   20.922068]  kasan_strings+0x13a/0xb60
[   20.922456]  kunit_try_run_case+0x1a6/0x480
[   20.922826]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   20.923377]  kthread+0x257/0x310
[   20.923720]  ret_from_fork+0x41/0x80
[   20.924150]  ret_from_fork_asm+0x1a/0x30
[   20.924790] 
[   20.925016] The buggy address belongs to the object at ffff888102af74c0
[   20.925016]  which belongs to the cache kmalloc-32 of size 32
[   20.926296] The buggy address is located 16 bytes inside of
[   20.926296]  freed 32-byte region [ffff888102af74c0, ffff888102af74e0)
[   20.927700] 
[   20.927986] The buggy address belongs to the physical page:
[   20.928612] page: refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x102af7
[   20.929332] flags: 0x200000000000000(node=0|zone=2)
[   20.930291] page_type: f5(slab)
[   20.931107] raw: 0200000000000000 ffff888100041780 dead000000000122 0000000000000000
[   20.931848] raw: 0000000000000000 0000000080400040 00000001f5000000 0000000000000000
[   20.932800] page dumped because: kasan: bad access detected
[   20.933361] 
[   20.934151] Memory state around the buggy address:
[   20.934493]  ffff888102af7380: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc
[   20.935458]  ffff888102af7400: 00 00 00 fc fc fc fc fc 00 00 00 fc fc fc fc fc
[   20.936350] >ffff888102af7480: 00 00 07 fc fc fc fc fc fa fb fb fb fc fc fc fc
[   20.937357]                                                  ^
[   20.938659]  ffff888102af7500: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   20.939947]  ffff888102af7580: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   20.940453] ==================================================================