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

Environment
qemu-arm64
qemu-x86_64

[   34.148178] ==================================================================
[   34.150109] BUG: KASAN: slab-use-after-free in strcmp+0xc0/0xc8
[   34.151910] Read of size 1 at addr fff00000c69e4d10 by task kunit_try_catch/248
[   34.152770] 
[   34.153181] CPU: 0 UID: 0 PID: 248 Comm: kunit_try_catch Tainted: G    B            N 6.13.0-rc1-next-20241206 #1
[   34.154683] Tainted: [B]=BAD_PAGE, [N]=TEST
[   34.155317] Hardware name: linux,dummy-virt (DT)
[   34.155997] Call trace:
[   34.156442]  show_stack+0x20/0x38 (C)
[   34.157068]  dump_stack_lvl+0x8c/0xd0
[   34.157708]  print_report+0x118/0x5e0
[   34.158659]  kasan_report+0xc8/0x118
[   34.159202]  __asan_report_load1_noabort+0x20/0x30
[   34.159994]  strcmp+0xc0/0xc8
[   34.160575]  kasan_strings+0x228/0x8d8
[   34.161150]  kunit_try_run_case+0x14c/0x3d0
[   34.161831]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   34.162898]  kthread+0x24c/0x2d0
[   34.163426]  ret_from_fork+0x10/0x20
[   34.164080] 
[   34.164415] Allocated by task 248:
[   34.164963]  kasan_save_stack+0x3c/0x68
[   34.165614]  kasan_save_track+0x20/0x40
[   34.166441]  kasan_save_alloc_info+0x40/0x58
[   34.167149]  __kasan_kmalloc+0xd4/0xd8
[   34.167707]  __kmalloc_cache_noprof+0x15c/0x3c0
[   34.168392]  kasan_strings+0xb0/0x8d8
[   34.169028]  kunit_try_run_case+0x14c/0x3d0
[   34.169710]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   34.170936]  kthread+0x24c/0x2d0
[   34.171391]  ret_from_fork+0x10/0x20
[   34.172016] 
[   34.172365] Freed by task 248:
[   34.173372]  kasan_save_stack+0x3c/0x68
[   34.173949]  kasan_save_track+0x20/0x40
[   34.174870]  kasan_save_free_info+0x4c/0x78
[   34.175562]  __kasan_slab_free+0x6c/0x98
[   34.176199]  kfree+0x114/0x3c8
[   34.176769]  kasan_strings+0x124/0x8d8
[   34.177298]  kunit_try_run_case+0x14c/0x3d0
[   34.177980]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   34.179069]  kthread+0x24c/0x2d0
[   34.179611]  ret_from_fork+0x10/0x20
[   34.180223] 
[   34.180561] The buggy address belongs to the object at fff00000c69e4d00
[   34.180561]  which belongs to the cache kmalloc-32 of size 32
[   34.181821] The buggy address is located 16 bytes inside of
[   34.181821]  freed 32-byte region [fff00000c69e4d00, fff00000c69e4d20)
[   34.183371] 
[   34.183733] The buggy address belongs to the physical page:
[   34.184469] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1069e4
[   34.185397] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   34.186503] page_type: f5(slab)
[   34.187086] raw: 0bfffe0000000000 fff00000c0001780 dead000000000122 0000000000000000
[   34.188007] raw: 0000000000000000 0000000080400040 00000000f5000000 0000000000000000
[   34.188898] page dumped because: kasan: bad access detected
[   34.189635] 
[   34.190008] Memory state around the buggy address:
[   34.191182]  fff00000c69e4c00: 00 00 07 fc fc fc fc fc fa fb fb fb fc fc fc fc
[   34.192002]  fff00000c69e4c80: 00 00 00 fc fc fc fc fc 00 00 00 fc fc fc fc fc
[   34.193415] >fff00000c69e4d00: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc
[   34.194248]                          ^
[   34.194841]  fff00000c69e4d80: fa fb fb fb fc fc fc fc 00 00 00 fc fc fc fc fc
[   34.196030]  fff00000c69e4e00: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc
[   34.196825] ==================================================================

