Hay
Date
Nov. 27, 2024, 3:37 a.m.

Environment
qemu-arm64
qemu-x86_64

[   51.058091] ==================================================================
[   51.058991] BUG: KASAN: slab-use-after-free in kasan_strings+0x858/0x8f8
[   51.060075] Read of size 1 at addr fff00000c616c150 by task kunit_try_catch/248
[   51.060971] 
[   51.061731] CPU: 0 UID: 0 PID: 248 Comm: kunit_try_catch Tainted: G    B            N 6.12.0-next-20241127 #1
[   51.063056] Tainted: [B]=BAD_PAGE, [N]=TEST
[   51.063731] Hardware name: linux,dummy-virt (DT)
[   51.064365] Call trace:
[   51.064904]  show_stack+0x20/0x38 (C)
[   51.066241]  dump_stack_lvl+0x8c/0xd0
[   51.066849]  print_report+0x118/0x5e0
[   51.067474]  kasan_report+0xc8/0x118
[   51.068161]  __asan_report_load1_noabort+0x20/0x30
[   51.068974]  kasan_strings+0x858/0x8f8
[   51.069625]  kunit_try_run_case+0x14c/0x3d0
[   51.070698]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   51.071501]  kthread+0x24c/0x2d0
[   51.072183]  ret_from_fork+0x10/0x20
[   51.072716] 
[   51.072964] Allocated by task 248:
[   51.073829]  kasan_save_stack+0x3c/0x68
[   51.074489]  kasan_save_track+0x20/0x40
[   51.075213]  kasan_save_alloc_info+0x40/0x58
[   51.076573]  __kasan_kmalloc+0xd4/0xd8
[   51.077192]  __kmalloc_cache_noprof+0x15c/0x3c0
[   51.078047]  kasan_strings+0xb4/0x8f8
[   51.078673]  kunit_try_run_case+0x14c/0x3d0
[   51.079377]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   51.080225]  kthread+0x24c/0x2d0
[   51.080918]  ret_from_fork+0x10/0x20
[   51.081431] 
[   51.081813] Freed by task 248:
[   51.082256]  kasan_save_stack+0x3c/0x68
[   51.082812]  kasan_save_track+0x20/0x40
[   51.083485]  kasan_save_free_info+0x4c/0x78
[   51.083960]  __kasan_slab_free+0x6c/0x98
[   51.085068]  kfree+0x114/0x3c8
[   51.086143]  kasan_strings+0x128/0x8f8
[   51.087155]  kunit_try_run_case+0x14c/0x3d0
[   51.087962]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   51.088774]  kthread+0x24c/0x2d0
[   51.089898]  ret_from_fork+0x10/0x20
[   51.090703] 
[   51.091059] The buggy address belongs to the object at fff00000c616c140
[   51.091059]  which belongs to the cache kmalloc-32 of size 32
[   51.092831] The buggy address is located 16 bytes inside of
[   51.092831]  freed 32-byte region [fff00000c616c140, fff00000c616c160)
[   51.095256] 
[   51.095541] The buggy address belongs to the physical page:
[   51.096416] page: refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x10616c
[   51.097398] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   51.098322] page_type: f5(slab)
[   51.098815] raw: 0bfffe0000000000 fff00000c0001780 dead000000000122 0000000000000000
[   51.100017] raw: 0000000000000000 0000000080400040 00000001f5000000 0000000000000000
[   51.100979] page dumped because: kasan: bad access detected
[   51.102357] 
[   51.102650] Memory state around the buggy address:
[   51.103664]  fff00000c616c000: fa fb fb fb fc fc fc fc 00 00 00 fc fc fc fc fc
[   51.104531]  fff00000c616c080: 00 00 00 fc fc fc fc fc 00 00 00 fc fc fc fc fc
[   51.105829] >fff00000c616c100: 00 00 07 fc fc fc fc fc fa fb fb fb fc fc fc fc
[   51.106602]                                                  ^
[   51.107287]  fff00000c616c180: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   51.108119]  fff00000c616c200: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   51.109077] ==================================================================

