7.8
CWE
129
Advisory Published
CVE Published
Updated

CVE-2023-52451: powerpc/pseries/memhp: Fix access beyond end of drmem array

First published: Thu Feb 22 2024(Updated: )

In the Linux kernel, the following vulnerability has been resolved: powerpc/pseries/memhp: Fix access beyond end of drmem array dlpar_memory_remove_by_index() may access beyond the bounds of the drmem lmb array when the LMB lookup fails to match an entry with the given DRC index. When the search fails, the cursor is left pointing to &drmem_info->lmbs[drmem_info->n_lmbs], which is one element past the last valid entry in the array. The debug message at the end of the function then dereferences this pointer: pr_debug("Failed to hot-remove memory at %llx\n", lmb->base_addr); This was found by inspection and confirmed with KASAN: pseries-hotplug-mem: Attempting to hot-remove LMB, drc index 1234 ================================================================== BUG: KASAN: slab-out-of-bounds in dlpar_memory+0x298/0x1658 Read of size 8 at addr c000000364e97fd0 by task bash/949 dump_stack_lvl+0xa4/0xfc (unreliable) print_report+0x214/0x63c kasan_report+0x140/0x2e0 __asan_load8+0xa8/0xe0 dlpar_memory+0x298/0x1658 handle_dlpar_errorlog+0x130/0x1d0 dlpar_store+0x18c/0x3e0 kobj_attr_store+0x68/0xa0 sysfs_kf_write+0xc4/0x110 kernfs_fop_write_iter+0x26c/0x390 vfs_write+0x2d4/0x4e0 ksys_write+0xac/0x1a0 system_call_exception+0x268/0x530 system_call_vectored_common+0x15c/0x2ec Allocated by task 1: kasan_save_stack+0x48/0x80 kasan_set_track+0x34/0x50 kasan_save_alloc_info+0x34/0x50 __kasan_kmalloc+0xd0/0x120 __kmalloc+0x8c/0x320 kmalloc_array.constprop.0+0x48/0x5c drmem_init+0x2a0/0x41c do_one_initcall+0xe0/0x5c0 kernel_init_freeable+0x4ec/0x5a0 kernel_init+0x30/0x1e0 ret_from_kernel_user_thread+0x14/0x1c The buggy address belongs to the object at c000000364e80000 which belongs to the cache kmalloc-128k of size 131072 The buggy address is located 0 bytes to the right of allocated 98256-byte region [c000000364e80000, c000000364e97fd0) ================================================================== pseries-hotplug-mem: Failed to hot-remove memory at 0 Log failed lookups with a separate message and dereference the cursor only when it points to a valid entry.

Credit: 416baaa9-dc9f-4396-8d5f-8c081fb06d67 416baaa9-dc9f-4396-8d5f-8c081fb06d67

