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: <20210824071846.61488-1-deng.changcheng@zte.com.cn>
Date:   Tue, 24 Aug 2021 00:18:46 -0700
From:   CGEL <cgel.zte@...il.com>
To:     Thomas Gleixner <tglx@...utronix.de>
Cc:     Ingo Molnar <mingo@...hat.com>, Borislav Petkov <bp@...en8.de>,
        x86@...nel.org, Michael Ellerman <mpe@...erman.id.au>,
        Nick Desaulniers <ndesaulniers@...gle.com>,
        Dan Williams <dan.j.williams@...el.com>,
        Uros Bizjak <ubizjak@...il.com>, linux-kernel@...r.kernel.org,
        Jing Yangyang <jing.yangyang@....com.cn>,
        Zeal Robot <zealci@....com.cn>
Subject: [PATCH linux-next] x86:uaccess: fix boolreturn.cocci warnings

From: Jing Yangyang <jing.yangyang@....com.cn>

./arch/x86/include/asm/uaccess.h:477:9-10:WARNING:return of 0/1 in
function 'user_access_begin' with return type bool

Return statements in functions returning bool should use true/false
instead of 1/0.

Generated by: scripts/coccinelle/misc/boolreturn.cocci

Reported-by: Zeal Robot <zealci@....com.cn>
Signed-off-by: Jing Yangyang <jing.yangyang@....com.cn>
---
 arch/x86/include/asm/uaccess.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/x86/include/asm/uaccess.h b/arch/x86/include/asm/uaccess.h
index c9fa7be..e3b6f4f 100644
--- a/arch/x86/include/asm/uaccess.h
+++ b/arch/x86/include/asm/uaccess.h
@@ -474,9 +474,9 @@ static inline bool __chk_range_not_ok(unsigned long addr, unsigned long size, un
 static __must_check __always_inline bool user_access_begin(const void __user *ptr, size_t len)
 {
 	if (unlikely(!access_ok(ptr,len)))
-		return 0;
+		return false;
 	__uaccess_begin_nospec();
-	return 1;
+	return true;
 }
 #define user_access_begin(a,b)	user_access_begin(a,b)
 #define user_access_end()	__uaccess_end()
-- 
1.8.3.1


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