Hay
Date
Dec. 9, 2024, 6:35 a.m.

Environment
qemu-arm64
qemu-x86_64

[   26.986058] ==================================================================
[   26.986659] BUG: KASAN: slab-use-after-free in kasan_strings+0x838/0x8d8
[   26.988048] Read of size 1 at addr fff00000c1204c50 by task kunit_try_catch/247
[   26.988768] 
[   26.989110] CPU: 0 UID: 0 PID: 247 Comm: kunit_try_catch Tainted: G    B            N 6.13.0-rc2-next-20241209 #1
[   26.990173] Tainted: [B]=BAD_PAGE, [N]=TEST
[   26.990652] Hardware name: linux,dummy-virt (DT)
[   26.991673] Call trace:
[   26.992042]  show_stack+0x20/0x38 (C)
[   26.992580]  dump_stack_lvl+0x8c/0xd0
[   26.993380]  print_report+0x118/0x5e0
[   26.993967]  kasan_report+0xc8/0x118
[   26.994474]  __asan_report_load1_noabort+0x20/0x30
[   26.995338]  kasan_strings+0x838/0x8d8
[   26.996034]  kunit_try_run_case+0x14c/0x3d0
[   26.996809]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   26.997113]  kthread+0x24c/0x2d0
[   26.997341]  ret_from_fork+0x10/0x20
[   26.997579] 
[   26.997755] Allocated by task 247:
[   26.998086]  kasan_save_stack+0x3c/0x68
[   26.998749]  kasan_save_track+0x20/0x40
[   26.999580]  kasan_save_alloc_info+0x40/0x58
[   27.000792]  __kasan_kmalloc+0xd4/0xd8
[   27.001863]  __kmalloc_cache_noprof+0x15c/0x3c0
[   27.002625]  kasan_strings+0xb0/0x8d8
[   27.003384]  kunit_try_run_case+0x14c/0x3d0
[   27.004007]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   27.004959]  kthread+0x24c/0x2d0
[   27.005439]  ret_from_fork+0x10/0x20
[   27.005892] 
[   27.006264] Freed by task 247:
[   27.006738]  kasan_save_stack+0x3c/0x68
[   27.007631]  kasan_save_track+0x20/0x40
[   27.008588]  kasan_save_free_info+0x4c/0x78
[   27.009146]  __kasan_slab_free+0x6c/0x98
[   27.009640]  kfree+0x114/0x3c8
[   27.010109]  kasan_strings+0x124/0x8d8
[   27.010609]  kunit_try_run_case+0x14c/0x3d0
[   27.011681]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   27.012365]  kthread+0x24c/0x2d0
[   27.012849]  ret_from_fork+0x10/0x20
[   27.013416] 
[   27.013720] The buggy address belongs to the object at fff00000c1204c40
[   27.013720]  which belongs to the cache kmalloc-32 of size 32
[   27.014906] The buggy address is located 16 bytes inside of
[   27.014906]  freed 32-byte region [fff00000c1204c40, fff00000c1204c60)
[   27.016931] 
[   27.017250] The buggy address belongs to the physical page:
[   27.017878] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x101204
[   27.018805] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   27.019508] page_type: f5(slab)
[   27.020018] raw: 0bfffe0000000000 fff00000c0001780 dead000000000122 0000000000000000
[   27.021119] raw: 0000000000000000 0000000080400040 00000000f5000000 0000000000000000
[   27.022019] page dumped because: kasan: bad access detected
[   27.022716] 
[   27.023054] Memory state around the buggy address:
[   27.024314]  fff00000c1204b00: 00 00 00 fc fc fc fc fc 00 00 00 fc fc fc fc fc
[   27.025171]  fff00000c1204b80: 00 00 00 fc fc fc fc fc 00 00 00 04 fc fc fc fc
[   27.025899] >fff00000c1204c00: 00 00 07 fc fc fc fc fc fa fb fb fb fc fc fc fc
[   27.026731]                                                  ^
[   27.027593]  fff00000c1204c80: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc
[   27.028412]  fff00000c1204d00: 00 00 00 fc fc fc fc fc fa fb fb fb fc fc fc fc
[   27.029366] ==================================================================

