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-next>] [day] [month] [year] [list]
Message-ID: <20200819045813.GA24181@embeddedor>
Date:   Tue, 18 Aug 2020 23:58:13 -0500
From:   "Gustavo A. R. Silva" <gustavoars@...nel.org>
To:     Robert Richter <rric@...nel.org>,
        Thomas Bogendoerfer <tsbogend@...ha.franken.de>,
        Huacai Chen <chenhc@...ote.com>,
        Liangliang Huang <huanglllzu@...il.com>
Cc:     oprofile-list@...ts.sf.net, linux-mips@...r.kernel.org,
        linux-kernel@...r.kernel.org,
        "Gustavo A. R. Silva" <gustavoars@...nel.org>
Subject: [PATCH] MIPS: op_model_mipsxx: Fix non-executable code bug

The fallthrough pseudo-keyword is being wrongly used and is causing
the non-executable code error below:

arch/mips/oprofile/op_model_mipsxx.c: In function ‘mipsxx_perfcount_handler’:
./include/linux/compiler_attributes.h:214:41: warning: statement will never be executed [-Wswitch-unreachable]
 # define fallthrough                    __attribute__((__fallthrough__))
                                         ^
arch/mips/oprofile/op_model_mipsxx.c:248:2: note: in expansion of macro ‘fallthrough’
  fallthrough;       \
  ^~~~~~~~~~~
arch/mips/oprofile/op_model_mipsxx.c:258:2: note: in expansion of macro ‘HANDLE_COUNTER’
  HANDLE_COUNTER(3)
  ^~~~~~~~~~~~~~

Fix this by placing the fallthrough macro at the proper place.

Fixes: c9b029903466 ("MIPS: Use fallthrough for arch/mips")
Cc: stable@...r.kernel.org
Signed-off-by: Gustavo A. R. Silva <gustavoars@...nel.org>
---
 arch/mips/oprofile/op_model_mipsxx.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/mips/oprofile/op_model_mipsxx.c b/arch/mips/oprofile/op_model_mipsxx.c
index 1493c49ca47a..f200b97bdef7 100644
--- a/arch/mips/oprofile/op_model_mipsxx.c
+++ b/arch/mips/oprofile/op_model_mipsxx.c
@@ -245,7 +245,6 @@ static int mipsxx_perfcount_handler(void)
 
 	switch (counters) {
 #define HANDLE_COUNTER(n)						\
-	fallthrough;							\
 	case n + 1:							\
 		control = r_c0_perfctrl ## n();				\
 		counter = r_c0_perfcntr ## n();				\
@@ -254,7 +253,8 @@ static int mipsxx_perfcount_handler(void)
 			oprofile_add_sample(get_irq_regs(), n);		\
 			w_c0_perfcntr ## n(reg.counter[n]);		\
 			handled = IRQ_HANDLED;				\
-		}
+		}							\
+	fallthrough;
 	HANDLE_COUNTER(3)
 	HANDLE_COUNTER(2)
 	HANDLE_COUNTER(1)
-- 
2.27.0

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