Affected SoftwareAffected VersionHow to fix
Linux Linux kernel>=4.1.0<4.19.306
Linux Linux kernel>=4.20.0<5.4.268
Linux Linux kernel>=5.5.0<5.10.209
Linux Linux kernel>=5.11.0<5.15.148
Linux Linux kernel>=5.16.0<6.1.75
Linux Linux kernel>=6.2.0<6.6.14
Linux Linux kernel>=6.7.0<6.7.2
ubuntu/linux<4.15.0-224.236
4.15.0-224.236
ubuntu/linux<5.4.0-176.196
5.4.0-176.196
ubuntu/linux<5.15.0-102.112
5.15.0-102.112
ubuntu/linux<4.4.0-253.287
4.4.0-253.287
ubuntu/linux-aws<4.15.0-1167.180
4.15.0-1167.180
ubuntu/linux-aws<5.4.0-1122.132
5.4.0-1122.132
ubuntu/linux-aws<5.15.0-1057.63
5.15.0-1057.63
ubuntu/linux-aws<4.4.0-1130.136
4.4.0-1130.136
ubuntu/linux-aws<4.4.0-1168.183
4.4.0-1168.183
ubuntu/linux-aws-5.15<5.15.0-1057.63~20.04.1
5.15.0-1057.63~20.04.1
ubuntu/linux-aws-5.4<5.4.0-1122.132~18.04.1
5.4.0-1122.132~18.04.1
ubuntu/linux-aws-hwe<4.15.0-1167.180~16.04.1
4.15.0-1167.180~16.04.1
ubuntu/linux-azure<5.4.0-1127.134
5.4.0-1127.134
ubuntu/linux-azure<5.15.0-1060.69
5.15.0-1060.69
ubuntu/linux-azure<4.15.0-1176.191~14.04.1
4.15.0-1176.191~14.04.1
ubuntu/linux-azure<4.15.0-1176.191~16.04.1
4.15.0-1176.191~16.04.1
ubuntu/linux-azure-4.15<4.15.0-1176.191
4.15.0-1176.191
ubuntu/linux-azure-5.15<5.15.0-1060.69~20.04.1
5.15.0-1060.69~20.04.1
ubuntu/linux-azure-5.4<5.4.0-1127.134~18.04.1
5.4.0-1127.134~18.04.1
ubuntu/linux-azure-fde<5.15.0-1060.69.1
5.15.0-1060.69.1
ubuntu/linux-azure-fde-5.15<5.15.0-1060.69~20.04.1.1
5.15.0-1060.69~20.04.1.1
ubuntu/linux-bluefield<5.4.0-1082.89
5.4.0-1082.89
ubuntu/linux-bluefield<5.15.0-1040.42
5.15.0-1040.42
ubuntu/linux-gcp<5.4.0-1126.135
5.4.0-1126.135
ubuntu/linux-gcp<5.15.0-1055.63
5.15.0-1055.63
ubuntu/linux-gcp<4.15.0-1161.178~16.04.1
4.15.0-1161.178~16.04.1
ubuntu/linux-gcp-4.15<4.15.0-1161.178
4.15.0-1161.178
ubuntu/linux-gcp-5.15<5.15.0-1055.63~20.04.1
5.15.0-1055.63~20.04.1
ubuntu/linux-gcp-5.4<5.4.0-1126.135~18.04.1
5.4.0-1126.135~18.04.1
ubuntu/linux-gke<5.15.0-1054.59
5.15.0-1054.59
ubuntu/linux-gkeop<5.4.0-1089.93
5.4.0-1089.93
ubuntu/linux-gkeop<5.15.0-1040.46
5.15.0-1040.46
ubuntu/linux-gkeop-5.15<5.15.0-1040.46~20.04.1
5.15.0-1040.46~20.04.1
ubuntu/linux-hwe<4.15.0-224.236~16.04.1
4.15.0-224.236~16.04.1
ubuntu/linux-hwe-5.15<5.15.0-102.112~20.04.1
5.15.0-102.112~20.04.1
ubuntu/linux-hwe-5.4<5.4.0-175.195~18.04.1
5.4.0-175.195~18.04.1
ubuntu/linux-ibm<5.4.0-1069.74
5.4.0-1069.74
ubuntu/linux-ibm<5.15.0-1050.53
5.15.0-1050.53
ubuntu/linux-ibm-5.15<5.15.0-1050.53~20.04.1
5.15.0-1050.53~20.04.1
ubuntu/linux-ibm-5.4<5.4.0-1069.74~18.04.1
5.4.0-1069.74~18.04.1
ubuntu/linux-intel-iotg<5.15.0-1052.58
5.15.0-1052.58
ubuntu/linux-intel-iotg-5.15<5.15.0-1052.58~20.04.1
5.15.0-1052.58~20.04.1
ubuntu/linux-iot<5.4.0-1034.35
5.4.0-1034.35
ubuntu/linux-kvm<4.15.0-1151.156
4.15.0-1151.156
ubuntu/linux-kvm<5.4.0-1110.117
5.4.0-1110.117
ubuntu/linux-kvm<5.15.0-1054.59
5.15.0-1054.59
ubuntu/linux-kvm<4.4.0-1131.141
4.4.0-1131.141
ubuntu/linux-lowlatency<5.15.0-102.112
5.15.0-102.112
ubuntu/linux-lowlatency-hwe-5.15<5.15.0-102.112~20.04.1
5.15.0-102.112~20.04.1
ubuntu/linux-lts-xenial<4.4.0-253.287~14.04.1
4.4.0-253.287~14.04.1
ubuntu/linux-nvidia<5.15.0-1048.48
5.15.0-1048.48
ubuntu/linux-oem-6.1<6.1.0-1035.35
6.1.0-1035.35
ubuntu/linux-oracle<4.15.0-1130.141
4.15.0-1130.141
ubuntu/linux-oracle<5.4.0-1121.130
5.4.0-1121.130
ubuntu/linux-oracle<5.15.0-1055.61
5.15.0-1055.61
ubuntu/linux-oracle<4.15.0-1130.141~16.04.1
4.15.0-1130.141~16.04.1
ubuntu/linux-oracle-5.15<5.15.0-1055.61~20.04.1
5.15.0-1055.61~20.04.1
ubuntu/linux-oracle-5.4<5.4.0-1121.130~18.04.1
5.4.0-1121.130~18.04.1
ubuntu/linux-raspi<5.4.0-1106.118
5.4.0-1106.118
ubuntu/linux-raspi<5.15.0-1050.53
5.15.0-1050.53
ubuntu/linux-raspi-5.4<5.4.0-1106.118~18.04.1
5.4.0-1106.118~18.04.1
ubuntu/linux-riscv-5.15<5.15.0-1053.57~20.04.1
5.15.0-1053.57~20.04.1
ubuntu/linux-xilinx-zynqmp<5.4.0-1041.45
5.4.0-1041.45
debian/linux<=4.19.249-2<=4.19.304-1
5.10.209-2
5.10.218-1
6.1.76-1
6.1.90-1
6.7.12-1
6.8.12-1

Never miss a vulnerability like this again

Sign up to SecAlerts for real-time vulnerability data matched to your software, aggregated from hundreds of sources.

Parent vulnerabilities

(Appears in the following advisories)

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2024 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203