From mboxrd@z Thu Jan 1 00:00:00 1970 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 9EFDA158D67 for ; Thu, 29 Feb 2024 15:53:42 +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=1709222022; cv=none; b=ODxfOn4w/VO/G/yqxvpXqVpzb5m/Jmc15qRNuW650F8gD+yVlcFDXcKSG9XqNh5QWR+GLcUn4SMvRMwTJ9YQKArfRs+ehfL3w2E76jM5SM6AQQmYeA9h8MadVwAb10NbOx+BJuHCHnuea8umjn3CXI4OIWX3sR4eQkB5JEW8YCM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709222022; c=relaxed/simple; bh=rgm0wOSdI+rQsyx14YZBjkDdVtSQtTBrtN++sFC+4tI=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=kKB4M79XEAG1ZMjyOzyFBCroMCYiO/SDae4MH+U377ofwYiL9gFGkZxywrl/Ai2aM57vkWqk7ZUJae3jtM6GVSSNMCqEUbgFiBcsKfY7Ezf1+r0yZ0rvbelG89Y5BgWEXFR3t2PcQ/1hn1y8j1dwhARA4o1XHEaOthB8/+Devl0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=c9sDFTqy; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="c9sDFTqy" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 89198C433B1; Thu, 29 Feb 2024 15:53:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1709222022; bh=rgm0wOSdI+rQsyx14YZBjkDdVtSQtTBrtN++sFC+4tI=; h=From:To:Cc:Subject:Date:Reply-to:From; b=c9sDFTqynqnRakvyj6Ov5UzwYFULBSg4GhMARKilslu8HDSZ8o91BsKKNj0aavEpm Cz2GULx+DSD75NE1tNB/oC+NMCjdoepeHi0PzXHdrckwcqDqHZ/JYA8RwoVfnsZVaH /2j6M3stDBt6aKEa2kR+cdPkEILHZd5bfzMHVCqXMXHodgnjSWNI7OcX88Jz11yTAF iw3IM7pqtZDVGJql1x53X2YVl56JNxX9CYwl91W7k61AjwOMwMrKN0D/9H+B6wornY UKxE/tch4SP96xMYm/58Tt6Sb/DPsSn1BWMF1Q984SycNd5T5cD5xj46EfcAGpkRrA kNVvPIad8PP4Q== From: Lee Jones To: linux-cve-announce@vger.kernel.org Cc: Lee Jones Subject: CVE-2024-26620: s390/vfio-ap: always filter entire AP matrix Date: Thu, 29 Feb 2024 15:53:11 +0000 Message-ID: <20240229155245.1571576-52-lee@kernel.org> X-Mailer: git-send-email 2.44.0.rc1.240.g4c46232300-goog 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=3682; i=lee@kernel.org; h=from:subject; bh=rgm0wOSdI+rQsyx14YZBjkDdVtSQtTBrtN++sFC+4tI=; b=owEBbQKS/ZANAwAKAVGvii+H/HdhAcsmYgBl4KhQTUq76nSLPTylP6vOWqK3A/NXi2TkfWqzo 8gNYHnq+WiJAjMEAAEKAB0WIQR2tsk1o74gmpTwh0hRr4ovh/x3YQUCZeCoUAAKCRBRr4ovh/x3 YWDoD/4hwfMaZXyPTfrb+SS2urr15G3l0/bUOq2EYpnqOCaFc0mqEzfRF74fGMxVU8XoFKOUoLH bGhZXBOmqvdezQgBSk3OwE0QKJOyRfJLnKggsJ2Em0ZArkR5sOSr4GZvqXaYlQYt5IstAyp3muW HbyaQA5i51pwdGYVqPcZzEF4FIy+Zc4oTaarq+T9rftG0b7QDdyDw68tgHHIwuFCVdWsap0TkC1 nEZ7OW4G/BPvWHzQUYpZOMtZN+emETOcJxvAa0+pr1hM2Sbos8AcZxULolcVAlIK0ft1gUrxf3d CP+0tMleNJ/nDcsZ85DvKi8ZfuKQiPbCFIE77XRTK/bNrTxN26r8gHvws8L6ynII1shivZEiKyL ueowFUTlGh9JFpBIH68F0cHaV8YYg1IzW9RzHwxOFnOtLD7OwXPM4pxylUgw0vvBsXfT42gwlRt 910uK6nV+Grap9xWguUMpZQLSQdW/k0FgnxOqQ1QWQuj1jLDUkl/gBj81jfnlwKbEcE1FwltYYh EpqAS09oK1NBD0LT+IgBudaxRWlxis2WY5cXH5wBEO3+qSVqX9jYQh+zERCfxlquroM6m7dBnql 0H+e5mrohEB5/YAsWpfrR2MtbwXWWnaFC7oyFle+QCaLgkVnn+zx19Wyq4uvQrTAuckVbBWBYF5 0WYPTryLyPTTGYw== X-Developer-Key: i=lee@kernel.org; a=openpgp; fpr=76B6C935A3BE209A94F0874851AF8A2F87FC7761 Content-Transfer-Encoding: 8bit Description =========== In the Linux kernel, the following vulnerability has been resolved: s390/vfio-ap: always filter entire AP matrix The vfio_ap_mdev_filter_matrix function is called whenever a new adapter or domain is assigned to the mdev. The purpose of the function is to update the guest's AP configuration by filtering the matrix of adapters and domains assigned to the mdev. When an adapter or domain is assigned, only the APQNs associated with the APID of the new adapter or APQI of the new domain are inspected. If an APQN does not reference a queue device bound to the vfio_ap device driver, then it's APID will be filtered from the mdev's matrix when updating the guest's AP configuration. Inspecting only the APID of the new adapter or APQI of the new domain will result in passing AP queues through to a guest that are not bound to the vfio_ap device driver under certain circumstances. Consider the following: guest's AP configuration (all also assigned to the mdev's matrix): 14.0004 14.0005 14.0006 16.0004 16.0005 16.0006 unassign domain 4 unbind queue 16.0005 assign domain 4 When domain 4 is re-assigned, since only domain 4 will be inspected, the APQNs that will be examined will be: 14.0004 16.0004 Since both of those APQNs reference queue devices that are bound to the vfio_ap device driver, nothing will get filtered from the mdev's matrix when updating the guest's AP configuration. Consequently, queue 16.0005 will get passed through despite not being bound to the driver. This violates the linux device model requirement that a guest shall only be given access to devices bound to the device driver facilitating their pass-through. To resolve this problem, every adapter and domain assigned to the mdev will be inspected when filtering the mdev's matrix. The Linux kernel CVE team has assigned CVE-2024-26620 to this issue. Affected and fixed versions =========================== Issue introduced in 6.0 with commit 48cae940c31d and fixed in 6.1.76 with commit d6b8d034b576 Issue introduced in 6.0 with commit 48cae940c31d and fixed in 6.6.15 with commit c69d82119761 Issue introduced in 6.0 with commit 48cae940c31d and fixed in 6.7.3 with commit cdd134d56138 Issue introduced in 6.0 with commit 48cae940c31d and fixed in 6.8-rc1 with commit 850fb7fa8c68 Please see https://www.kernel.org or 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-2024-26620 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/s390/crypto/vfio_ap_ops.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/d6b8d034b576f406af920a7bee81606c027b24c6 https://git.kernel.org/stable/c/c69d821197611678533fb3eb784fc823b921349a https://git.kernel.org/stable/c/cdd134d56138302976685e6c7bc4755450b3880e https://git.kernel.org/stable/c/850fb7fa8c684a4c6bf0e4b6978f4ddcc5d43d11