Hay
Date
Nov. 20, 2024, 6:35 a.m.

Environment
qemu-arm64
qemu-x86_64

[   39.827006] ==================================================================
[   39.827987] BUG: KASAN: slab-use-after-free in kasan_strings+0x858/0x8f8
[   39.828795] Read of size 1 at addr fff00000c65a90d0 by task kunit_try_catch/248
[   39.829938] 
[   39.830304] CPU: 0 UID: 0 PID: 248 Comm: kunit_try_catch Tainted: G    B            N 6.12.0-next-20241120 #1
[   39.831399] Tainted: [B]=BAD_PAGE, [N]=TEST
[   39.832038] Hardware name: linux,dummy-virt (DT)
[   39.832701] Call trace:
[   39.833175]  show_stack+0x20/0x38 (C)
[   39.833870]  dump_stack_lvl+0x8c/0xd0
[   39.834565]  print_report+0x118/0x5e0
[   39.835259]  kasan_report+0xc8/0x118
[   39.835859]  __asan_report_load1_noabort+0x20/0x30
[   39.836550]  kasan_strings+0x858/0x8f8
[   39.837204]  kunit_try_run_case+0x14c/0x3d0
[   39.838176]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   39.838928]  kthread+0x24c/0x2d0
[   39.839511]  ret_from_fork+0x10/0x20
[   39.840085] 
[   39.840472] Allocated by task 248:
[   39.841042]  kasan_save_stack+0x3c/0x68
[   39.841791]  kasan_save_track+0x20/0x40
[   39.842636]  kasan_save_alloc_info+0x40/0x58
[   39.843190]  __kasan_kmalloc+0xd4/0xd8
[   39.843780]  __kmalloc_cache_noprof+0x15c/0x3c8
[   39.844362]  kasan_strings+0xb4/0x8f8
[   39.844875]  kunit_try_run_case+0x14c/0x3d0
[   39.845955]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   39.846474]  kthread+0x24c/0x2d0
[   39.846939]  ret_from_fork+0x10/0x20
[   39.847509] 
[   39.847862] Freed by task 248:
[   39.848363]  kasan_save_stack+0x3c/0x68
[   39.848980]  kasan_save_track+0x20/0x40
[   39.849935]  kasan_save_free_info+0x4c/0x78
[   39.850567]  __kasan_slab_free+0x6c/0x98
[   39.851165]  kfree+0x114/0x3d0
[   39.851599]  kasan_strings+0x128/0x8f8
[   39.852170]  kunit_try_run_case+0x14c/0x3d0
[   39.852704]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   39.853764]  kthread+0x24c/0x2d0
[   39.854262]  ret_from_fork+0x10/0x20
[   39.854737] 
[   39.855072] The buggy address belongs to the object at fff00000c65a90c0
[   39.855072]  which belongs to the cache kmalloc-32 of size 32
[   39.856339] The buggy address is located 16 bytes inside of
[   39.856339]  freed 32-byte region [fff00000c65a90c0, fff00000c65a90e0)
[   39.857436] 
[   39.857798] The buggy address belongs to the physical page:
[   39.858492] page: refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1065a9
[   39.859264] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   39.860395] page_type: f5(slab)
[   39.860925] raw: 0bfffe0000000000 fff00000c0001780 dead000000000122 0000000000000000
[   39.862092] raw: 0000000000000000 0000000080400040 00000001f5000000 0000000000000000
[   39.862886] page dumped because: kasan: bad access detected
[   39.863517] 
[   39.863828] Memory state around the buggy address:
[   39.864463]  fff00000c65a8f80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   39.865102]  fff00000c65a9000: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc
[   39.867063] >fff00000c65a9080: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc
[   39.868332]                                                  ^
[   39.868931]  fff00000c65a9100: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   39.869870]  fff00000c65a9180: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   39.870681] ==================================================================

