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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <6c9dde7f-271b-4342-8ce9-8f363b341c0d@paulmck-laptop>
Date: Wed, 9 Oct 2024 10:19:01 -0700
From: "Paul E. McKenney" <paulmck@...nel.org>
To: Michal Schmidt <mschmidt@...hat.com>
Cc: Lai Jiangshan <jiangshanlai@...il.com>,
	Josh Triplett <josh@...htriplett.org>,
	Steven Rostedt <rostedt@...dmis.org>,
	Mathieu Desnoyers <mathieu.desnoyers@...icios.com>,
	"Uladzislau Rezki (Sony)" <urezki@...il.com>, rcu@...r.kernel.org,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH] rcu/srcutiny: don't return before reenabling preemption

On Mon, Oct 07, 2024 at 12:14:15PM +0200, Michal Schmidt wrote:
> Code after the return statement is dead. Enable preemption before
> returning from srcu_drive_gp().
> 
> This will be important when/if PREEMPT_AUTO (lazy resched) gets merged.
> 
> Fixes: 65b4a59557f6 ("srcu: Make Tiny SRCU explicitly disable preemption")
> Signed-off-by: Michal Schmidt <mschmidt@...hat.com>

Good catch!

Reviewed-by: Paul E. McKenney <paulmck@...nel.org>

> ---
>  kernel/rcu/srcutiny.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/kernel/rcu/srcutiny.c b/kernel/rcu/srcutiny.c
> index 549c03336ee9..4dcbf8aa80ff 100644
> --- a/kernel/rcu/srcutiny.c
> +++ b/kernel/rcu/srcutiny.c
> @@ -122,8 +122,8 @@ void srcu_drive_gp(struct work_struct *wp)
>  	ssp = container_of(wp, struct srcu_struct, srcu_work);
>  	preempt_disable();  // Needed for PREEMPT_AUTO
>  	if (ssp->srcu_gp_running || ULONG_CMP_GE(ssp->srcu_idx, READ_ONCE(ssp->srcu_idx_max))) {
> -		return; /* Already running or nothing to do. */
>  		preempt_enable();
> +		return; /* Already running or nothing to do. */
>  	}
>  
>  	/* Remove recently arrived callbacks and wait for readers. */
> -- 
> 2.46.2
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