Hay
Date
Dec. 3, 2024, 11:38 p.m.

Environment
qemu-arm64
qemu-x86_64

[   33.595533] ==================================================================
[   33.596288] BUG: KASAN: slab-use-after-free in kasan_strings+0x838/0x8d8
[   33.597216] Read of size 1 at addr fff00000c5921b90 by task kunit_try_catch/248
[   33.598026] 
[   33.598362] CPU: 0 UID: 0 PID: 248 Comm: kunit_try_catch Tainted: G    B            N 6.13.0-rc1-next-20241203 #1
[   33.600408] Tainted: [B]=BAD_PAGE, [N]=TEST
[   33.601105] Hardware name: linux,dummy-virt (DT)
[   33.601608] Call trace:
[   33.601969]  show_stack+0x20/0x38 (C)
[   33.603438]  dump_stack_lvl+0x8c/0xd0
[   33.604098]  print_report+0x118/0x5e0
[   33.604755]  kasan_report+0xc8/0x118
[   33.605435]  __asan_report_load1_noabort+0x20/0x30
[   33.606171]  kasan_strings+0x838/0x8d8
[   33.606826]  kunit_try_run_case+0x14c/0x3d0
[   33.607565]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   33.608434]  kthread+0x24c/0x2d0
[   33.609049]  ret_from_fork+0x10/0x20
[   33.609742] 
[   33.610095] Allocated by task 248:
[   33.610715]  kasan_save_stack+0x3c/0x68
[   33.611417]  kasan_save_track+0x20/0x40
[   33.612119]  kasan_save_alloc_info+0x40/0x58
[   33.612811]  __kasan_kmalloc+0xd4/0xd8
[   33.613456]  __kmalloc_cache_noprof+0x15c/0x3c0
[   33.614187]  kasan_strings+0xb0/0x8d8
[   33.614758]  kunit_try_run_case+0x14c/0x3d0
[   33.615547]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   33.616320]  kthread+0x24c/0x2d0
[   33.616910]  ret_from_fork+0x10/0x20
[   33.617570] 
[   33.618049] Freed by task 248:
[   33.618586]  kasan_save_stack+0x3c/0x68
[   33.619304]  kasan_save_track+0x20/0x40
[   33.619986]  kasan_save_free_info+0x4c/0x78
[   33.620704]  __kasan_slab_free+0x6c/0x98
[   33.621373]  kfree+0x114/0x3c8
[   33.621934]  kasan_strings+0x124/0x8d8
[   33.622578]  kunit_try_run_case+0x14c/0x3d0
[   33.623280]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   33.624220]  kthread+0x24c/0x2d0
[   33.624826]  ret_from_fork+0x10/0x20
[   33.625514] 
[   33.625860] The buggy address belongs to the object at fff00000c5921b80
[   33.625860]  which belongs to the cache kmalloc-32 of size 32
[   33.627451] The buggy address is located 16 bytes inside of
[   33.627451]  freed 32-byte region [fff00000c5921b80, fff00000c5921ba0)
[   33.629047] 
[   33.629502] The buggy address belongs to the physical page:
[   33.630263] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x105921
[   33.631472] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   33.632362] page_type: f5(slab)
[   33.632961] raw: 0bfffe0000000000 fff00000c0001780 dead000000000122 0000000000000000
[   33.633993] raw: 0000000000000000 0000000080400040 00000000f5000000 0000000000000000
[   33.634944] page dumped because: kasan: bad access detected
[   33.635745] 
[   33.636234] Memory state around the buggy address:
[   33.636927]  fff00000c5921a80: 00 00 07 fc fc fc fc fc fa fb fb fb fc fc fc fc
[   33.637965]  fff00000c5921b00: 00 00 00 fc fc fc fc fc 00 00 00 fc fc fc fc fc
[   33.638890] >fff00000c5921b80: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc
[   33.639786]                          ^
[   33.640419]  fff00000c5921c00: fa fb fb fb fc fc fc fc 00 00 00 fc fc fc fc fc
[   33.641370]  fff00000c5921c80: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc
[   33.642308] ==================================================================

