Hay
Date
Dec. 4, 2024, 3:07 p.m.

Environment
qemu-arm64
qemu-x86_64

[   35.314743] ==================================================================
[   35.315557] BUG: KASAN: slab-use-after-free in strlen+0xa8/0xb0
[   35.316283] Read of size 1 at addr fff00000c6643a90 by task kunit_try_catch/247
[   35.317200] 
[   35.317587] CPU: 0 UID: 0 PID: 247 Comm: kunit_try_catch Tainted: G    B            N 6.13.0-rc1-next-20241204 #1
[   35.318987] Tainted: [B]=BAD_PAGE, [N]=TEST
[   35.319555] Hardware name: linux,dummy-virt (DT)
[   35.320072] Call trace:
[   35.320620]  show_stack+0x20/0x38 (C)
[   35.321977]  dump_stack_lvl+0x8c/0xd0
[   35.322547]  print_report+0x118/0x5e0
[   35.323185]  kasan_report+0xc8/0x118
[   35.323834]  __asan_report_load1_noabort+0x20/0x30
[   35.324524]  strlen+0xa8/0xb0
[   35.325145]  kasan_strings+0x304/0x8d8
[   35.325770]  kunit_try_run_case+0x14c/0x3d0
[   35.326466]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   35.327313]  kthread+0x24c/0x2d0
[   35.327948]  ret_from_fork+0x10/0x20
[   35.328501] 
[   35.328920] Allocated by task 247:
[   35.329508]  kasan_save_stack+0x3c/0x68
[   35.330222]  kasan_save_track+0x20/0x40
[   35.330781]  kasan_save_alloc_info+0x40/0x58
[   35.331509]  __kasan_kmalloc+0xd4/0xd8
[   35.332002]  __kmalloc_cache_noprof+0x15c/0x3c0
[   35.332772]  kasan_strings+0xb0/0x8d8
[   35.333290]  kunit_try_run_case+0x14c/0x3d0
[   35.334214]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   35.334878]  kthread+0x24c/0x2d0
[   35.335179]  ret_from_fork+0x10/0x20
[   35.335458] 
[   35.335659] Freed by task 247:
[   35.336048]  kasan_save_stack+0x3c/0x68
[   35.336868]  kasan_save_track+0x20/0x40
[   35.337382]  kasan_save_free_info+0x4c/0x78
[   35.338239]  __kasan_slab_free+0x6c/0x98
[   35.339116]  kfree+0x114/0x3c8
[   35.339580]  kasan_strings+0x124/0x8d8
[   35.340254]  kunit_try_run_case+0x14c/0x3d0
[   35.341073]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   35.341888]  kthread+0x24c/0x2d0
[   35.342489]  ret_from_fork+0x10/0x20
[   35.343180] 
[   35.343585] The buggy address belongs to the object at fff00000c6643a80
[   35.343585]  which belongs to the cache kmalloc-32 of size 32
[   35.345161] The buggy address is located 16 bytes inside of
[   35.345161]  freed 32-byte region [fff00000c6643a80, fff00000c6643aa0)
[   35.346736] 
[   35.347174] The buggy address belongs to the physical page:
[   35.347953] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x106643
[   35.349125] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   35.350011] page_type: f5(slab)
[   35.350686] raw: 0bfffe0000000000 fff00000c0001780 dead000000000122 0000000000000000
[   35.351697] raw: 0000000000000000 0000000080400040 00000000f5000000 0000000000000000
[   35.352578] page dumped because: kasan: bad access detected
[   35.353420] 
[   35.353786] Memory state around the buggy address:
[   35.354548]  fff00000c6643980: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc
[   35.355478]  fff00000c6643a00: 00 00 00 fc fc fc fc fc 00 00 00 fc fc fc fc fc
[   35.356434] >fff00000c6643a80: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc
[   35.357357]                          ^
[   35.357964]  fff00000c6643b00: fa fb fb fb fc fc fc fc 00 00 00 fc fc fc fc fc
[   35.358996]  fff00000c6643b80: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc
[   35.359901] ==================================================================

