Re: [PATCH v2] init: staging: Fix missing warning/taint on builtin code

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello,

Please disregard this one, there will be a v3 soon.

There were some oversights on my side regarding some review points, and
also the code itself.

On Thu, Jul 04, 2024 at 09:20:49PM GMT, Ágatha Isabelle Chris Moreira Guedes wrote:
> diff --git a/init/main.c b/init/main.c
> index 206acdde51f5..a297675dd397 100644
> --- a/init/main.c
> +++ b/init/main.c
> @@ -1602,3 +1602,23 @@ static noinline void __init kernel_init_freeable(void)
>  
>  	integrity_load_keys();
>  }
> +
> +#ifdef CONFIG_STAGING

Here we break the building in kernel configs where `CONFIG_STAGING=n`
because:

> +/**
> + * staging_init_taint() - We need to taint the kernel whenever staging code
> + * is initialized (from built-in drivers) or loaded (as modules) and issue
> + * a warning the first time it happens.
> + */
> +void staging_taint(const char *code_id, bool module)
> +{

^ `staging_taint()` is built only with `CONFIG_STAGING`, and

> +#endif /* CONFIG_STAGING */
> diff --git a/kernel/module/main.c b/kernel/module/main.c
> index d18a94b973e1..d7d33336ab43 100644
> --- a/kernel/module/main.c
> +++ b/kernel/module/main.c
> @@ -2039,9 +2039,7 @@ static void module_augment_kernel_taints(struct module *mod, struct load_info *i
>  	check_modinfo_retpoline(mod, info);
>  
>  	if (get_modinfo(info, "staging")) {
> -		add_taint_module(mod, TAINT_CRAP, LOCKDEP_STILL_OK);

here we call `staging_taint()` regardless of having `CONFIG_STAGING` or
not. So on all kernels with modules enabled this patch as it is now
would break the builds.

I just noticed a couple of hours after submission when I was looking at
it again.

I'll fix it and submit v3 soon.

Attachment: signature.asc
Description: PGP signature


[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux