Hay
Date
May 29, 2025, 7:10 a.m.

Environment
qemu-arm64
qemu-x86_64

[   24.694265] ==================================================================
[   24.695464] BUG: KASAN: slab-use-after-free in strlen+0xa8/0xb0
[   24.695736] Read of size 1 at addr fff00000c7876250 by task kunit_try_catch/259
[   24.696152] 
[   24.696705] CPU: 1 UID: 0 PID: 259 Comm: kunit_try_catch Tainted: G    B            N  6.15.0-next-20250529 #1 PREEMPT 
[   24.697182] Tainted: [B]=BAD_PAGE, [N]=TEST
[   24.697274] Hardware name: linux,dummy-virt (DT)
[   24.697362] Call trace:
[   24.697630]  show_stack+0x20/0x38 (C)
[   24.697903]  dump_stack_lvl+0x8c/0xd0
[   24.698286]  print_report+0x118/0x608
[   24.698423]  kasan_report+0xdc/0x128
[   24.698552]  __asan_report_load1_noabort+0x20/0x30
[   24.698670]  strlen+0xa8/0xb0
[   24.698759]  kasan_strings+0x418/0xb00
[   24.698880]  kunit_try_run_case+0x170/0x3f0
[   24.699002]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   24.699676]  kthread+0x328/0x630
[   24.700274]  ret_from_fork+0x10/0x20
[   24.700582] 
[   24.700697] Allocated by task 259:
[   24.700894]  kasan_save_stack+0x3c/0x68
[   24.701007]  kasan_save_track+0x20/0x40
[   24.701354]  kasan_save_alloc_info+0x40/0x58
[   24.701472]  __kasan_kmalloc+0xd4/0xd8
[   24.701780]  __kmalloc_cache_noprof+0x15c/0x3c0
[   24.701887]  kasan_strings+0xc8/0xb00
[   24.702246]  kunit_try_run_case+0x170/0x3f0
[   24.702584]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   24.702955]  kthread+0x328/0x630
[   24.703058]  ret_from_fork+0x10/0x20
[   24.703368] 
[   24.703517] Freed by task 259:
[   24.703851]  kasan_save_stack+0x3c/0x68
[   24.704009]  kasan_save_track+0x20/0x40
[   24.704541]  kasan_save_free_info+0x4c/0x78
[   24.704707]  __kasan_slab_free+0x6c/0x98
[   24.704812]  kfree+0x214/0x3c8
[   24.704917]  kasan_strings+0x24c/0xb00
[   24.705011]  kunit_try_run_case+0x170/0x3f0
[   24.705112]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   24.705804]  kthread+0x328/0x630
[   24.705936]  ret_from_fork+0x10/0x20
[   24.706109] 
[   24.706303] The buggy address belongs to the object at fff00000c7876240
[   24.706303]  which belongs to the cache kmalloc-32 of size 32
[   24.706653] The buggy address is located 16 bytes inside of
[   24.706653]  freed 32-byte region [fff00000c7876240, fff00000c7876260)
[   24.706788] 
[   24.706842] The buggy address belongs to the physical page:
[   24.706913] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x107876
[   24.707041] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   24.707177] page_type: f5(slab)
[   24.707284] raw: 0bfffe0000000000 fff00000c0001780 dead000000000122 0000000000000000
[   24.707844] raw: 0000000000000000 0000000080400040 00000000f5000000 0000000000000000
[   24.708254] page dumped because: kasan: bad access detected
[   24.708594] 
[   24.708681] Memory state around the buggy address:
[   24.708911]  fff00000c7876100: fa fb fb fb fc fc fc fc 00 00 00 fc fc fc fc fc
[   24.709161]  fff00000c7876180: 00 00 00 fc fc fc fc fc 00 00 07 fc fc fc fc fc
[   24.709424] >fff00000c7876200: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc
[   24.709608]                                                  ^
[   24.710328]  fff00000c7876280: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc
[   24.710875]  fff00000c7876300: 00 00 00 fc fc fc fc fc fa fb fb fb fc fc fc fc
[   24.710985] ==================================================================


