Hay
Date
Dec. 5, 2024, 2:07 p.m.

Environment
qemu-arm64
qemu-x86_64

[   33.131681] ==================================================================
[   33.132630] BUG: KASAN: slab-use-after-free in kasan_strings+0x838/0x8d8
[   33.133396] Read of size 1 at addr fff00000c63d1e50 by task kunit_try_catch/248
[   33.134391] 
[   33.134666] CPU: 0 UID: 0 PID: 248 Comm: kunit_try_catch Tainted: G    B            N 6.13.0-rc1-next-20241205 #1
[   33.135649] Tainted: [B]=BAD_PAGE, [N]=TEST
[   33.137270] Hardware name: linux,dummy-virt (DT)
[   33.138281] Call trace:
[   33.138949]  show_stack+0x20/0x38 (C)
[   33.139627]  dump_stack_lvl+0x8c/0xd0
[   33.140347]  print_report+0x118/0x5e0
[   33.141240]  kasan_report+0xc8/0x118
[   33.141964]  __asan_report_load1_noabort+0x20/0x30
[   33.142774]  kasan_strings+0x838/0x8d8
[   33.143480]  kunit_try_run_case+0x14c/0x3d0
[   33.144266]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   33.145103]  kthread+0x24c/0x2d0
[   33.145592]  ret_from_fork+0x10/0x20
[   33.146146] 
[   33.146471] Allocated by task 248:
[   33.147099]  kasan_save_stack+0x3c/0x68
[   33.147722]  kasan_save_track+0x20/0x40
[   33.148554]  kasan_save_alloc_info+0x40/0x58
[   33.149245]  __kasan_kmalloc+0xd4/0xd8
[   33.150004]  __kmalloc_cache_noprof+0x15c/0x3c0
[   33.150747]  kasan_strings+0xb0/0x8d8
[   33.151454]  kunit_try_run_case+0x14c/0x3d0
[   33.152202]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   33.153058]  kthread+0x24c/0x2d0
[   33.153676]  ret_from_fork+0x10/0x20
[   33.154407] 
[   33.154971] Freed by task 248:
[   33.155596]  kasan_save_stack+0x3c/0x68
[   33.156327]  kasan_save_track+0x20/0x40
[   33.157020]  kasan_save_free_info+0x4c/0x78
[   33.157671]  __kasan_slab_free+0x6c/0x98
[   33.158417]  kfree+0x114/0x3c8
[   33.159034]  kasan_strings+0x124/0x8d8
[   33.159710]  kunit_try_run_case+0x14c/0x3d0
[   33.160441]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   33.161372]  kthread+0x24c/0x2d0
[   33.162021]  ret_from_fork+0x10/0x20
[   33.162728] 
[   33.163197] The buggy address belongs to the object at fff00000c63d1e40
[   33.163197]  which belongs to the cache kmalloc-32 of size 32
[   33.164783] The buggy address is located 16 bytes inside of
[   33.164783]  freed 32-byte region [fff00000c63d1e40, fff00000c63d1e60)
[   33.165465] 
[   33.165638] The buggy address belongs to the physical page:
[   33.166049] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1063d1
[   33.167504] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   33.168592] page_type: f5(slab)
[   33.169342] raw: 0bfffe0000000000 fff00000c0001780 dead000000000122 0000000000000000
[   33.170342] raw: 0000000000000000 0000000080400040 00000000f5000000 0000000000000000
[   33.171323] page dumped because: kasan: bad access detected
[   33.172095] 
[   33.172427] Memory state around the buggy address:
[   33.173468]  fff00000c63d1d00: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc
[   33.174436]  fff00000c63d1d80: fa fb fb fb fc fc fc fc 00 00 00 fc fc fc fc fc
[   33.175520] >fff00000c63d1e00: 00 00 00 fc fc fc fc fc fa fb fb fb fc fc fc fc
[   33.176556]                                                  ^
[   33.177154]  fff00000c63d1e80: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc
[   33.178307]  fff00000c63d1f00: 00 00 00 fc fc fc fc fc fa fb fb fb fc fc fc fc
[   33.179359] ==================================================================

