Message ID | 20230914145939.63729-1-andrea.righi@canonical.com |
---|---|
State | New |
Headers | show |
Series | [M,1/1] UBUNTU: SAUCE: Revert "modules: only allow symbol_get of EXPORT_SYMBOL_GPL modules" | expand |
On 9/14/23 8:59 AM, Andrea Righi wrote: > 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> > --- > 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); > Acked-by: Tim Gardner <tim.gardner@canonical.com>
On 14/09/2023 16:59, Andrea Righi wrote: > 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> > --- > 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); > Acked-by: Roxana Nicolescu <roxana.nicolescu@canonical.com>
On Thu, Sep 14, 2023 at 04:59:39PM +0200, Andrea Righi wrote: > 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> Applied to mantic/linux. -Andrea
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);
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> --- kernel/module/main.c | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-)