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]
Date:   Sat, 18 Sep 2021 07:30:37 +0000
From:   cgel.zte@...il.com
To:     peterz@...radead.org
Cc:     jpoimboe@...hat.com, jbaron@...mai.com, rostedt@...dmis.org,
        ardb@...nel.org, tglx@...utronix.de, mingo@...hat.com,
        bp@...en8.de, x86@...nel.org, hpa@...or.com,
        linux-kernel@...r.kernel.org, Yang Guang <yang.guang5@....com.cn>
Subject: [PATCH] Fix the bool convert to int issue

From: Yang Guang <yang.guang5@....com.cn>

The int value which convert from bool true is 0xFFFFFFFF. Causing the
__sc_insn return wrong type.

Signed-off-by: Yang Guang <yang.guang5@....com.cn>
---
 arch/x86/kernel/static_call.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/x86/kernel/static_call.c b/arch/x86/kernel/static_call.c
index ea028e736831..f608e6710300 100644
--- a/arch/x86/kernel/static_call.c
+++ b/arch/x86/kernel/static_call.c
@@ -89,7 +89,7 @@ static inline enum insn_type __sc_insn(bool null, bool tail)
 	 *	  1  |   0   |  JMP
 	 *	  1  |   1   |  RET
 	 */
-	return 2*tail + null;
+	return ((tail)?2:0) + ((null)?1:0);
 }
 
 void arch_static_call_transform(void *site, void *tramp, void *func, bool tail)
-- 
2.25.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