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 ACE82481D1 for ; Fri, 3 May 2024 17:46:36 +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=1714758396; cv=none; b=oT/f+tzmMZr4dyq1RqcbYsIIQsmiBGogQKgVe+kqAHKHMgrEDcPolZ1gGfMY7tFbY8aVDzenO9fDjuZivU4/SHdUrzeW35D6dPOq8F0e6dJ+BjVhmt/B4GitIpxMnK1TfxMAw0gjrIKVjkq+NqrdH1iWhPk6N6QFYT24gPAaVP8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714758396; c=relaxed/simple; bh=wt26iSvkVyn5Zq5n88QQu/aQy//EHj4NTSZZd6lPu/Q=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=c8i6xG4i6+hxg4uLwOj1nNv5ms0FrsMPHbqnXQqUwv9Q5X8OZ4cifaZRN1v8hc71wibmwOJJlbr+w1EPOBZhQ8ODfI4TjhH759/aKm4BQv5U78PvtAr5gkFvQxwSfhsmY9srAoqpKsEARR510EQT0J011lfjgQuHeWEvGP5Jokc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=gVwaQKjm; 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="gVwaQKjm" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3CBCAC116B1; Fri, 3 May 2024 17:46:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1714758396; bh=wt26iSvkVyn5Zq5n88QQu/aQy//EHj4NTSZZd6lPu/Q=; h=From:To:Cc:Subject:Date:Reply-to:From; b=gVwaQKjm1CqmWpO4byk0oOuSHeV3rAqo3Q0LRvjdlCaAxCdpu5n5sB9/DucfQU8HJ 538b8PZKPhTkNDMbkm7xvYp8Gj9CNKLxgFWTtXCWSE6BK20YEy8JkHV8xHN/26FpgF 4xlFFV0JD/L6ncZvQyeFfouOrb19JxuYdksXAF7M= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2022-48700: vfio/type1: Unpin zero pages Date: Fri, 3 May 2024 19:45:56 +0200 Message-ID: <2024050349-CVE-2022-48700-c756@gregkh> X-Mailer: git-send-email 2.45.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=2427; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=wt26iSvkVyn5Zq5n88QQu/aQy//EHj4NTSZZd6lPu/Q=; b=owGbwMvMwCRo6H6F97bub03G02pJDGmmSue+RK2UW1C+ZJp8tY/gY9Pm6WzXjY+yTltebnw6k ZV5xgGLjlgWBkEmBlkxRZYv23iO7q84pOhlaHsaZg4rE8gQBi5OAZjIXQ2GBfO/TSqpOjFRa8LE yHvFf6cnay77eJFhwQGb972l0zlOmXBytmYdfZl+zff4PAA= X-Developer-Key: i=gregkh@linuxfoundation.org; a=openpgp; fpr=F4B60CC5BF78C2214A313DCB3147D40DDB2DFB29 Content-Transfer-Encoding: 8bit Description =========== In the Linux kernel, the following vulnerability has been resolved: vfio/type1: Unpin zero pages There's currently a reference count leak on the zero page. We increment the reference via pin_user_pages_remote(), but the page is later handled as an invalid/reserved page, therefore it's not accounted against the user and not unpinned by our put_pfn(). Introducing special zero page handling in put_pfn() would resolve the leak, but without accounting of the zero page, a single user could still create enough mappings to generate a reference count overflow. The zero page is always resident, so for our purposes there's no reason to keep it pinned. Therefore, add a loop to walk pages returned from pin_user_pages_remote() and unpin any zero pages. The Linux kernel CVE team has assigned CVE-2022-48700 to this issue. Affected and fixed versions =========================== Fixed in 5.10.146 with commit 578d644edc7d Fixed in 5.15.68 with commit 5321908ef74f Fixed in 5.19.9 with commit 5d721bf22293 Fixed in 6.0 with commit 873aefb376bb 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-2022-48700 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/vfio/vfio_iommu_type1.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/578d644edc7d2c1ff53f7e4d0a25da473deb4a03 https://git.kernel.org/stable/c/5321908ef74fb593e0dbc8737d25038fc86c9986 https://git.kernel.org/stable/c/5d721bf222936f5cf3ee15ced53cc483ecef7e46 https://git.kernel.org/stable/c/873aefb376bbc0ed1dd2381ea1d6ec88106fdbd4