CVE-2023-54137: vfio/type1: fix cap_migration information leak
In the Linux kernel, the following vulnerability has been resolved:
vfio/type1: fix capmigration information leak
Fix an information leak where an uninitialized hole in struct vfioiommutype1infocapmigration on the stack is exposed to userspace.
The definition of struct vfioiommutype1infocapmigration contains a hole as shown in this pahole(1) output:
struct vfioiommutype1infocapmigration { struct vfioinfocapheader header; / 0 8 / u32 flags; / 8 4 /
/ XXX 4 bytes hole, try to pack /
u64 pgsizebitmap; / 16 8 / u64 maxdirtybitmapsize; / 24 8 /
/ size: 32, cachelines: 1, members: 4 / / sum members: 28, holes: 1, sum holes: 4 / / last cacheline: 32 bytes / };
The capmig variable is filled in without initializing the hole:
static int vfioiommumigrationbuildcaps(struct vfioiommu iommu, struct vfioinfocap caps) { struct vfioiommutype1infocapmigration capmig;
capmig.header.id = VFIOIOMMUTYPE1INFOCAPMIGRATION; capmig.header.version = 1;
capmig.flags = 0; / support minimum pgsize / capmig.pgsizebitmap = (sizet)1 << ffs(iommu->pgsizebitmap); capmig.maxdirtybitmapsize = DIRTYBITMAPSIZEMAX;
return vfioinfoaddcapability(caps, &capmig.header, sizeof(capmig)); }
The structure is then copied to a temporary location on the heap. At this point it's already too late and ioctl(VFIOIOMMUGETINFO) copies it to userspace later:
int vfioinfoaddcapability(struct vfioinfocap caps, struct vfioinfocapheader cap, sizet size) { struct vfioinfocapheader header;
header = vfioinfocapadd(caps, size, cap->id, cap->version); if (ISERR(header)) return PTRERR(header);
memcpy(header + 1, cap + 1, size - sizeof(header));
return 0; }
This issue was found by code inspection.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
ubuntu/linux-aws-5.15to a version that resolves this vulnerability.Fixed in 5.15.0-1053.58~20.04.1 - Upgrade
Upgrade
ubuntu/linux-azure-5.15to a version that resolves this vulnerability.Fixed in 5.15.0-1056.64~20.04.1 - Upgrade
Upgrade
ubuntu/linux-gcp-5.15to a version that resolves this vulnerability.Fixed in 5.15.0-1051.59~20.04.1 - Upgrade
Upgrade
ubuntu/linux-hwe-5.15to a version that resolves this vulnerability.Fixed in 5.15.0-94.104~20.04.1 - Upgrade
Upgrade
ubuntu/linux-ibm-5.15to a version that resolves this vulnerability.Fixed in 5.15.0-1046.49~20.04.1 - Upgrade
Upgrade
ubuntu/linux-intel-iotg-5.15to a version that resolves this vulnerability.Fixed in 5.15.0-1048.54~20.04.1 - Upgrade
Upgrade
ubuntu/linux-lowlatency-hwe-5.15to a version that resolves this vulnerability.Fixed in 5.15.0-94.104~20.04.1 - Upgrade
Upgrade
ubuntu/linux-nvidia-tegra-5.15to a version that resolves this vulnerability.Fixed in 5.15.0-1022.22~20.04.1 - Upgrade
Upgrade
ubuntu/linux-oracle-5.15to a version that resolves this vulnerability.Fixed in 5.15.0-1051.57~20.04.1 - Upgrade
Upgrade
ubuntu/linux-riscv-5.15to a version that resolves this vulnerability.Fixed in 5.15.0-1049.53~20.04.2 - Upgrade
Upgrade
ubuntu/linuxto a version that resolves this vulnerability.Fixed in 5.15.0-94.104 - Upgrade
Upgrade
ubuntu/linux-awsto a version that resolves this vulnerability.Fixed in 5.15.0-1053.58 - Upgrade
Upgrade
ubuntu/linux-azureto a version that resolves this vulnerability.Fixed in 5.15.0-1056.64 - Upgrade
Upgrade
ubuntu/linux-azure-fdeto a version that resolves this vulnerability.Fixed in 5.15.0-1056.64.1 - Upgrade
Upgrade
ubuntu/linux-gcpto a version that resolves this vulnerability.Fixed in 5.15.0-1051.59 - Upgrade
Upgrade
ubuntu/linux-gketo a version that resolves this vulnerability.Fixed in 5.15.0-1050.55 - Upgrade
Upgrade
ubuntu/linux-gkeopto a version that resolves this vulnerability.Fixed in 5.15.0-1036.42 - Upgrade
Upgrade
ubuntu/linux-ibmto a version that resolves this vulnerability.Fixed in 5.15.0-1046.49 - Upgrade
Upgrade
ubuntu/linux-intel-iotgto a version that resolves this vulnerability.Fixed in 5.15.0-1047.53 - Upgrade
Upgrade
ubuntu/linux-kvmto a version that resolves this vulnerability.Fixed in 5.15.0-1050.55 - Upgrade
Upgrade
ubuntu/linux-lowlatencyto a version that resolves this vulnerability.Fixed in 5.15.0-94.104 - Upgrade
Upgrade
ubuntu/linux-nvidiato a version that resolves this vulnerability.Fixed in 5.15.0-1044.44 - Upgrade
Upgrade
ubuntu/linux-nvidia-tegrato a version that resolves this vulnerability.Fixed in 5.15.0-1022.22 - Upgrade
Upgrade
ubuntu/linux-nvidia-tegra-igxto a version that resolves this vulnerability.Fixed in 5.15.0-1009.9 - Upgrade
Upgrade
ubuntu/linux-oracleto a version that resolves this vulnerability.Fixed in 5.15.0-1051.57 - Upgrade
Upgrade
ubuntu/linux-raspito a version that resolves this vulnerability.Fixed in 5.15.0-1046.49 - Upgrade
Upgrade
ubuntu/linux-xilinx-zynqmpto a version that resolves this vulnerability.Fixed in 5.15.0-1027.31 - Upgrade
Upgrade
ubuntu/linux-bluefieldto a version that resolves this vulnerability.Fixed in 5.15.0-1035.37 - Upgrade
Upgrade
ubuntu/linux-intel-iot-realtimeto a version that resolves this vulnerability.Fixed in 5.15.0-1046.48 - Upgrade
Upgrade
ubuntu/linux-realtimeto a version that resolves this vulnerability.Fixed in 5.15.0-1054.60 - Upgrade
Upgrade
ubuntu/linux-aws-fipsto a version that resolves this vulnerability.Fixed in 5.15.0-1053.58+fips1 - Upgrade
Upgrade
ubuntu/linux-fipsto a version that resolves this vulnerability.Fixed in 5.15.0-94.104+fips1 - Upgrade
Upgrade
ubuntu/linux-gcp-fipsto a version that resolves this vulnerability.Fixed in 5.15.0-1055.63+fips2
Event History
Frequently Asked Questions
What is the severity of CVE-2023-54137?
CVE-2023-54137 is classified with a moderate severity due to the potential information leak.
How do I fix CVE-2023-54137?
To address CVE-2023-54137, update to the latest version of the Linux kernel where this vulnerability is resolved.
What impact does CVE-2023-54137 have on Linux kernel users?
CVE-2023-54137 could expose sensitive data from uninitialized memory, potentially leading to information disclosure.
When was CVE-2023-54137 published?
CVE-2023-54137 was published on October 20, 2023.
Which versions of the Linux kernel are affected by CVE-2023-54137?
CVE-2023-54137 affects specific versions of the Linux kernel prior to the release that fixed the information leak.