[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20190923161403.GB7828@paulmck-ThinkPad-P72>
Date: Mon, 23 Sep 2019 09:14:03 -0700
From: "Paul E. McKenney" <paulmck@...nel.org>
To: Dan Carpenter <dan.carpenter@...cle.com>
Cc: Josh Triplett <josh@...htriplett.org>,
Steven Rostedt <rostedt@...dmis.org>,
Mathieu Desnoyers <mathieu.desnoyers@...icios.com>,
Lai Jiangshan <jiangshanlai@...il.com>,
Joel Fernandes <joel@...lfernandes.org>, rcu@...r.kernel.org,
linux-kernel@...r.kernel.org, kernel-janitors@...r.kernel.org
Subject: Re: [PATCH] rcu/nocb: Fix uninitialized variable in nocb_gp_wait()
On Mon, Sep 23, 2019 at 05:26:34PM +0300, Dan Carpenter wrote:
> We never set this to false. This probably doesn't affect most people's
> runtime because GCC will automatically initialize it to false at certain
> common optimization levels. But that behavior is related to a bug in
> GCC and obviously should not be relied on.
>
> Fixes: 5d6742b37727 ("rcu/nocb: Use rcu_segcblist for no-CBs CPUs")
> Signed-off-by: Dan Carpenter <dan.carpenter@...cle.com>
Good catch! Queued for v5.5, thank you!
Thanx, Paul
> ---
> kernel/rcu/tree_plugin.h | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/kernel/rcu/tree_plugin.h b/kernel/rcu/tree_plugin.h
> index 2defc7fe74c3..fa08d55f7040 100644
> --- a/kernel/rcu/tree_plugin.h
> +++ b/kernel/rcu/tree_plugin.h
> @@ -1946,7 +1946,7 @@ static void nocb_gp_wait(struct rcu_data *my_rdp)
> int __maybe_unused cpu = my_rdp->cpu;
> unsigned long cur_gp_seq;
> unsigned long flags;
> - bool gotcbs;
> + bool gotcbs = false;
> unsigned long j = jiffies;
> bool needwait_gp = false; // This prevents actual uninitialized use.
> bool needwake;
> --
> 2.20.1
>
Powered by blists - more mailing lists