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 F0F7E143891 for ; Tue, 21 May 2024 15:07:29 +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=1716304050; cv=none; b=BYJnGl8gh3/pQs3M3z7eTLaGJK4xnDWE9JZY0ZrOx2zvhUwYxk3K6MPtu75QvHEfqLzyK/2XxrOnGP+CsUzF3ohd/JoYr1ad3CyVXNx77wa0B2MIOaAJp+/ufMGnUaAeyAIkD0Nw8sBsdlzpnZ/6xRV3NubhZpi/mdqVKZ5MHjM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716304050; c=relaxed/simple; bh=9jifJAaJ6RQp+lo9wxbz1ais9YXBllk9wECtu+l5Hn0=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=E7tb0CM8kHTj/eat3a5reULlxIB79hvCyHxVJ3X8O/+6/P6LKVJ+mhoUT1gkyDj9NdkZETcDZOdrrf7e3lQbUNj/C+21EpLRdcU09LuV9Z39mUFo0/HFbtUwXS96H+ghcZ4sOarqOoc5YuMW7+2o7unHy/hQJeCU7+MS1KrOqjs= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=BCP3TGOd; 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="BCP3TGOd" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 191D0C2BD11; Tue, 21 May 2024 15:07:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1716304049; bh=9jifJAaJ6RQp+lo9wxbz1ais9YXBllk9wECtu+l5Hn0=; h=From:To:Cc:Subject:Date:Reply-to:From; b=BCP3TGOdq1Xp1ooP4NdWhtqw/v6BiNrQYgNkJUwrr91BKoAC0nuKrqOVz6/9VrvCg QIWi91UHW2lUxapHt46IXVtuOCaOd5EEbYS/24gTx15ua7MYc1suHeyb7Fjq7nQG9i V6wu8ZkuJKn/3i79gOlFYXO2ButevuPzEAiuaMjA= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2021-47430: x86/entry: Clear X86_FEATURE_SMAP when CONFIG_X86_SMAP=n Date: Tue, 21 May 2024 17:04:47 +0200 Message-ID: <2024052158-CVE-2021-47430-7b38@gregkh> X-Mailer: git-send-email 2.45.1 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=3155; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=9jifJAaJ6RQp+lo9wxbz1ais9YXBllk9wECtu+l5Hn0=; b=owGbwMvMwCRo6H6F97bub03G02pJDGk+2+/J2JVbGLprPY9Sfmjr2a9ddeaae37jpZCg/Ys/N nltcLLoiGVhEGRikBVTZPmyjefo/opDil6Gtqdh5rAygQxh4OIUgImcKGZY0Ox8q3WO581ohTkr mdme788+0L+pjWF+1I3XPnXb7925Wqa77GzsbOWaCM0dAA== 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: x86/entry: Clear X86_FEATURE_SMAP when CONFIG_X86_SMAP=n Commit 3c73b81a9164 ("x86/entry, selftests: Further improve user entry sanity checks") added a warning if AC is set when in the kernel. Commit 662a0221893a3d ("x86/entry: Fix AC assertion") changed the warning to only fire if the CPU supports SMAP. However, the warning can still trigger on a machine that supports SMAP but where it's disabled in the kernel config and when running the syscall_nt selftest, for example: ------------[ cut here ]------------ WARNING: CPU: 0 PID: 49 at irqentry_enter_from_user_mode CPU: 0 PID: 49 Comm: init Tainted: G T 5.15.0-rc4+ #98 e6202628ee053b4f310759978284bd8bb0ce6905 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.10.2-1ubuntu1 04/01/2014 RIP: 0010:irqentry_enter_from_user_mode ... Call Trace: ? irqentry_enter ? exc_general_protection ? asm_exc_general_protection ? asm_exc_general_protectio IS_ENABLED(CONFIG_X86_SMAP) could be added to the warning condition, but even this would not be enough in case SMAP is disabled at boot time with the "nosmap" parameter. To be consistent with "nosmap" behaviour, clear X86_FEATURE_SMAP when !CONFIG_X86_SMAP. Found using entry-fuzz + satrandconfig. [ bp: Massage commit message. ] The Linux kernel CVE team has assigned CVE-2021-47430 to this issue. Affected and fixed versions =========================== Issue introduced in 5.8 with commit 3c73b81a9164 and fixed in 5.10.73 with commit f2447f6587b8 Issue introduced in 5.8 with commit 3c73b81a9164 and fixed in 5.14.12 with commit 4e9ec1c65da9 Issue introduced in 5.8 with commit 3c73b81a9164 and fixed in 5.15 with commit 3958b9c34c27 Issue introduced in 5.8.8 with commit 231508fa9a6d 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-2021-47430 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/x86/kernel/cpu/common.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/f2447f6587b8ffe42ba04d14ce67d429a1163e5e https://git.kernel.org/stable/c/4e9ec1c65da98c293f75d83755dfa5e03075a6d0 https://git.kernel.org/stable/c/3958b9c34c2729597e182cc606cc43942fd19f7c