[   27.068226] ==================================================================
[   27.072091] BUG: KASAN: slab-use-after-free in strcmp+0xb0/0xc0
[   27.072741] Read of size 1 at addr ffff888102481690 by task kunit_try_catch/267
[   27.074030] 
[   27.075646] CPU: 1 UID: 0 PID: 267 Comm: kunit_try_catch Tainted: G    B            N 6.13.0-rc1-next-20241206 #1
[   27.076524] Tainted: [B]=BAD_PAGE, [N]=TEST
[   27.077067] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   27.078477] Call Trace:
[   27.079612]  <TASK>
[   27.079771]  dump_stack_lvl+0x73/0xb0
[   27.080059]  print_report+0xd1/0x640
[   27.080316]  ? __virt_addr_valid+0x1db/0x2d0
[   27.080586]  ? kasan_complete_mode_report_info+0x64/0x200
[   27.081587]  kasan_report+0x102/0x140
[   27.082583]  ? strcmp+0xb0/0xc0
[   27.083738]  ? strcmp+0xb0/0xc0
[   27.084419]  __asan_report_load1_noabort+0x18/0x20
[   27.085672]  strcmp+0xb0/0xc0
[   27.086040]  kasan_strings+0x2d3/0xb60
[   27.086427]  ? __pfx_kasan_strings+0x10/0x10
[   27.087522]  ? __schedule+0xc70/0x27e0
[   27.088492]  ? __pfx_read_tsc+0x10/0x10
[   27.089745]  ? ktime_get_ts64+0x86/0x230
[   27.090201]  kunit_try_run_case+0x1b3/0x490
[   27.091516]  ? __pfx_kunit_try_run_case+0x10/0x10
[   27.092041]  ? _raw_spin_lock_irqsave+0xa2/0x110
[   27.093268]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   27.093881]  ? __kthread_parkme+0x82/0x160
[   27.095123]  ? preempt_count_sub+0x50/0x80
[   27.095547]  ? __pfx_kunit_try_run_case+0x10/0x10
[   27.096164]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   27.096838]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   27.097980]  kthread+0x257/0x310
[   27.098966]  ? __pfx_kthread+0x10/0x10
[   27.100123]  ret_from_fork+0x41/0x80
[   27.101063]  ? __pfx_kthread+0x10/0x10
[   27.101472]  ret_from_fork_asm+0x1a/0x30
[   27.102230]  </TASK>
[   27.103375] 
[   27.103987] Allocated by task 267:
[   27.104572]  kasan_save_stack+0x3d/0x60
[   27.105044]  kasan_save_track+0x18/0x40
[   27.105427]  kasan_save_alloc_info+0x3b/0x50
[   27.105999]  __kasan_kmalloc+0xb7/0xc0
[   27.107441]  __kmalloc_cache_noprof+0x184/0x410
[   27.107901]  kasan_strings+0xb9/0xb60
[   27.108592]  kunit_try_run_case+0x1b3/0x490
[   27.109446]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   27.110949]  kthread+0x257/0x310
[   27.111628]  ret_from_fork+0x41/0x80
[   27.112350]  ret_from_fork_asm+0x1a/0x30
[   27.112805] 
[   27.114149] Freed by task 267:
[   27.114614]  kasan_save_stack+0x3d/0x60
[   27.115497]  kasan_save_track+0x18/0x40
[   27.116021]  kasan_save_free_info+0x3f/0x60
[   27.116392]  __kasan_slab_free+0x56/0x70
[   27.116841]  kfree+0x123/0x3f0
[   27.117232]  kasan_strings+0x13c/0xb60
[   27.117637]  kunit_try_run_case+0x1b3/0x490
[   27.118117]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   27.118477]  kthread+0x257/0x310
[   27.118730]  ret_from_fork+0x41/0x80
[   27.120313]  ret_from_fork_asm+0x1a/0x30
[   27.121305] 
[   27.121687] The buggy address belongs to the object at ffff888102481680
[   27.121687]  which belongs to the cache kmalloc-32 of size 32
[   27.124108] The buggy address is located 16 bytes inside of
[   27.124108]  freed 32-byte region [ffff888102481680, ffff8881024816a0)
[   27.126062] 
[   27.126413] The buggy address belongs to the physical page:
[   27.127423] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x102481
[   27.128005] flags: 0x200000000000000(node=0|zone=2)
[   27.128433] page_type: f5(slab)
[   27.128894] raw: 0200000000000000 ffff888100041780 dead000000000122 0000000000000000
[   27.130222] raw: 0000000000000000 0000000080400040 00000000f5000000 0000000000000000
[   27.131296] page dumped because: kasan: bad access detected
[   27.132290] 
[   27.132658] Memory state around the buggy address:
[   27.133305]  ffff888102481580: fa fb fb fb fc fc fc fc 00 00 00 fc fc fc fc fc
[   27.134396]  ffff888102481600: 00 00 00 fc fc fc fc fc 00 00 07 fc fc fc fc fc
[   27.135319] >ffff888102481680: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc
[   27.136779]                          ^
[   27.138292]  ffff888102481700: fa fb fb fb fc fc fc fc 00 00 00 fc fc fc fc fc
[   27.139110]  ffff888102481780: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc
[   27.139859] ==================================================================