Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 E72B130DEAD for ; Mon, 15 Sep 2025 14:26:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1757946384; cv=none; b=BHncPxiMUzLKC3/oGeKSRptzyF0wAZxMBw3jKM8xxBJjyQPykPtpCG+45PDm7kz2w8GueuNEKJndpsUolx73/7XcOXN5O+97kqTeZHSpmu3LDCeCIluW8Oeye2S7EF7Fzewd/ekwvZanZD5M069EWfl/Yi7PdTw1rIMqo7lDJMo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1757946384; c=relaxed/simple; bh=wthSyQEPf7F22Jc2Zc8mF7CtnNsfFg/YKgbMGpnBJ34=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=p26SvPMkCydWL5VCDZPEm4zLfv/Y8Cn/bk+h0FAWn3MzLgQ7GDsZyYS4Rat9Xmj/Gg1YfPb0Ri1BZ36WrjqZ1pFFEQMMzSNf5tMSnhSTnIRdgQ/QcygY6Vl5nxXkAmgKz7CgzOGpPoC+2KCpeOmblBtDeynPc3yNctzk7U/F4Qk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=XeOWZhVE; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="XeOWZhVE" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 02C3DC4CEF1; Mon, 15 Sep 2025 14:26:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1757946383; bh=wthSyQEPf7F22Jc2Zc8mF7CtnNsfFg/YKgbMGpnBJ34=; h=From:To:Cc:Subject:Date:Reply-to:From; b=XeOWZhVEhnlX6dCwUZrRobPlD2J3BpVBVZkPgbDmJBQnH4fXmgzllMyyjwS4KWNEz Oc/lmm/4epfNEkxysLvOlu1wGTM/wOQjjmonUAULn47ew1F2KCGKw7kwxTUjLJ4t+j m9g2puta2awk9bLMMYobfhlkQYNbDi+ODbtLgT/g= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2023-53236: iommufd: Do not corrupt the pfn list when doing batch carry Date: Mon, 15 Sep 2025 16:22:10 +0200 Message-ID: <2025091515-CVE-2023-53236-49ad@gregkh> X-Mailer: git-send-email 2.51.0 Precedence: bulk X-Mailing-List: linux-cve-announce@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Reply-to: , X-Developer-Signature: v=1; a=openpgp-sha256; l=3683; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=yo/lCPj3JJocqUC5Bqk9crJ4I+y53dkk7H9HsJpdBkE=; b=owGbwMvMwCRo6H6F97bub03G02pJDBknFG6H/su5p2rocSmqq2HjQf4vX9hkwu17C0Xzpzz28 /P8krK5I5aFQZCJQVZMkeXLNp6j+ysOKXoZ2p6GmcPKBDKEgYtTACZSsY5hftWOxbfjJhTu+Xmb 8c9WjfxnSa9DghgW7O/pCuKvvfUzbOasPadX2kXf29opAAA= 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: iommufd: Do not corrupt the pfn list when doing batch carry If batch->end is 0 then setting npfns[0] before computing the new value of pfns will fail to adjust the pfn and result in various page accounting corruptions. It should be ordered after. This seems to result in various kinds of page meta-data corruption related failures: WARNING: CPU: 1 PID: 527 at mm/gup.c:75 try_grab_folio+0x503/0x740 Modules linked in: CPU: 1 PID: 527 Comm: repro Not tainted 6.3.0-rc2-eeac8ede1755+ #1 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.16.0-0-gd239552ce722-prebuilt.qemu.org 04/01/2014 RIP: 0010:try_grab_folio+0x503/0x740 Code: e3 01 48 89 de e8 6d c1 dd ff 48 85 db 0f 84 7c fe ff ff e8 4f bf dd ff 49 8d 47 ff 48 89 45 d0 e9 73 fe ff ff e8 3d bf dd ff <0f> 0b 31 db e9 d0 fc ff ff e8 2f bf dd ff 48 8b 5d c8 31 ff 48 89 RSP: 0018:ffffc90000f37908 EFLAGS: 00010046 RAX: 0000000000000000 RBX: 00000000fffffc02 RCX: ffffffff81504c26 RDX: 0000000000000000 RSI: ffff88800d030000 RDI: 0000000000000002 RBP: ffffc90000f37948 R08: 000000000003ca24 R09: 0000000000000008 R10: 000000000003ca00 R11: 0000000000000023 R12: ffffea000035d540 R13: 0000000000000001 R14: 0000000000000000 R15: ffffea000035d540 FS: 00007fecbf659740(0000) GS:ffff88807dd00000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00000000200011c3 CR3: 000000000ef66006 CR4: 0000000000770ee0 PKRU: 55555554 Call Trace: internal_get_user_pages_fast+0xd32/0x2200 pin_user_pages_fast+0x65/0x90 pfn_reader_user_pin+0x376/0x390 pfn_reader_next+0x14a/0x7b0 pfn_reader_first+0x140/0x1b0 iopt_area_fill_domain+0x74/0x210 iopt_table_add_domain+0x30e/0x6e0 iommufd_device_selftest_attach+0x7f/0x140 iommufd_test+0x10ff/0x16f0 iommufd_fops_ioctl+0x206/0x330 __x64_sys_ioctl+0x10e/0x160 do_syscall_64+0x3b/0x90 entry_SYSCALL_64_after_hwframe+0x72/0xdc The Linux kernel CVE team has assigned CVE-2023-53236 to this issue. Affected and fixed versions =========================== Issue introduced in 6.2 with commit f394576eb11dbcd3a740fa41e577b97f0720d26e and fixed in 6.2.11 with commit 6ed5784526ddc0fb58b1798af36ec0c3139a8dca Issue introduced in 6.2 with commit f394576eb11dbcd3a740fa41e577b97f0720d26e and fixed in 6.3 with commit 13a0d1ae7ee6b438f5537711a8c60cba00554943 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-2023-53236 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: drivers/iommu/iommufd/pages.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/6ed5784526ddc0fb58b1798af36ec0c3139a8dca https://git.kernel.org/stable/c/13a0d1ae7ee6b438f5537711a8c60cba00554943