Thank you for your contribution! Sashiko AI review found 1 potential issue(s) 
to consider:
- [Low] Missing EXPORT_SYMBOL for add_taint_module() causes link failures for 
loadable modules.
--

commit af64416dcd45d326037820ed7ffd035efeed6ec0
Author: Greg Kroah-Hartman <[email protected]>

module: pull out add_taint_module() to be public

This commit extracts add_taint_module() and makes it a globally accessible 
function so that other kernel code can call it to taint specific modules.

> diff --git a/kernel/module/main.c b/kernel/module/main.c
> index d0e1e0bd2ad06..444d990c99832 100644
> --- a/kernel/module/main.c
> +++ b/kernel/module/main.c

[ ... ]

> @@ -191,11 +191,21 @@ static inline int strong_try_module_get(struct module 
> *mod)
>               return -ENOENT;
>  }
>  
> -static inline void add_taint_module(struct module *mod, unsigned flag,
> -                                 enum lockdep_ok lockdep_ok)
> +/**
> + * add_taint_module: add a taint flag if not already set for a specific 
> module
> + * @mod: pointer to the module that caused the problem
> + * @flag: one of the TAINT_* constants.
> + * @lockdep_ok: whether lock debugging is still OK.
> + *
> + * If something bad has gone wrong, you'll want @lockdebug_ok = false, but 
> for
> + * some noteworthy-but-not-corrupting cases, it can be set to true.
> + */
> +void add_taint_module(struct module *mod, unsigned flag,
> +                   enum lockdep_ok lockdep_ok)
>  {
>       add_taint(flag, lockdep_ok);
> -     set_bit(flag, &mod->taints);
> +     if (mod)
> +             set_bit(flag, &mod->taints);
>  }

[Severity: Low]
Since the commit message mentions that other kernel code might want to call
add_taint_module(), does this function need an EXPORT_SYMBOL() declaration?

Without an export, if a loadable module attempts to use this function as a
module-aware counterpart to add_taint(), it will cause a build error
due to an undefined reference during the modpost stage.

-- 
Sashiko AI review ยท 
https://sashiko.dev/#/patchset/[email protected]?part=1

Reply via email to