Re: [PATCH v2 1/2] module: pull out add_taint_module() to be public

From: Bradley Morgan

Date: Mon Aug 31 2026 - 07:15:15 EST


On 31 August 2026 12:07:50 BST, Greg Kroah-Hartman
<gregkh@xxxxxxxxxxxxxxxxxxx> wrote:
>On Mon, Aug 31, 2026 at 12:51:46PM +0200, Greg Kroah-Hartman wrote:
>> Other kernel code might want to call add_taint_module() so pull it out
>> and make it global. If modules are not enabled, this defaults to a call
>> to add_taint(), so all is fine.
>>
>> Reviewed-by: Johan Hovold <johan@xxxxxxxxxx>
>> Tested-by: Johan Hovold <johan@xxxxxxxxxx>
>> Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>
>> ---
>> include/linux/module.h | 10 ++++++++++
>> kernel/module/main.c | 16 +++++++++++++---
>> 2 files changed, 23 insertions(+), 3 deletions(-)
>>
>> diff --git a/include/linux/module.h b/include/linux/module.h
>> index 96cc98568eea..0636e0f2728c 100644
>> --- a/include/linux/module.h
>> +++ b/include/linux/module.h
>> @@ -29,6 +29,7 @@
>> #include <linux/srcu.h>
>> #include <linux/static_call_types.h>
>> #include <linux/dynamic_debug.h>
>> +#include <linux/panic.h>
>>
>> #include <linux/percpu.h>
>> #include <asm/module.h>
>> @@ -770,6 +771,9 @@ static inline bool is_livepatch_module(struct module
>*mod)
>>
>> void module_for_each_mod(int(*func)(struct module *mod, void *data),
>void *data);
>>
>> +void add_taint_module(struct module *mod, unsigned flag,
>> + enum lockdep_ok lockdep_ok);
>> +
>> #else /* !CONFIG_MODULES... */
>>
>> static inline struct module *__module_address(unsigned long addr)
>> @@ -877,6 +881,12 @@ static inline bool module_is_coming(struct module
>*mod)
>> static inline void module_for_each_mod(int(*func)(struct module *mod,
>void *data), void *data)
>> {
>> }
>> +
>> +static inline void add_taint_module(struct module *mod, unsigned flag,
>> + enum lockdep_ok, lockdep_ok)
>
>And this line is wrong, ugh. I gotta go get sashiko running locally...

Cough cough, Claude code speaking

>
>There will be a v3 in a few days.
>
>greg k-h

--- Thanks!
https://lore.kernel.org/all/EE579805-42F2-4C58-B752-F28779EEB717@xxxxxxxxx/