[   28.458626] ==================================================================
[   28.460749] BUG: KASAN: slab-use-after-free in kasan_strings+0xa0f/0xb60
[   28.461601] Read of size 1 at addr ffff888101ab9950 by task kunit_try_catch/267
[   28.462856] 
[   28.463800] CPU: 1 UID: 0 PID: 267 Comm: kunit_try_catch Tainted: G    B            N 6.12.0-next-20241127 #1
[   28.464830] Tainted: [B]=BAD_PAGE, [N]=TEST
[   28.465887] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   28.467601] Call Trace:
[   28.468519]  <TASK>
[   28.468747]  dump_stack_lvl+0x73/0xb0
[   28.469118]  print_report+0xd1/0x640
[   28.469673]  ? __virt_addr_valid+0x1db/0x2d0
[   28.470258]  ? kasan_complete_mode_report_info+0x64/0x200
[   28.471200]  kasan_report+0x102/0x140
[   28.471674]  ? kasan_strings+0xa0f/0xb60
[   28.472411]  ? kasan_strings+0xa0f/0xb60
[   28.473190]  __asan_report_load1_noabort+0x18/0x20
[   28.473613]  kasan_strings+0xa0f/0xb60
[   28.474288]  ? __pfx_kasan_strings+0x10/0x10
[   28.474750]  ? __schedule+0xc3e/0x2790
[   28.475664]  ? __pfx_read_tsc+0x10/0x10
[   28.476296]  ? ktime_get_ts64+0x84/0x230
[   28.476701]  kunit_try_run_case+0x1b3/0x490
[   28.477859]  ? __pfx_kunit_try_run_case+0x10/0x10
[   28.478416]  ? _raw_spin_lock_irqsave+0xa2/0x110
[   28.479331]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   28.479871]  ? __kthread_parkme+0x82/0x160
[   28.480710]  ? preempt_count_sub+0x50/0x80
[   28.481566]  ? __pfx_kunit_try_run_case+0x10/0x10
[   28.481876]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   28.483210]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   28.483452]  kthread+0x257/0x310
[   28.483629]  ? __pfx_kthread+0x10/0x10
[   28.483810]  ret_from_fork+0x41/0x80
[   28.484257]  ? __pfx_kthread+0x10/0x10
[   28.484917]  ret_from_fork_asm+0x1a/0x30
[   28.485690]  </TASK>
[   28.486299] 
[   28.486639] Allocated by task 267:
[   28.487338]  kasan_save_stack+0x3d/0x60
[   28.488395]  kasan_save_track+0x18/0x40
[   28.489217]  kasan_save_alloc_info+0x3b/0x50
[   28.489676]  __kasan_kmalloc+0xb7/0xc0
[   28.490566]  __kmalloc_cache_noprof+0x184/0x410
[   28.491369]  kasan_strings+0xb3/0xb60
[   28.491761]  kunit_try_run_case+0x1b3/0x490
[   28.492400]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   28.492936]  kthread+0x257/0x310
[   28.493838]  ret_from_fork+0x41/0x80
[   28.494618]  ret_from_fork_asm+0x1a/0x30
[   28.494979] 
[   28.495793] Freed by task 267:
[   28.496160]  kasan_save_stack+0x3d/0x60
[   28.496900]  kasan_save_track+0x18/0x40
[   28.497466]  kasan_save_free_info+0x3f/0x60
[   28.497862]  __kasan_slab_free+0x56/0x70
[   28.499055]  kfree+0x123/0x3f0
[   28.499344]  kasan_strings+0x13a/0xb60
[   28.500485]  kunit_try_run_case+0x1b3/0x490
[   28.501546]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   28.502288]  kthread+0x257/0x310
[   28.502610]  ret_from_fork+0x41/0x80
[   28.502969]  ret_from_fork_asm+0x1a/0x30
[   28.503471] 
[   28.503717] The buggy address belongs to the object at ffff888101ab9940
[   28.503717]  which belongs to the cache kmalloc-32 of size 32
[   28.505119] The buggy address is located 16 bytes inside of
[   28.505119]  freed 32-byte region [ffff888101ab9940, ffff888101ab9960)
[   28.506902] 
[   28.507430] The buggy address belongs to the physical page:
[   28.508508] page: refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x101ab9
[   28.509407] flags: 0x200000000000000(node=0|zone=2)
[   28.510472] page_type: f5(slab)
[   28.510814] raw: 0200000000000000 ffff888100041780 dead000000000122 0000000000000000
[   28.511773] raw: 0000000000000000 0000000080400040 00000001f5000000 0000000000000000
[   28.513900] page dumped because: kasan: bad access detected
[   28.514508] 
[   28.514769] Memory state around the buggy address:
[   28.515816]  ffff888101ab9800: 00 00 07 fc fc fc fc fc 00 00 00 fc fc fc fc fc
[   28.517152]  ffff888101ab9880: 00 00 00 fc fc fc fc fc 00 00 07 fc fc fc fc fc
[   28.517637] >ffff888101ab9900: 00 00 00 fc fc fc fc fc fa fb fb fb fc fc fc fc
[   28.518161]                                                  ^
[   28.518696]  ffff888101ab9980: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   28.519213]  ffff888101ab9a00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   28.520012] ==================================================================