From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4C1D954DAC7 for ; Fri, 11 Sep 2026 20:04:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789157063; cv=none; b=RJ7jSLZnCxKnSspjOJM4lY3TpcVHVSWGErZiibisZcXG90NxLAxqJhszUdSwPub5xqzTP0K9q4MPtrlNd+qnwiT1LYSI1GnuiEw4I+hRk3YoOnS93d6f75BNwTDH+flv70pEiKn3l7TC6BNJ9NnFGykaSz0m1j68ef15WCL00PI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789157063; c=relaxed/simple; bh=8kjflYDogLF3u1RvAk0DBgL2XTSMz+2VbPBjx882tao=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=PvdJZim2xlgAMiSSLis/Cpbcl9FdMkXHI38muhde/SMhIJPPAeDEtUuXhWgqFfwtcSzqdQdpt9A2ieVqm0EYJY8dU2DS66iGYWYMbf9x954q5tTLT111rt817zqnGRPWxgbBuzqXH71tF33En3b18XEBF6FIAGEoYe4pgJzZxqM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=K5P3O5Wz; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="K5P3O5Wz" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 044131F00899; Fri, 11 Sep 2026 20:04:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1789157057; bh=5Ujc9SLr0/D/iSauxXfAIYf5tc8bwUKUfkdcey5/GLQ=; h=From:To:Cc:Subject:Date:Reply-To; b=K5P3O5WzuaMBilV1lk+mYR/mRt9uf1d2BxVnm57jWYZKdvVT+fV7UFUeh+5akIPr1 hlBqyWmyRDYcktIwSD+rGMceKoDR2WYu/ou1I9xyCdvfFy88PT6yMpCAixK6algfl+ s2MFEwcJRyM30ILeol5+vSIvwINJPju/InjaSRXQ= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2026-89722: PCI/sysfs: Fix out-of-bounds read in pci_write_legacy_io() Date: Fri, 11 Sep 2026 21:46:51 +0200 Message-ID: <2026091100-CVE-2026-89722-a0f5@gregkh> X-Mailer: git-send-email 2.55.0 Reply-To: , Precedence: bulk X-Mailing-List: linux-cve-announce@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=3340; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=GsMWFejPCKY8oWMQ2Q7F5SQ8JganixEUondIwEem7bQ=; b=owGbwMvMwCRo6H6F97bub03G02pJDFlLIjsc1AtS2g4HeD1r5Xpu3xDv1aTzKEluk6zXes3fE /kWr6roiGVhEGRikBVTZPmyjefo/opDil6Gtqdh5rAygQxh4OIUgIksVGeYZy6+e5Jb3zTjPT/j y7bcWNBj93r6HIZ5Wpvfz/w432Yvh+uU03bXDeXvvPY1AAA= X-Developer-Key: i=gregkh@linuxfoundation.org; a=openpgp; fpr=F4B60CC5BF78C2214A313DCB3147D40DDB2DFB29 Content-Transfer-Encoding: 8bit From: Greg Kroah-Hartman Description =========== In the Linux kernel, the following vulnerability has been resolved: PCI/sysfs: Fix out-of-bounds read in pci_write_legacy_io() pci_write_legacy_io() 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 pci_legacy_write(bus, off, *(u32 *)buf, count); kernfs_fop_write_iter() allocates the buffer with kmalloc(len + 1), so a 1-byte write to the legacy_io 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 get_unaligned_le16() and get_unaligned_le32() 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 out_le16() and out_le32() 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 legacy_io file is root-only and exists only on Alpha and PowerPC, the two architectures that define HAVE_PCI_LEGACY. The Linux kernel CVE team has assigned CVE-2026-89722 to this issue. Affected and fixed versions =========================== Fixed in 6.18.50 with commit e892f05f1f790d5721cd8e3c561ed76da7e08bae Fixed in 7.2.4 with commit 7a99e9c7011905734cc2739038f2a224b6be0d1f Fixed in 7.3-rc1 with commit dc76258d0132df1d831a5a29758bd448ca9c566e Please see https://www.kernel.org for a full list of currently supported kernel versions by the kernel community. Unaffected versions might change over time as fixes are backported to older supported kernel versions. The official CVE entry at https://cve.org/CVERecord/?id=CVE-2026-89722 will be updated if fixes are backported, please check that for the most up to date information about this issue. Affected files ============== The file(s) affected by this issue are: arch/powerpc/kernel/pci-common.c drivers/pci/pci-sysfs.c Mitigation ========== The Linux kernel CVE team recommends that you update to the latest stable kernel version for this, and many other bugfixes. Individual changes are never tested alone, but rather are part of a larger kernel release. Cherry-picking individual commits is not recommended or supported by the Linux kernel community at all. If however, updating to the latest release is impossible, the individual changes to resolve this issue can be found at these commits: https://git.kernel.org/stable/c/e892f05f1f790d5721cd8e3c561ed76da7e08bae https://git.kernel.org/stable/c/7a99e9c7011905734cc2739038f2a224b6be0d1f https://git.kernel.org/stable/c/dc76258d0132df1d831a5a29758bd448ca9c566e