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

Environment
qemu-arm64
qemu-x86_64

[   35.259050] ==================================================================
[   35.259881] BUG: KASAN: slab-use-after-free in kasan_strings+0x838/0x8d8
[   35.260714] Read of size 1 at addr fff00000c6643a90 by task kunit_try_catch/247
[   35.262374] 
[   35.262966] CPU: 0 UID: 0 PID: 247 Comm: kunit_try_catch Tainted: G    B            N 6.13.0-rc1-next-20241204 #1
[   35.264458] Tainted: [B]=BAD_PAGE, [N]=TEST
[   35.265037] Hardware name: linux,dummy-virt (DT)
[   35.266254] Call trace:
[   35.267364]  show_stack+0x20/0x38 (C)
[   35.268063]  dump_stack_lvl+0x8c/0xd0
[   35.268857]  print_report+0x118/0x5e0
[   35.269425]  kasan_report+0xc8/0x118
[   35.270053]  __asan_report_load1_noabort+0x20/0x30
[   35.271330]  kasan_strings+0x838/0x8d8
[   35.272053]  kunit_try_run_case+0x14c/0x3d0
[   35.272923]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   35.274182]  kthread+0x24c/0x2d0
[   35.274847]  ret_from_fork+0x10/0x20
[   35.275554] 
[   35.275978] Allocated by task 247:
[   35.276713]  kasan_save_stack+0x3c/0x68
[   35.277447]  kasan_save_track+0x20/0x40
[   35.278527]  kasan_save_alloc_info+0x40/0x58
[   35.279076]  __kasan_kmalloc+0xd4/0xd8
[   35.280098]  __kmalloc_cache_noprof+0x15c/0x3c0
[   35.281093]  kasan_strings+0xb0/0x8d8
[   35.282012]  kunit_try_run_case+0x14c/0x3d0
[   35.282668]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   35.283445]  kthread+0x24c/0x2d0
[   35.283998]  ret_from_fork+0x10/0x20
[   35.284509] 
[   35.285013] Freed by task 247:
[   35.285586]  kasan_save_stack+0x3c/0x68
[   35.286203]  kasan_save_track+0x20/0x40
[   35.287309]  kasan_save_free_info+0x4c/0x78
[   35.288131]  __kasan_slab_free+0x6c/0x98
[   35.288832]  kfree+0x114/0x3c8
[   35.289337]  kasan_strings+0x124/0x8d8
[   35.290261]  kunit_try_run_case+0x14c/0x3d0
[   35.290845]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   35.291718]  kthread+0x24c/0x2d0
[   35.292304]  ret_from_fork+0x10/0x20
[   35.292937] 
[   35.293254] The buggy address belongs to the object at fff00000c6643a80
[   35.293254]  which belongs to the cache kmalloc-32 of size 32
[   35.295073] The buggy address is located 16 bytes inside of
[   35.295073]  freed 32-byte region [fff00000c6643a80, fff00000c6643aa0)
[   35.296527] 
[   35.297149] The buggy address belongs to the physical page:
[   35.297824] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x106643
[   35.299462] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   35.300990] page_type: f5(slab)
[   35.302036] raw: 0bfffe0000000000 fff00000c0001780 dead000000000122 0000000000000000
[   35.302835] raw: 0000000000000000 0000000080400040 00000000f5000000 0000000000000000
[   35.303474] page dumped because: kasan: bad access detected
[   35.304338] 
[   35.304694] Memory state around the buggy address:
[   35.305612]  fff00000c6643980: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc
[   35.306745]  fff00000c6643a00: 00 00 00 fc fc fc fc fc 00 00 00 fc fc fc fc fc
[   35.307953] >fff00000c6643a80: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc
[   35.308898]                          ^
[   35.309386]  fff00000c6643b00: fa fb fb fb fc fc fc fc 00 00 00 fc fc fc fc fc
[   35.310416]  fff00000c6643b80: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc
[   35.311724] ==================================================================

