From 6a3ed13526f22f92a14c45d69cd72168a85bb1de Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Wed, 14 Dec 2022 17:03:18 +0100 Subject: [PATCH] 6.1-stable patches added patches: x86-vdso-conditionally-export-__vdso_sgx_enter_enclave.patch --- ...ally-export-__vdso_sgx_enter_enclave.patch | 42 +++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 queue-6.1/x86-vdso-conditionally-export-__vdso_sgx_enter_enclave.patch diff --git a/queue-6.1/x86-vdso-conditionally-export-__vdso_sgx_enter_enclave.patch b/queue-6.1/x86-vdso-conditionally-export-__vdso_sgx_enter_enclave.patch new file mode 100644 index 00000000000..6b36feee5bc --- /dev/null +++ b/queue-6.1/x86-vdso-conditionally-export-__vdso_sgx_enter_enclave.patch @@ -0,0 +1,42 @@ +From 45be2ad007a9c6bea70249c4cf3e4905afe4caeb Mon Sep 17 00:00:00 2001 +From: Nathan Chancellor +Date: Tue, 8 Nov 2022 17:03:07 -0700 +Subject: x86/vdso: Conditionally export __vdso_sgx_enter_enclave() + +From: Nathan Chancellor + +commit 45be2ad007a9c6bea70249c4cf3e4905afe4caeb upstream. + +Recently, ld.lld moved from '--undefined-version' to +'--no-undefined-version' as the default, which breaks building the vDSO +when CONFIG_X86_SGX is not set: + + ld.lld: error: version script assignment of 'LINUX_2.6' to symbol '__vdso_sgx_enter_enclave' failed: symbol not defined + +__vdso_sgx_enter_enclave is only included in the vDSO when +CONFIG_X86_SGX is set. Only export it if it will be present in the final +object, which clears up the error. + +Fixes: 8466436952017 ("x86/vdso: Implement a vDSO for Intel SGX enclave call") +Signed-off-by: Nathan Chancellor +Signed-off-by: Thomas Gleixner +Reviewed-by: Nick Desaulniers +Link: https://github.com/ClangBuiltLinux/linux/issues/1756 +Link: https://lore.kernel.org/r/20221109000306.1407357-1-nathan@kernel.org +Signed-off-by: Greg Kroah-Hartman +--- + arch/x86/entry/vdso/vdso.lds.S | 2 ++ + 1 file changed, 2 insertions(+) + +--- a/arch/x86/entry/vdso/vdso.lds.S ++++ b/arch/x86/entry/vdso/vdso.lds.S +@@ -27,7 +27,9 @@ VERSION { + __vdso_time; + clock_getres; + __vdso_clock_getres; ++#ifdef CONFIG_X86_SGX + __vdso_sgx_enter_enclave; ++#endif + local: *; + }; + } -- 2.47.3