UBUNTU-CVE-2026-89722: Low severity ubuntu/linux vulnerability
In the Linux kernel, the following vulnerability has been resolved: PCI/sysfs: Fix out-of-bounds read in pciwritelegacyio() pciwritelegacyio() loads 4 bytes from the kernfs write buffer regardless of how many bytes userspace wrote: if (count != 1 && count != 2 && count != 4) return -EINVAL; return pcilegacywrite(bus, off, (u32 )buf, count); kernfsfopwriteiter() allocates the buffer with kmalloc(len + 1), so a 1-byte write to the legacyio sysfs file allocates 2 bytes and the unconditional u32 load reads up to 2 bytes past the end of the allocation, which KASAN reports as a slab-out-of-bounds read. Similarly, a 2-byte write overreads by 1 byte. Thus, read only the number of bytes requested using getunalignedle16() and getunalignedle32() for the 2 and 4 byte cases, interpreting the buffer as little-endian to match the byte ordering of PCI I/O port space. The PowerPC implementation previously compensated for the generic code's native-endian 32-bit load by shifting the value into place for the 1 and 2 byte cases. The shifts were only correct on big-endian kernels. On little-endian PowerPC (POWER8 and later), they extracted the wrong bytes, so a 1-byte write wrote an out-of-bounds byte instead of the requested value. On big-endian, the native load also caused outle16() and outle32() to reverse the user's bytes on the wire for 2 and 4 byte writes. The little-endian helpers resolve both issues, so the shifts are removed. No changes are needed for the Alpha platform. The legacyio file is root-only and exists only on Alpha and PowerPC, the two architectures that define HAVEPCILEGACY.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
ubuntu/linux-hwe-7.0to a version that resolves this vulnerability.Fixed in 7.0.0-42.42~24.04.1 - Upgrade
Upgrade
ubuntu/linux-riscv-7.0to a version that resolves this vulnerability.Fixed in 7.0.0-42.42.1~24.04.1 - Upgrade
Upgrade
ubuntu/linuxto a version that resolves this vulnerability.Fixed in 7.0.0-42.42 - Upgrade
Upgrade
ubuntu/linux-awsto a version that resolves this vulnerability.Fixed in 7.0.0-1016.17 - Upgrade
Upgrade
ubuntu/linux-gcpto a version that resolves this vulnerability.Fixed in 7.0.0-1016.18 - Upgrade
Upgrade
ubuntu/linux-ibmto a version that resolves this vulnerability.Fixed in 7.0.0-1017.17 - Upgrade
Upgrade
ubuntu/linux-oem-7.0to a version that resolves this vulnerability.Fixed in 7.0.0-1017.17 - Upgrade
Upgrade
ubuntu/linux-oracleto a version that resolves this vulnerability.Fixed in 7.0.0-1015.16 - Upgrade
Upgrade
ubuntu/linux-riscvto a version that resolves this vulnerability.Fixed in 7.0.0-42.42.1 - Compensating control
Update pci_write_legacy_io() to read only the requested number of bytes: use get_unaligned_le16() for 2-byte writes and get_unaligned_le32() for 4-byte writes, interpreting the buffer as little-endian; remove the PowerPC shifts used for the 1- and 2-byte cases.
Event History
Frequently Asked Questions
What access is required to trigger the issue?
An attacker needs to perform a 1-byte or 2-byte write to a PCI legacy_io sysfs file. Those write sizes cause pci_write_legacy_io() to read beyond the kernfs write-buffer allocation.
Which Ubuntu kernel package families are listed as affected?
The listed packages are ubuntu/linux, ubuntu/linux-fips, ubuntu/linux-aws, ubuntu/linux-azure, ubuntu/linux-aws-fips, ubuntu/linux-azure-fips, ubuntu/linux-gcp, and ubuntu/linux-gcp-fips.
How could an existing issue be detected during testing?
KASAN can report the condition as a slab-out-of-bounds read. The report can occur when a 1-byte write reads up to two bytes past the allocation, or when a 2-byte write reads one byte past it.
Is there an architecture-specific functional impact described?
On little-endian PowerPC systems, including POWER8 and later, the prior handling of 1-byte and 2-byte writes could extract and write the wrong bytes. The resolved code reads the requested byte count using little-endian handling to match PCI I/O port byte ordering.