[   30.978077] ==================================================================
[   30.978710] BUG: KASAN: slab-use-after-free in kasan_strings+0xa0c/0xb60
[   30.979579] Read of size 1 at addr ffff888102a07ed0 by task kunit_try_catch/266
[   30.980505] 
[   30.980858] CPU: 1 UID: 0 PID: 266 Comm: kunit_try_catch Tainted: G    B            N 6.13.0-rc1-next-20241205 #1
[   30.982219] Tainted: [B]=BAD_PAGE, [N]=TEST
[   30.982657] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   30.983759] Call Trace:
[   30.984420]  <TASK>
[   30.984718]  dump_stack_lvl+0x73/0xb0
[   30.985250]  print_report+0xd1/0x640
[   30.985825]  ? __virt_addr_valid+0x1db/0x2d0
[   30.986444]  ? kasan_complete_mode_report_info+0x64/0x200
[   30.987160]  kasan_report+0x102/0x140
[   30.987488]  ? kasan_strings+0xa0c/0xb60
[   30.988389]  ? kasan_strings+0xa0c/0xb60
[   30.988865]  __asan_report_load1_noabort+0x18/0x20
[   30.989361]  kasan_strings+0xa0c/0xb60
[   30.989912]  ? __pfx_kasan_strings+0x10/0x10
[   30.990669]  ? __schedule+0xc70/0x27e0
[   30.991199]  ? __pfx_read_tsc+0x10/0x10
[   30.991787]  ? ktime_get_ts64+0x86/0x230
[   30.992373]  kunit_try_run_case+0x1b3/0x490
[   30.992897]  ? __pfx_kunit_try_run_case+0x10/0x10
[   30.993869]  ? _raw_spin_lock_irqsave+0xa2/0x110
[   30.994576]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   30.995088]  ? __kthread_parkme+0x82/0x160
[   30.995544]  ? preempt_count_sub+0x50/0x80
[   30.996005]  ? __pfx_kunit_try_run_case+0x10/0x10
[   30.996750]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   30.997497]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   30.998013]  kthread+0x257/0x310
[   30.998442]  ? __pfx_kthread+0x10/0x10
[   30.999295]  ret_from_fork+0x41/0x80
[   30.999653]  ? __pfx_kthread+0x10/0x10
[   31.000058]  ret_from_fork_asm+0x1a/0x30
[   31.000448]  </TASK>
[   31.001126] 
[   31.001365] Allocated by task 266:
[   31.001608]  kasan_save_stack+0x3d/0x60
[   31.002325]  kasan_save_track+0x18/0x40
[   31.002909]  kasan_save_alloc_info+0x3b/0x50
[   31.003627]  __kasan_kmalloc+0xb7/0xc0
[   31.004455]  __kmalloc_cache_noprof+0x184/0x410
[   31.005165]  kasan_strings+0xb9/0xb60
[   31.005541]  kunit_try_run_case+0x1b3/0x490
[   31.006145]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   31.006645]  kthread+0x257/0x310
[   31.007232]  ret_from_fork+0x41/0x80
[   31.007674]  ret_from_fork_asm+0x1a/0x30
[   31.008415] 
[   31.008695] Freed by task 266:
[   31.009129]  kasan_save_stack+0x3d/0x60
[   31.009432]  kasan_save_track+0x18/0x40
[   31.010184]  kasan_save_free_info+0x3f/0x60
[   31.010821]  __kasan_slab_free+0x56/0x70
[   31.011393]  kfree+0x123/0x3f0
[   31.011843]  kasan_strings+0x13c/0xb60
[   31.012209]  kunit_try_run_case+0x1b3/0x490
[   31.013247]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   31.013750]  kthread+0x257/0x310
[   31.014385]  ret_from_fork+0x41/0x80
[   31.014650]  ret_from_fork_asm+0x1a/0x30
[   31.015399] 
[   31.015642] The buggy address belongs to the object at ffff888102a07ec0
[   31.015642]  which belongs to the cache kmalloc-32 of size 32
[   31.017434] The buggy address is located 16 bytes inside of
[   31.017434]  freed 32-byte region [ffff888102a07ec0, ffff888102a07ee0)
[   31.018544] 
[   31.018898] The buggy address belongs to the physical page:
[   31.019639] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x102a07
[   31.020629] flags: 0x200000000000000(node=0|zone=2)
[   31.021297] page_type: f5(slab)
[   31.021660] raw: 0200000000000000 ffff888100041780 dead000000000122 0000000000000000
[   31.022519] raw: 0000000000000000 0000000000400040 00000000f5000000 0000000000000000
[   31.023482] page dumped because: kasan: bad access detected
[   31.023936] 
[   31.024200] Memory state around the buggy address:
[   31.024643]  ffff888102a07d80: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc
[   31.025247]  ffff888102a07e00: 00 00 00 fc fc fc fc fc 00 00 00 fc fc fc fc fc
[   31.026310] >ffff888102a07e80: 00 00 07 fc fc fc fc fc fa fb fb fb fc fc fc fc
[   31.027218]                                                  ^
[   31.027816]  ffff888102a07f00: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc
[   31.028643]  ffff888102a07f80: 00 00 00 fc fc fc fc fc fa fb fb fb fc fc fc fc
[   31.029368] ==================================================================