[M][PATCH 1/1] UBUNTU: SAUCE: Revert "modules: only allow symbol_get of EXPORT_SYMBOL_GPL modules"

Andrea Righi andrea.righi at canonical.com
Thu Sep 14 14:59:39 UTC 2023


Turning symbol_get() to EXPORT_SYMBOL_GPL() would create an ABI breakage
in the 6.5 kernels that we have already released, introducing potential
regressions with external out-of-tree kernel modules.

In line with our kernel policy, which aims to avoid any potential ABI
disruptions, temporarily revert this commit for the v6.5 series.

This change will be restored starting with the v6.6 kernels, re-aligning
with upstream.

Ignore: yes
Signed-off-by: Andrea Righi <andrea.righi at canonical.com>
---
 kernel/module/main.c | 14 +++-----------
 1 file changed, 3 insertions(+), 11 deletions(-)

diff --git a/kernel/module/main.c b/kernel/module/main.c
index 98fedfdb8db5..ff7cc4e29299 100644
--- a/kernel/module/main.c
+++ b/kernel/module/main.c
@@ -1295,20 +1295,12 @@ void *__symbol_get(const char *symbol)
 	};
 
 	preempt_disable();
-	if (!find_symbol(&fsa))
-		goto fail;
-	if (fsa.license != GPL_ONLY) {
-		pr_warn("failing symbol_get of non-GPLONLY symbol %s.\n",
-			symbol);
-		goto fail;
+	if (!find_symbol(&fsa) || strong_try_module_get(fsa.owner)) {
+		preempt_enable();
+		return NULL;
 	}
-	if (strong_try_module_get(fsa.owner))
-		goto fail;
 	preempt_enable();
 	return (void *)kernel_symbol_value(fsa.sym);
-fail:
-	preempt_enable();
-	return NULL;
 }
 EXPORT_SYMBOL_GPL(__symbol_get);
 
-- 
2.40.1




More information about the kernel-team mailing list