lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ntho73bskbdi36rh32ufxdzs7c7yf3neo5xsemiy4bbkhzkmrn@dyoyyjjovirx>
Date: Fri, 5 Jul 2024 07:13:25 -0300
From: Ágatha Isabelle Chris Moreira Guedes <code@...tha.dev>
To: Greg Kroah-Hartman <gregkh@...uxfoundation.org>, 
	Luis Chamberlain <mcgrof@...nel.org>, linux-staging@...ts.linux.dev, linux-kernel@...r.kernel.org, 
	linux-modules@...r.kernel.org
Cc: Uwe Kleine-König <u.kleine-koenig@...libre.com>, 
	Dan Carpenter <dan.carpenter@...aro.org>, patch-reply@...tha.dev
Subject: Re: [PATCH v2] init: staging: Fix missing warning/taint on builtin
 code

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.


Download attachment "signature.asc" of type "application/pgp-signature" (229 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