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: <20240904081743.GF4723@noisy.programming.kicks-ass.net>
Date: Wed, 4 Sep 2024 10:17:43 +0200
From: Peter Zijlstra <peterz@...radead.org>
To: Thomas Gleixner <tglx@...utronix.de>
Cc: Jinjie Ruan <ruanjinjie@...wei.com>, linux-kernel@...r.kernel.org,
	Christophe Leroy <christophe.leroy@...roup.eu>,
	Josh Poimboeuf <jpoimboe@...nel.org>
Subject: Re: [PATCH] static_call: Handle module init failure correctly in
 static_call_del_module()

On Wed, Sep 04, 2024 at 10:00:52AM +0200, Thomas Gleixner wrote:
> On Wed, Sep 04 2024 at 09:08, Thomas Gleixner wrote:
> > On Wed, Sep 04 2024 at 11:32, Jinjie Ruan wrote:
> > So the check must be:
> >
> > 	if (!static_call_key_has_mods(key))
> >         	break;
> >
> > I missed the module local case completely in my analysis. Can you please
> > modify the condition and retest?
> 
> That said. This code is pointlessly noisy for the failure case.
> 
> Allocation fails are not a reason to warn about. -ENOMEM is propagated
> all the way to the caller, so it's sufficient to emit a pr_warn().
> 
> Peter?

Yeah, I think that should do.

> Thanks,
> 
>         tglx
> ---
> --- a/kernel/static_call_inline.c
> +++ b/kernel/static_call_inline.c
> @@ -453,7 +453,7 @@ static int static_call_module_notify(str
>  	case MODULE_STATE_COMING:
>  		ret = static_call_add_module(mod);
>  		if (ret) {
> -			WARN(1, "Failed to allocate memory for static calls");
> +			pr_warn("Failed to allocate memory for static calls\n");
>  			static_call_del_module(mod);
>  		}
>  		break;

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