[   26.068376] ==================================================================
[   26.069599] BUG: KASAN: slab-use-after-free in kasan_strings+0xa0c/0xb60
[   26.070197] Read of size 1 at addr ffff88810299ded0 by task kunit_try_catch/267
[   26.070872] 
[   26.071276] CPU: 1 UID: 0 PID: 267 Comm: kunit_try_catch Tainted: G    B            N 6.13.0-rc1-next-20241204 #1
[   26.072383] Tainted: [B]=BAD_PAGE, [N]=TEST
[   26.072741] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   26.073634] Call Trace:
[   26.073847]  <TASK>
[   26.074667]  dump_stack_lvl+0x73/0xb0
[   26.075115]  print_report+0xd1/0x640
[   26.075639]  ? __virt_addr_valid+0x1db/0x2d0
[   26.076317]  ? kasan_complete_mode_report_info+0x64/0x200
[   26.076990]  kasan_report+0x102/0x140
[   26.077531]  ? kasan_strings+0xa0c/0xb60
[   26.078328]  ? kasan_strings+0xa0c/0xb60
[   26.078799]  __asan_report_load1_noabort+0x18/0x20
[   26.079527]  kasan_strings+0xa0c/0xb60
[   26.079818]  ? __pfx_kasan_strings+0x10/0x10
[   26.080397]  ? __pfx_kasan_strings+0x10/0x10
[   26.080768]  kunit_try_run_case+0x1b3/0x490
[   26.081939]  ? __pfx_kunit_try_run_case+0x10/0x10
[   26.082592]  ? _raw_spin_lock_irqsave+0xa2/0x110
[   26.083197]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   26.083549]  ? __kthread_parkme+0x82/0x160
[   26.084285]  ? preempt_count_sub+0x50/0x80
[   26.084791]  ? __pfx_kunit_try_run_case+0x10/0x10
[   26.085201]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   26.086074]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   26.086523]  kthread+0x257/0x310
[   26.086950]  ? __pfx_kthread+0x10/0x10
[   26.087722]  ret_from_fork+0x41/0x80
[   26.088108]  ? __pfx_kthread+0x10/0x10
[   26.088766]  ret_from_fork_asm+0x1a/0x30
[   26.089628]  </TASK>
[   26.089977] 
[   26.090133] Allocated by task 267:
[   26.090688]  kasan_save_stack+0x3d/0x60
[   26.091037]  kasan_save_track+0x18/0x40
[   26.091767]  kasan_save_alloc_info+0x3b/0x50
[   26.092210]  __kasan_kmalloc+0xb7/0xc0
[   26.092617]  __kmalloc_cache_noprof+0x184/0x410
[   26.093283]  kasan_strings+0xb9/0xb60
[   26.093559]  kunit_try_run_case+0x1b3/0x490
[   26.094874]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   26.095511]  kthread+0x257/0x310
[   26.096004]  ret_from_fork+0x41/0x80
[   26.096755]  ret_from_fork_asm+0x1a/0x30
[   26.097419] 
[   26.097838] Freed by task 267:
[   26.098483]  kasan_save_stack+0x3d/0x60
[   26.098831]  kasan_save_track+0x18/0x40
[   26.099778]  kasan_save_free_info+0x3f/0x60
[   26.100152]  __kasan_slab_free+0x56/0x70
[   26.100833]  kfree+0x123/0x3f0
[   26.101432]  kasan_strings+0x13c/0xb60
[   26.101891]  kunit_try_run_case+0x1b3/0x490
[   26.102873]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   26.103741]  kthread+0x257/0x310
[   26.104488]  ret_from_fork+0x41/0x80
[   26.105308]  ret_from_fork_asm+0x1a/0x30
[   26.106220] 
[   26.106760] The buggy address belongs to the object at ffff88810299dec0
[   26.106760]  which belongs to the cache kmalloc-32 of size 32
[   26.107309] The buggy address is located 16 bytes inside of
[   26.107309]  freed 32-byte region [ffff88810299dec0, ffff88810299dee0)
[   26.109216] 
[   26.109452] The buggy address belongs to the physical page:
[   26.109930] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x10299d
[   26.111676] flags: 0x200000000000000(node=0|zone=2)
[   26.112097] page_type: f5(slab)
[   26.112613] raw: 0200000000000000 ffff888100041780 dead000000000122 0000000000000000
[   26.114037] raw: 0000000000000000 0000000000400040 00000000f5000000 0000000000000000
[   26.114905] page dumped because: kasan: bad access detected
[   26.116139] 
[   26.116486] Memory state around the buggy address:
[   26.116770]  ffff88810299dd80: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc
[   26.118386]  ffff88810299de00: 00 00 00 fc fc fc fc fc 00 00 00 fc fc fc fc fc
[   26.119269] >ffff88810299de80: 00 00 07 fc fc fc fc fc fa fb fb fb fc fc fc fc
[   26.120364]                                                  ^
[   26.121357]  ffff88810299df00: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc
[   26.122717]  ffff88810299df80: 00 00 00 fc fc fc fc fc fa fb fb fb fc fc fc fc
[   26.124064] ==================================================================