[   31.481309] ==================================================================
[   31.481762] BUG: KASAN: slab-use-after-free in kasan_strings+0xa0f/0xb60
[   31.482511] Read of size 1 at addr ffff8881029f3d50 by task kunit_try_catch/266
[   31.483770] 
[   31.484405] CPU: 1 UID: 0 PID: 266 Comm: kunit_try_catch Tainted: G    B            N 6.12.0-next-20241120 #1
[   31.486041] Tainted: [B]=BAD_PAGE, [N]=TEST
[   31.486331] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   31.487460] Call Trace:
[   31.488066]  <TASK>
[   31.488283]  dump_stack_lvl+0x73/0xb0
[   31.489316]  print_report+0xd1/0x640
[   31.489591]  ? __virt_addr_valid+0x1db/0x2d0
[   31.490572]  ? kasan_complete_mode_report_info+0x64/0x200
[   31.491685]  kasan_report+0x102/0x140
[   31.492074]  ? kasan_strings+0xa0f/0xb60
[   31.492871]  ? kasan_strings+0xa0f/0xb60
[   31.493820]  __asan_report_load1_noabort+0x18/0x20
[   31.494357]  kasan_strings+0xa0f/0xb60
[   31.495070]  ? __pfx_kasan_strings+0x10/0x10
[   31.495630]  ? __schedule+0xc3e/0x2790
[   31.496591]  ? __pfx_read_tsc+0x10/0x10
[   31.497572]  ? ktime_get_ts64+0x84/0x230
[   31.498076]  kunit_try_run_case+0x1b3/0x490
[   31.498909]  ? __pfx_kunit_try_run_case+0x10/0x10
[   31.499594]  ? _raw_spin_lock_irqsave+0xa2/0x110
[   31.500419]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   31.501520]  ? __kthread_parkme+0x82/0x160
[   31.502146]  ? preempt_count_sub+0x50/0x80
[   31.502535]  ? __pfx_kunit_try_run_case+0x10/0x10
[   31.503484]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   31.504853]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   31.505268]  kthread+0x257/0x310
[   31.506044]  ? __pfx_kthread+0x10/0x10
[   31.506664]  ret_from_fork+0x41/0x80
[   31.506978]  ? __pfx_kthread+0x10/0x10
[   31.508088]  ret_from_fork_asm+0x1a/0x30
[   31.508754]  </TASK>
[   31.509074] 
[   31.509522] Allocated by task 266:
[   31.509824]  kasan_save_stack+0x3d/0x60
[   31.510317]  kasan_save_track+0x18/0x40
[   31.510791]  kasan_save_alloc_info+0x3b/0x50
[   31.511267]  __kasan_kmalloc+0xb7/0xc0
[   31.511822]  __kmalloc_cache_noprof+0x184/0x410
[   31.512144]  kasan_strings+0xb3/0xb60
[   31.512479]  kunit_try_run_case+0x1b3/0x490
[   31.513338]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   31.513859]  kthread+0x257/0x310
[   31.514214]  ret_from_fork+0x41/0x80
[   31.514782]  ret_from_fork_asm+0x1a/0x30
[   31.515114] 
[   31.515307] Freed by task 266:
[   31.515768]  kasan_save_stack+0x3d/0x60
[   31.516681]  kasan_save_track+0x18/0x40
[   31.517012]  kasan_save_free_info+0x3f/0x60
[   31.517378]  __kasan_slab_free+0x56/0x70
[   31.518158]  kfree+0x123/0x3f0
[   31.518454]  kasan_strings+0x13a/0xb60
[   31.518911]  kunit_try_run_case+0x1b3/0x490
[   31.519211]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   31.519917]  kthread+0x257/0x310
[   31.520342]  ret_from_fork+0x41/0x80
[   31.520956]  ret_from_fork_asm+0x1a/0x30
[   31.521335] 
[   31.521513] The buggy address belongs to the object at ffff8881029f3d40
[   31.521513]  which belongs to the cache kmalloc-32 of size 32
[   31.522447] The buggy address is located 16 bytes inside of
[   31.522447]  freed 32-byte region [ffff8881029f3d40, ffff8881029f3d60)
[   31.523309] 
[   31.523469] The buggy address belongs to the physical page:
[   31.524490] page: refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1029f3
[   31.525811] flags: 0x200000000000000(node=0|zone=2)
[   31.526377] page_type: f5(slab)
[   31.526622] raw: 0200000000000000 ffff888100041780 dead000000000122 0000000000000000
[   31.527446] raw: 0000000000000000 0000000080400040 00000001f5000000 0000000000000000
[   31.528320] page dumped because: kasan: bad access detected
[   31.528678] 
[   31.528858] Memory state around the buggy address:
[   31.529163]  ffff8881029f3c00: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc
[   31.529786]  ffff8881029f3c80: 00 00 00 fc fc fc fc fc 00 00 00 fc fc fc fc fc
[   31.531029] >ffff8881029f3d00: 00 00 07 fc fc fc fc fc fa fb fb fb fc fc fc fc
[   31.532064]                                                  ^
[   31.532649]  ffff8881029f3d80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   31.533082]  ffff8881029f3e00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   31.533886] ==================================================================