lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <174069458621.10177.15982017592902412155.tip-bot2@tip-bot2>
Date: Thu, 27 Feb 2025 22:16:26 -0000
From: "tip-bot2 for Kevin Loughlin" <tip-bot2@...utronix.de>
To: linux-tip-commits@...r.kernel.org
Cc: Kevin Loughlin <kevinloughlin@...gle.com>, Ingo Molnar <mingo@...nel.org>,
 Ard Biesheuvel <ardb@...nel.org>, Tom Lendacky <thomas.lendacky@....com>,
 Dave Hansen <dave.hansen@...ux.intel.com>, x86@...nel.org,
 linux-kernel@...r.kernel.org
Subject: [tip: x86/sev] x86/sev: Add missing RIP_REL_REF() invocations during
 sme_enable()

The following commit has been merged into the x86/sev branch of tip:

Commit-ID:     72dafb567760320f2de7447cd6e979bf9d4e5d17
Gitweb:        https://git.kernel.org/tip/72dafb567760320f2de7447cd6e979bf9d4e5d17
Author:        Kevin Loughlin <kevinloughlin@...gle.com>
AuthorDate:    Fri, 22 Nov 2024 20:23:22 
Committer:     Ingo Molnar <mingo@...nel.org>
CommitterDate: Thu, 27 Feb 2025 23:01:33 +01:00

x86/sev: Add missing RIP_REL_REF() invocations during sme_enable()

The following commit:

  1c811d403afd ("x86/sev: Fix position dependent variable references in startup code")

introduced RIP_REL_REF() to force RIP-relative accesses to global variables,
as needed to prevent crashes during early SEV/SME startup code.

For completeness, RIP_REL_REF() should be used with additional variables during
sme_enable():

  https://lore.kernel.org/all/CAMj1kXHnA0fJu6zh634=fbJswp59kSRAbhW+ubDGj1+NYwZJ-Q@mail.gmail.com/

Access these vars with RIP_REL_REF() to prevent problem reoccurence.

Fixes: 1c811d403afd ("x86/sev: Fix position dependent variable references in startup code")
Signed-off-by: Kevin Loughlin <kevinloughlin@...gle.com>
Signed-off-by: Ingo Molnar <mingo@...nel.org>
Reviewed-by: Ard Biesheuvel <ardb@...nel.org>
Reviewed-by: Tom Lendacky <thomas.lendacky@....com>
Cc: Dave Hansen <dave.hansen@...ux.intel.com>
Link: https://lore.kernel.org/r/20241122202322.977678-1-kevinloughlin@google.com
---
 arch/x86/mm/mem_encrypt_identity.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/x86/mm/mem_encrypt_identity.c b/arch/x86/mm/mem_encrypt_identity.c
index e6c7686..9fce5b8 100644
--- a/arch/x86/mm/mem_encrypt_identity.c
+++ b/arch/x86/mm/mem_encrypt_identity.c
@@ -565,7 +565,7 @@ void __head sme_enable(struct boot_params *bp)
 	}
 
 	RIP_REL_REF(sme_me_mask) = me_mask;
-	physical_mask &= ~me_mask;
-	cc_vendor = CC_VENDOR_AMD;
+	RIP_REL_REF(physical_mask) &= ~me_mask;
+	RIP_REL_REF(cc_vendor) = CC_VENDOR_AMD;
 	cc_set_mask(me_mask);
 }

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