]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commitdiff
UBUNTU: SAUCE: Revert "modules: only allow symbol_get of EXPORT_SYMBOL_GPL modules"
authorAndrea Righi <andrea.righi@canonical.com>
Thu, 14 Sep 2023 11:12:12 +0000 (13:12 +0200)
committerStefan Bader <stefan.bader@canonical.com>
Mon, 30 Oct 2023 11:00:33 +0000 (12:00 +0100)
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@canonical.com>
(cherry picked from commit dd6ceb908cff6b02c18ba447d980a3f9460e2c2c mantic)
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
kernel/module/main.c

index de086f1d770fc137c6a9c7e2cc7ba5db24a3fd8d..57a3da409337a0c2876e8b7fff7f61f22d8042ce 100644 (file)
@@ -1211,20 +1211,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);