From: Greg Kroah-Hartman Date: Wed, 14 May 2025 09:50:02 +0000 (+0200) Subject: 6.6-stable patches X-Git-Tag: v5.15.183~11 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=8ff0556cd91b4bb4e1561bb698153f7d17a79cac;p=thirdparty%2Fkernel%2Fstable-queue.git 6.6-stable patches added patches: x86-its-fix-build-errors-when-config_modules-n.patch --- diff --git a/queue-6.6/series b/queue-6.6/series index 088168f58b..035dd4afd0 100644 --- a/queue-6.6/series +++ b/queue-6.6/series @@ -111,3 +111,4 @@ x86-its-add-support-for-rsb-stuffing-mitigation.patch x86-its-align-rets-in-bhb-clear-sequence-to-avoid-thunking.patch x86-ibt-keep-ibt-disabled-during-alternative-patching.patch x86-its-use-dynamic-thunks-for-indirect-branches.patch +x86-its-fix-build-errors-when-config_modules-n.patch diff --git a/queue-6.6/x86-its-fix-build-errors-when-config_modules-n.patch b/queue-6.6/x86-its-fix-build-errors-when-config_modules-n.patch new file mode 100644 index 0000000000..d8c09b6395 --- /dev/null +++ b/queue-6.6/x86-its-fix-build-errors-when-config_modules-n.patch @@ -0,0 +1,70 @@ +From 9f35e33144ae5377d6a8de86dd3bd4d995c6ac65 Mon Sep 17 00:00:00 2001 +From: Eric Biggers +Date: Mon, 12 May 2025 19:58:39 -0700 +Subject: x86/its: Fix build errors when CONFIG_MODULES=n + +From: Eric Biggers + +commit 9f35e33144ae5377d6a8de86dd3bd4d995c6ac65 upstream. + +Fix several build errors when CONFIG_MODULES=n, including the following: + +../arch/x86/kernel/alternative.c:195:25: error: incomplete definition of type 'struct module' + 195 | for (int i = 0; i < mod->its_num_pages; i++) { + +Fixes: 872df34d7c51 ("x86/its: Use dynamic thunks for indirect branches") +Cc: stable@vger.kernel.org +Signed-off-by: Eric Biggers +Acked-by: Dave Hansen +Tested-by: Steven Rostedt (Google) +Reviewed-by: Alexandre Chartre +Signed-off-by: Linus Torvalds +Signed-off-by: Greg Kroah-Hartman +--- + arch/x86/kernel/alternative.c | 6 ++++++ + 1 file changed, 6 insertions(+) + +--- a/arch/x86/kernel/alternative.c ++++ b/arch/x86/kernel/alternative.c +@@ -129,7 +129,9 @@ const unsigned char * const x86_nops[ASM + + #ifdef CONFIG_MITIGATION_ITS + ++#ifdef CONFIG_MODULES + static struct module *its_mod; ++#endif + static void *its_page; + static unsigned int its_offset; + +@@ -150,6 +152,7 @@ static void *its_init_thunk(void *thunk, + return thunk; + } + ++#ifdef CONFIG_MODULES + void its_init_mod(struct module *mod) + { + if (!cpu_feature_enabled(X86_FEATURE_INDIRECT_THUNK_ITS)) +@@ -188,6 +191,7 @@ void its_free_mod(struct module *mod) + } + kfree(mod->its_page_array); + } ++#endif /* CONFIG_MODULES */ + + DEFINE_FREE(its_execmem, void *, if (_T) module_memfree(_T)); + +@@ -198,6 +202,7 @@ static void *its_alloc(void) + if (!page) + return NULL; + ++#ifdef CONFIG_MODULES + if (its_mod) { + void *tmp = krealloc(its_mod->its_page_array, + (its_mod->its_num_pages+1) * sizeof(void *), +@@ -208,6 +213,7 @@ static void *its_alloc(void) + its_mod->its_page_array = tmp; + its_mod->its_page_array[its_mod->its_num_pages++] = page; + } ++#endif /* CONFIG_MODULES */ + + return no_free_ptr(page); + }