[   27.418754] ==================================================================
[   27.420064] BUG: KASAN: slab-use-after-free in kasan_strings+0xa0c/0xb60
[   27.420641] Read of size 1 at addr ffff888102964dd0 by task kunit_try_catch/266
[   27.421539] 
[   27.421844] CPU: 0 UID: 0 PID: 266 Comm: kunit_try_catch Tainted: G    B            N 6.13.0-rc2-next-20241209 #1
[   27.422752] Tainted: [B]=BAD_PAGE, [N]=TEST
[   27.423393] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   27.425438] Call Trace:
[   27.426389]  <TASK>
[   27.426641]  dump_stack_lvl+0x73/0xb0
[   27.427669]  print_report+0xd1/0x640
[   27.428145]  ? __virt_addr_valid+0x1db/0x2d0
[   27.428795]  ? kasan_complete_mode_report_info+0x64/0x200
[   27.429367]  kasan_report+0x102/0x140
[   27.429794]  ? kasan_strings+0xa0c/0xb60
[   27.430647]  ? kasan_strings+0xa0c/0xb60
[   27.431557]  __asan_report_load1_noabort+0x18/0x20
[   27.432237]  kasan_strings+0xa0c/0xb60
[   27.432904]  ? __pfx_kasan_strings+0x10/0x10
[   27.433603]  ? __schedule+0xc70/0x27e0
[   27.434328]  ? __pfx_read_tsc+0x10/0x10
[   27.435033]  ? ktime_get_ts64+0x86/0x230
[   27.435499]  kunit_try_run_case+0x1b3/0x490
[   27.436704]  ? __pfx_kunit_try_run_case+0x10/0x10
[   27.437346]  ? _raw_spin_lock_irqsave+0xa2/0x110
[   27.438078]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   27.438647]  ? __kthread_parkme+0x82/0x160
[   27.439727]  ? preempt_count_sub+0x50/0x80
[   27.440063]  ? __pfx_kunit_try_run_case+0x10/0x10
[   27.440788]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   27.441581]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   27.442200]  kthread+0x257/0x310
[   27.442951]  ? __pfx_kthread+0x10/0x10
[   27.443410]  ret_from_fork+0x41/0x80
[   27.444357]  ? __pfx_kthread+0x10/0x10
[   27.444789]  ret_from_fork_asm+0x1a/0x30
[   27.445691]  </TASK>
[   27.446009] 
[   27.446219] Allocated by task 266:
[   27.446604]  kasan_save_stack+0x3d/0x60
[   27.446962]  kasan_save_track+0x18/0x40
[   27.447475]  kasan_save_alloc_info+0x3b/0x50
[   27.448057]  __kasan_kmalloc+0xb7/0xc0
[   27.448638]  __kmalloc_cache_noprof+0x184/0x410
[   27.449251]  kasan_strings+0xb9/0xb60
[   27.449630]  kunit_try_run_case+0x1b3/0x490
[   27.450409]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   27.450872]  kthread+0x257/0x310
[   27.451529]  ret_from_fork+0x41/0x80
[   27.452098]  ret_from_fork_asm+0x1a/0x30
[   27.452697] 
[   27.452945] Freed by task 266:
[   27.453429]  kasan_save_stack+0x3d/0x60
[   27.453864]  kasan_save_track+0x18/0x40
[   27.454426]  kasan_save_free_info+0x3f/0x60
[   27.454892]  __kasan_slab_free+0x56/0x70
[   27.455552]  kfree+0x123/0x3f0
[   27.456210]  kasan_strings+0x13c/0xb60
[   27.456489]  kunit_try_run_case+0x1b3/0x490
[   27.457189]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   27.457874]  kthread+0x257/0x310
[   27.458321]  ret_from_fork+0x41/0x80
[   27.458878]  ret_from_fork_asm+0x1a/0x30
[   27.459396] 
[   27.459633] The buggy address belongs to the object at ffff888102964dc0
[   27.459633]  which belongs to the cache kmalloc-32 of size 32
[   27.460852] The buggy address is located 16 bytes inside of
[   27.460852]  freed 32-byte region [ffff888102964dc0, ffff888102964de0)
[   27.462019] 
[   27.462368] The buggy address belongs to the physical page:
[   27.462932] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x102964
[   27.463903] flags: 0x200000000000000(node=0|zone=2)
[   27.464336] page_type: f5(slab)
[   27.464723] raw: 0200000000000000 ffff888100041780 dead000000000122 0000000000000000
[   27.465647] raw: 0000000000000000 0000000080400040 00000000f5000000 0000000000000000
[   27.466489] page dumped because: kasan: bad access detected
[   27.467061] 
[   27.467406] Memory state around the buggy address:
[   27.468023]  ffff888102964c80: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc
[   27.468819]  ffff888102964d00: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc
[   27.469447] >ffff888102964d80: 00 00 00 fc fc fc fc fc fa fb fb fb fc fc fc fc
[   27.470223]                                                  ^
[   27.470938]  ffff888102964e00: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc
[   27.471717]  ffff888102964e80: 00 00 00 fc fc fc fc fc fa fb fb fb fc fc fc fc
[   27.472475] ==================================================================