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>] [day] [month] [year] [list]
Message-ID: <157252289653.29376.2731259235737411591.tip-bot2@tip-bot2>
Date:   Thu, 31 Oct 2019 11:54:56 -0000
From:   "tip-bot2 for Paul E. McKenney" <tip-bot2@...utronix.de>
To:     linux-tip-commits@...r.kernel.org
Cc:     Michael Ellerman <mpe@...erman.id.au>,
        Geert Uytterhoeven <geert@...ux-m68k.org>,
        "Paul E. McKenney" <paulmck@...nel.org>,
        Ingo Molnar <mingo@...nel.org>, Borislav Petkov <bp@...en8.de>,
        linux-kernel@...r.kernel.org
Subject: [tip: core/rcu] rcu: Suppress levelspread uninitialized messages

The following commit has been merged into the core/rcu branch of tip:

Commit-ID:     36b5dae64513b7ce3a0e0f6cb469e0f74bacad45
Gitweb:        https://git.kernel.org/tip/36b5dae64513b7ce3a0e0f6cb469e0f74bacad45
Author:        Paul E. McKenney <paulmck@...nel.org>
AuthorDate:    Wed, 18 Sep 2019 10:10:31 -07:00
Committer:     Paul E. McKenney <paulmck@...nel.org>
CommitterDate: Wed, 30 Oct 2019 08:34:53 -07:00

rcu: Suppress levelspread uninitialized messages

New tools bring new warnings, and with v5.3 comes:

kernel/rcu/srcutree.c: warning: 'levelspread[<U aa0>]' may be used uninitialized in this function [-Wuninitialized]:  => 121:34

This commit suppresses this warning by initializing the full array
to INT_MIN, which will result in failures should any out-of-bounds
references appear.

Reported-by: Michael Ellerman <mpe@...erman.id.au>
Reported-by: Geert Uytterhoeven <geert@...ux-m68k.org>
Signed-off-by: Paul E. McKenney <paulmck@...nel.org>
Reviewed-by: Geert Uytterhoeven <geert@...ux-m68k.org>
---
 kernel/rcu/rcu.h | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/kernel/rcu/rcu.h b/kernel/rcu/rcu.h
index 8fd4f82..b64c707 100644
--- a/kernel/rcu/rcu.h
+++ b/kernel/rcu/rcu.h
@@ -299,6 +299,8 @@ static inline void rcu_init_levelspread(int *levelspread, const int *levelcnt)
 {
 	int i;
 
+	for (i = 0; i < RCU_NUM_LVLS; i++)
+		levelspread[i] = INT_MIN;
 	if (rcu_fanout_exact) {
 		levelspread[rcu_num_lvls - 1] = rcu_fanout_leaf;
 		for (i = rcu_num_lvls - 2; i >= 0; i--)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