[   26.125119] ==================================================================
[   26.125585] BUG: KASAN: slab-use-after-free in strlen+0x8f/0xb0
[   26.127759] Read of size 1 at addr ffff88810299ded0 by task kunit_try_catch/267
[   26.129256] 
[   26.129440] CPU: 1 UID: 0 PID: 267 Comm: kunit_try_catch Tainted: G    B            N 6.13.0-rc1-next-20241204 #1
[   26.130468] Tainted: [B]=BAD_PAGE, [N]=TEST
[   26.130884] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   26.132217] Call Trace:
[   26.132740]  <TASK>
[   26.133054]  dump_stack_lvl+0x73/0xb0
[   26.133790]  print_report+0xd1/0x640
[   26.134182]  ? __virt_addr_valid+0x1db/0x2d0
[   26.134766]  ? kasan_complete_mode_report_info+0x64/0x200
[   26.135856]  kasan_report+0x102/0x140
[   26.136492]  ? strlen+0x8f/0xb0
[   26.136862]  ? strlen+0x8f/0xb0
[   26.137239]  __asan_report_load1_noabort+0x18/0x20
[   26.137929]  strlen+0x8f/0xb0
[   26.138415]  kasan_strings+0x425/0xb60
[   26.138884]  ? __pfx_kasan_strings+0x10/0x10
[   26.139809]  ? __pfx_kasan_strings+0x10/0x10
[   26.140224]  kunit_try_run_case+0x1b3/0x490
[   26.140908]  ? __pfx_kunit_try_run_case+0x10/0x10
[   26.141482]  ? _raw_spin_lock_irqsave+0xa2/0x110
[   26.141825]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   26.142571]  ? __kthread_parkme+0x82/0x160
[   26.143080]  ? preempt_count_sub+0x50/0x80
[   26.143893]  ? __pfx_kunit_try_run_case+0x10/0x10
[   26.144668]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   26.145378]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   26.145902]  kthread+0x257/0x310
[   26.146229]  ? __pfx_kthread+0x10/0x10
[   26.146791]  ret_from_fork+0x41/0x80
[   26.147173]  ? __pfx_kthread+0x10/0x10
[   26.147639]  ret_from_fork_asm+0x1a/0x30
[   26.148133]  </TASK>
[   26.149069] 
[   26.149510] Allocated by task 267:
[   26.149983]  kasan_save_stack+0x3d/0x60
[   26.150695]  kasan_save_track+0x18/0x40
[   26.151097]  kasan_save_alloc_info+0x3b/0x50
[   26.151759]  __kasan_kmalloc+0xb7/0xc0
[   26.152121]  __kmalloc_cache_noprof+0x184/0x410
[   26.153251]  kasan_strings+0xb9/0xb60
[   26.153632]  kunit_try_run_case+0x1b3/0x490
[   26.154064]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   26.154592]  kthread+0x257/0x310
[   26.154886]  ret_from_fork+0x41/0x80
[   26.155734]  ret_from_fork_asm+0x1a/0x30
[   26.156220] 
[   26.157143] Freed by task 267:
[   26.157759]  kasan_save_stack+0x3d/0x60
[   26.158391]  kasan_save_track+0x18/0x40
[   26.158797]  kasan_save_free_info+0x3f/0x60
[   26.159163]  __kasan_slab_free+0x56/0x70
[   26.159801]  kfree+0x123/0x3f0
[   26.160083]  kasan_strings+0x13c/0xb60
[   26.161056]  kunit_try_run_case+0x1b3/0x490
[   26.161767]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   26.162398]  kthread+0x257/0x310
[   26.162804]  ret_from_fork+0x41/0x80
[   26.163106]  ret_from_fork_asm+0x1a/0x30
[   26.163778] 
[   26.164019] The buggy address belongs to the object at ffff88810299dec0
[   26.164019]  which belongs to the cache kmalloc-32 of size 32
[   26.165862] The buggy address is located 16 bytes inside of
[   26.165862]  freed 32-byte region [ffff88810299dec0, ffff88810299dee0)
[   26.166997] 
[   26.167186] The buggy address belongs to the physical page:
[   26.167990] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x10299d
[   26.169008] flags: 0x200000000000000(node=0|zone=2)
[   26.169723] page_type: f5(slab)
[   26.170100] raw: 0200000000000000 ffff888100041780 dead000000000122 0000000000000000
[   26.170982] raw: 0000000000000000 0000000000400040 00000000f5000000 0000000000000000
[   26.171935] page dumped because: kasan: bad access detected
[   26.172276] 
[   26.172505] Memory state around the buggy address:
[   26.172951]  ffff88810299dd80: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc
[   26.174546]  ffff88810299de00: 00 00 00 fc fc fc fc fc 00 00 00 fc fc fc fc fc
[   26.175417] >ffff88810299de80: 00 00 07 fc fc fc fc fc fa fb fb fb fc fc fc fc
[   26.176033]                                                  ^
[   26.176746]  ffff88810299df00: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc
[   26.177822]  ffff88810299df80: 00 00 00 fc fc fc fc fc fa fb fb fb fc fc fc fc
[   26.178393] ==================================================================