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: <ZC2Jh6CaeHHpkWLW@pc636>
Date:   Wed, 5 Apr 2023 16:45:27 +0200
From:   Uladzislau Rezki <urezki@...il.com>
To:     Zqiang <qiang1.zhang@...el.com>
Cc:     urezki@...il.com, paulmck@...nel.org, frederic@...nel.org,
        joel@...lfernandes.org, qiang.zhang1211@...il.com,
        rcu@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] rcu/kvfree: Invoke debug_rcu_bhead_unqueue() with check
 bnode->snap is done

On Wed, Apr 05, 2023 at 10:13:59AM +0800, Zqiang wrote:
> This commit make debug_rcu_bhead_unqueue() be invoked with check
> the bnode structure's->snap is done in kvfree_rcu_bulk().
> 
> Signed-off-by: Zqiang <qiang1.zhang@...el.com>
> ---
>  kernel/rcu/tree.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/kernel/rcu/tree.c b/kernel/rcu/tree.c
> index 3461fc2640b9..17b5d115aec1 100644
> --- a/kernel/rcu/tree.c
> +++ b/kernel/rcu/tree.c
> @@ -2943,8 +2943,8 @@ kvfree_rcu_bulk(struct kfree_rcu_cpu *krcp,
>  	unsigned long flags;
>  	int i;
>  
> -	debug_rcu_bhead_unqueue(bnode);
>  	if (!WARN_ON_ONCE(!poll_state_synchronize_rcu_full(&bnode->gp_snap))) {
> +		debug_rcu_bhead_unqueue(bnode);
>  		rcu_lock_acquire(&rcu_callback_map);
>  		if (idx == 0) { // kmalloc() / kfree().
>  			trace_rcu_invoke_kfree_bulk_callback(
> -- 
> 2.32.0
>
Since we leak, looks like correct to me:

Reviewed-by: Uladzislau Rezki (Sony) <urezki@...il.com>

--
Uladzislau Rezki

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