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 7C8744C97 for ; Sat, 17 Aug 2024 09:13:20 +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=1723886000; cv=none; b=hRULGjBc41X4GXHVmmKN5KNyC36y9LPF6OpOVu8c+iITBk5cGlqrEjaLFLc0FDgSVOuE2KtjGBS3JS5ucWvIEdugmzIa4iOTmUD9zasTkvWrVXc/kdoZpVQ1N4ph4vr6lSqwO/ibPYAYbYTHQJYrUhu2XBrPmZ4ZHXIxJB/gmhA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723886000; c=relaxed/simple; bh=//2p0X0CoHAZXNFTzVC7Ef7XrEVyiySZPdt4MNnLR2E=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=ZObB0hSJOC1y2f1aIftP5O4/cwRQ+PqMkNto+d7sm7THI8Hq4sw9xUGTgMTNs0Zo1iU7uybkyMPbCG1DHFsm1/C4uzUz5OXhL6SXmn3SQbC9bEJv3oUnNBVO8boNs6LGxmeAS96To5F0FRxT11jmn3BPht0EnbUPlaNXzP9Gm4k= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=vEf08oQ/; 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="vEf08oQ/" Received: by smtp.kernel.org (Postfix) with ESMTPSA id F0A74C116B1; Sat, 17 Aug 2024 09:13:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1723886000; bh=//2p0X0CoHAZXNFTzVC7Ef7XrEVyiySZPdt4MNnLR2E=; h=From:To:Cc:Subject:Date:Reply-to:From; b=vEf08oQ/S4brTXgUW9tPK4ssPC1tWGFvwdEMz8PGGLz83Sr7VJkWz69mtN0P7BIaV Vk4KEFW9pF+xXmcBq96XKNZvp7VavtzL88m+rOGKzxmtsWqoa4vvFXxqCtCxr/SIvY KltV3XsfHHQJfiZE0PFUQ3A5ItBaTkhWPUC8I6P4= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2024-42293: arm64: mm: Fix lockless walks with static and dynamic page-table folding Date: Sat, 17 Aug 2024 11:09:58 +0200 Message-ID: <2024081746-CVE-2024-42293-0660@gregkh> X-Mailer: git-send-email 2.46.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=2596; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=//2p0X0CoHAZXNFTzVC7Ef7XrEVyiySZPdt4MNnLR2E=; b=owGbwMvMwCRo6H6F97bub03G02pJDGkHMm6FbeNxO5T6TlCO58V7Yb8v1hOe/FtRErrO/XRw0 625ykIaHbEsDIJMDLJiiixftvEc3V9xSNHL0PY0zBxWJpAhDFycAjCRvNkMC64acH0uk1MRn55q tm1Bkl1Uqf2LVQzzc0P0c9lnWvxSdtvssfdd7neGfdclAA== 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: arm64: mm: Fix lockless walks with static and dynamic page-table folding Lina reports random oopsen originating from the fast GUP code when 16K pages are used with 4-level page-tables, the fourth level being folded at runtime due to lack of LPA2. In this configuration, the generic implementation of p4d_offset_lockless() will return a 'p4d_t *' corresponding to the 'pgd_t' allocated on the stack of the caller, gup_fast_pgd_range(). This is normally fine, but when the fourth level of page-table is folded at runtime, pud_offset_lockless() will offset from the address of the 'p4d_t' to calculate the address of the PUD in the same page-table page. This results in a stray stack read when the 'p4d_t' has been allocated on the stack and can send the walker into the weeds. Fix the problem by providing our own definition of p4d_offset_lockless() when CONFIG_PGTABLE_LEVELS <= 4 which returns the real page-table pointer rather than the address of the local stack variable. The Linux kernel CVE team has assigned CVE-2024-42293 to this issue. Affected and fixed versions =========================== Issue introduced in 6.9 with commit 0dd4f60a2c76 and fixed in 6.10.3 with commit 78672d49d3ee Issue introduced in 6.9 with commit 0dd4f60a2c76 and fixed in 6.11-rc1 with commit 36639013b346 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-2024-42293 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/arm64/include/asm/pgtable.h 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/78672d49d3eebbcda3589f4d6e589caf357c5a59 https://git.kernel.org/stable/c/36639013b3462c06ff8e3400a427f775b4fc97f5