[   28.883419] ==================================================================
[   28.884972] BUG: KASAN: slab-use-after-free in kasan_strings+0xa0c/0xb60
[   28.885883] Read of size 1 at addr ffff888102a07b90 by task kunit_try_catch/268
[   28.886323] 
[   28.886587] CPU: 1 UID: 0 PID: 268 Comm: kunit_try_catch Tainted: G    B            N 6.13.0-rc1-next-20241203 #1
[   28.887537] Tainted: [B]=BAD_PAGE, [N]=TEST
[   28.887959] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   28.888715] Call Trace:
[   28.888948]  <TASK>
[   28.889164]  dump_stack_lvl+0x73/0xb0
[   28.889693]  print_report+0xd1/0x640
[   28.890152]  ? __virt_addr_valid+0x1db/0x2d0
[   28.890663]  ? kasan_complete_mode_report_info+0x64/0x200
[   28.891096]  kasan_report+0x102/0x140
[   28.891465]  ? kasan_strings+0xa0c/0xb60
[   28.891884]  ? kasan_strings+0xa0c/0xb60
[   28.892318]  __asan_report_load1_noabort+0x18/0x20
[   28.893108]  kasan_strings+0xa0c/0xb60
[   28.893526]  ? __pfx_kasan_strings+0x10/0x10
[   28.893982]  ? __schedule+0xc3e/0x2790
[   28.894413]  ? __pfx_read_tsc+0x10/0x10
[   28.894885]  ? ktime_get_ts64+0x86/0x230
[   28.895226]  kunit_try_run_case+0x1b3/0x490
[   28.895748]  ? __pfx_kunit_try_run_case+0x10/0x10
[   28.896201]  ? _raw_spin_lock_irqsave+0xa2/0x110
[   28.896743]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   28.897234]  ? __kthread_parkme+0x82/0x160
[   28.897648]  ? preempt_count_sub+0x50/0x80
[   28.897991]  ? __pfx_kunit_try_run_case+0x10/0x10
[   28.898503]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   28.898966]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   28.899407]  kthread+0x257/0x310
[   28.899793]  ? __pfx_kthread+0x10/0x10
[   28.900195]  ret_from_fork+0x41/0x80
[   28.900579]  ? __pfx_kthread+0x10/0x10
[   28.900957]  ret_from_fork_asm+0x1a/0x30
[   28.901375]  </TASK>
[   28.901593] 
[   28.901741] Allocated by task 268:
[   28.901960]  kasan_save_stack+0x3d/0x60
[   28.902379]  kasan_save_track+0x18/0x40
[   28.902799]  kasan_save_alloc_info+0x3b/0x50
[   28.903246]  __kasan_kmalloc+0xb7/0xc0
[   28.903629]  __kmalloc_cache_noprof+0x184/0x410
[   28.904273]  kasan_strings+0xb9/0xb60
[   28.904787]  kunit_try_run_case+0x1b3/0x490
[   28.905215]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   28.905798]  kthread+0x257/0x310
[   28.906182]  ret_from_fork+0x41/0x80
[   28.906607]  ret_from_fork_asm+0x1a/0x30
[   28.906982] 
[   28.907147] Freed by task 268:
[   28.907348]  kasan_save_stack+0x3d/0x60
[   28.907781]  kasan_save_track+0x18/0x40
[   28.908385]  kasan_save_free_info+0x3f/0x60
[   28.908806]  __kasan_slab_free+0x56/0x70
[   28.909164]  kfree+0x123/0x3f0
[   28.909509]  kasan_strings+0x13c/0xb60
[   28.909931]  kunit_try_run_case+0x1b3/0x490
[   28.910344]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   28.910793]  kthread+0x257/0x310
[   28.911162]  ret_from_fork+0x41/0x80
[   28.911531]  ret_from_fork_asm+0x1a/0x30
[   28.911843] 
[   28.912071] The buggy address belongs to the object at ffff888102a07b80
[   28.912071]  which belongs to the cache kmalloc-32 of size 32
[   28.913153] The buggy address is located 16 bytes inside of
[   28.913153]  freed 32-byte region [ffff888102a07b80, ffff888102a07ba0)
[   28.913808] 
[   28.914036] The buggy address belongs to the physical page:
[   28.914532] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x102a07
[   28.915256] flags: 0x200000000000000(node=0|zone=2)
[   28.915791] page_type: f5(slab)
[   28.916167] raw: 0200000000000000 ffff888100041780 dead000000000122 0000000000000000
[   28.916972] raw: 0000000000000000 0000000080400040 00000000f5000000 0000000000000000
[   28.917645] page dumped because: kasan: bad access detected
[   28.918045] 
[   28.918309] Memory state around the buggy address:
[   28.918869]  ffff888102a07a80: fa fb fb fb fc fc fc fc 00 00 00 fc fc fc fc fc
[   28.919427]  ffff888102a07b00: 00 00 00 fc fc fc fc fc 00 00 07 fc fc fc fc fc
[   28.919900] >ffff888102a07b80: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc
[   28.920268]                          ^
[   28.920747]  ffff888102a07c00: fa fb fb fb fc fc fc fc 00 00 00 fc fc fc fc fc
[   28.921395]  ffff888102a07c80: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc
[   28.922031] ==================================================================