[   12.831323] ==================================================================
[   12.831755] BUG: KASAN: slab-use-after-free in strlen+0x8f/0xb0
[   12.832248] Read of size 1 at addr ffff888102fab010 by task kunit_try_catch/276
[   12.832963] 
[   12.833093] CPU: 0 UID: 0 PID: 276 Comm: kunit_try_catch Tainted: G    B            N  6.15.0-next-20250529 #1 PREEMPT(voluntary) 
[   12.833143] Tainted: [B]=BAD_PAGE, [N]=TEST
[   12.833156] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   12.833178] Call Trace:
[   12.833195]  <TASK>
[   12.833210]  dump_stack_lvl+0x73/0xb0
[   12.833237]  print_report+0xd1/0x650
[   12.833260]  ? __virt_addr_valid+0x1db/0x2d0
[   12.833282]  ? strlen+0x8f/0xb0
[   12.833300]  ? kasan_complete_mode_report_info+0x64/0x200
[   12.833323]  ? strlen+0x8f/0xb0
[   12.833343]  kasan_report+0x141/0x180
[   12.833366]  ? strlen+0x8f/0xb0
[   12.833390]  __asan_report_load1_noabort+0x18/0x20
[   12.833411]  strlen+0x8f/0xb0
[   12.833431]  kasan_strings+0x57b/0xe80
[   12.833451]  ? trace_hardirqs_on+0x37/0xe0
[   12.833474]  ? __pfx_kasan_strings+0x10/0x10
[   12.833494]  ? finish_task_switch.isra.0+0x153/0x700
[   12.833539]  ? __switch_to+0x47/0xf50
[   12.833564]  ? __schedule+0x10cc/0x2b60
[   12.833587]  ? __pfx_read_tsc+0x10/0x10
[   12.833620]  ? ktime_get_ts64+0x86/0x230
[   12.833645]  kunit_try_run_case+0x1a5/0x480
[   12.833668]  ? __pfx_kunit_try_run_case+0x10/0x10
[   12.833688]  ? _raw_spin_lock_irqsave+0xa1/0x100
[   12.833713]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   12.833738]  ? __kthread_parkme+0x82/0x180
[   12.833759]  ? preempt_count_sub+0x50/0x80
[   12.833782]  ? __pfx_kunit_try_run_case+0x10/0x10
[   12.833889]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   12.833915]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   12.833941]  kthread+0x337/0x6f0
[   12.833962]  ? trace_preempt_on+0x20/0xc0
[   12.833985]  ? __pfx_kthread+0x10/0x10
[   12.834006]  ? _raw_spin_unlock_irq+0x47/0x80
[   12.834029]  ? calculate_sigpending+0x7b/0xa0
[   12.834052]  ? __pfx_kthread+0x10/0x10
[   12.834074]  ret_from_fork+0x116/0x1d0
[   12.834093]  ? __pfx_kthread+0x10/0x10
[   12.834115]  ret_from_fork_asm+0x1a/0x30
[   12.834145]  </TASK>
[   12.834155] 
[   12.845442] Allocated by task 276:
[   12.845624]  kasan_save_stack+0x45/0x70
[   12.845781]  kasan_save_track+0x18/0x40
[   12.845959]  kasan_save_alloc_info+0x3b/0x50
[   12.846194]  __kasan_kmalloc+0xb7/0xc0
[   12.846364]  __kmalloc_cache_noprof+0x189/0x420
[   12.846556]  kasan_strings+0xc0/0xe80
[   12.846756]  kunit_try_run_case+0x1a5/0x480
[   12.847104]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   12.847303]  kthread+0x337/0x6f0
[   12.847469]  ret_from_fork+0x116/0x1d0
[   12.847671]  ret_from_fork_asm+0x1a/0x30
[   12.847859] 
[   12.848134] Freed by task 276:
[   12.848320]  kasan_save_stack+0x45/0x70
[   12.848495]  kasan_save_track+0x18/0x40
[   12.848685]  kasan_save_free_info+0x3f/0x60
[   12.848960]  __kasan_slab_free+0x56/0x70
[   12.849175]  kfree+0x222/0x3f0
[   12.849296]  kasan_strings+0x2aa/0xe80
[   12.849432]  kunit_try_run_case+0x1a5/0x480
[   12.849626]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   12.849895]  kthread+0x337/0x6f0
[   12.850050]  ret_from_fork+0x116/0x1d0
[   12.850185]  ret_from_fork_asm+0x1a/0x30
[   12.850347] 
[   12.850443] The buggy address belongs to the object at ffff888102fab000
[   12.850443]  which belongs to the cache kmalloc-32 of size 32
[   12.851009] The buggy address is located 16 bytes inside of
[   12.851009]  freed 32-byte region [ffff888102fab000, ffff888102fab020)
[   12.851403] 
[   12.851531] The buggy address belongs to the physical page:
[   12.851858] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x102fab
[   12.852273] flags: 0x200000000000000(node=0|zone=2)
[   12.852442] page_type: f5(slab)
[   12.852623] raw: 0200000000000000 ffff888100041780 dead000000000122 0000000000000000
[   12.853113] raw: 0000000000000000 0000000080400040 00000000f5000000 0000000000000000
[   12.853515] page dumped because: kasan: bad access detected
[   12.853729] 
[   12.853870] Memory state around the buggy address:
[   12.854093]  ffff888102faaf00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   12.854372]  ffff888102faaf80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   12.854713] >ffff888102fab000: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc
[   12.855057]                          ^
[   12.855214]  ffff888102fab080: fa fb fb fb fc fc fc fc 00 00 00 fc fc fc fc fc
[   12.855514]  ffff888102fab100: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc
[   12.856002] ==================================================================