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: <alpine.LSU.2.21.2203021012250.5895@pobox.suse.cz>
Date:   Wed, 2 Mar 2022 10:14:00 +0100 (CET)
From:   Miroslav Benes <mbenes@...e.cz>
To:     cgel.zte@...il.com
cc:     mcgrof@...nel.org, linux-modules@...r.kernel.org,
        linux-kernel@...r.kernel.org, Lv Ruyi <lv.ruyi@....com.cn>,
        Zeal Robot <zealci@....com.cn>
Subject: Re: [PATCH] module: avoid calling synchronize_rcu()

Hi,

On Wed, 2 Mar 2022, cgel.zte@...il.com wrote:

> From: Lv Ruyi (CGEL ZTE) <lv.ruyi@....com.cn>
> 
> Kfree_rcu() usually results in even simpler code than does 
> synchronize_rcu() without synchronize_rcu()'s multi-millisecond
> latency, so replace synchronize_rcu() with kfree_rcu().
> 
> Reported-by: Zeal Robot <zealci@....com.cn>
> Signed-off-by: Lv Ruyi (CGEL ZTE) <lv.ruyi@....com.cn>
> ---
>  kernel/module.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/kernel/module.c b/kernel/module.c
> index 6cea788fd965..767b5f9e5819 100644
> --- a/kernel/module.c
> +++ b/kernel/module.c
> @@ -4138,8 +4138,7 @@ static int load_module(struct load_info *info, const char __user *uargs,
>   ddebug_cleanup:
>  	ftrace_release_mod(mod);
>  	dynamic_debug_remove(mod, info->debug);
> -	synchronize_rcu();
> -	kfree(mod->args);
> +	kfree_rcu(mod->args);

this has been proposed already. synchronize_rcu() and kfree() here are not 
really tied together. See the discussion at 
https://lore.kernel.org/all/alpine.LSU.2.21.2111301132220.3922@pobox.suse.cz/T/#u

Regards
Miroslav

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