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]
Date:   Wed, 17 Mar 2021 14:34:59 +0800
From:   Jiapeng Chong <jiapeng.chong@...ux.alibaba.com>
To:     viro@...iv.linux.org.uk
Cc:     linux-fsdevel@...r.kernel.org, linux-kernel@...r.kernel.org,
        Jiapeng Chong <jiapeng.chong@...ux.alibaba.com>
Subject: [PATCH] attr: replace if (cond) BUG() with BUG_ON()

Fix the following coccicheck warnings:

./fs/attr.c:349:2-5: WARNING: Use BUG_ON instead of if condition
followed by BUG.

Reported-by: Abaci Robot <abaci@...ux.alibaba.com>
Signed-off-by: Jiapeng Chong <jiapeng.chong@...ux.alibaba.com>
---
 fs/attr.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/fs/attr.c b/fs/attr.c
index 87ef39d..43f369e 100644
--- a/fs/attr.c
+++ b/fs/attr.c
@@ -344,9 +344,7 @@ int notify_change(struct user_namespace *mnt_userns, struct dentry *dentry,
 	 * no function will ever call notify_change with both ATTR_MODE and
 	 * ATTR_KILL_S*ID set.
 	 */
-	if ((ia_valid & (ATTR_KILL_SUID|ATTR_KILL_SGID)) &&
-	    (ia_valid & ATTR_MODE))
-		BUG();
+	BUG_ON((ia_valid & (ATTR_KILL_SUID|ATTR_KILL_SGID)) && (ia_valid & ATTR_MODE));
 
 	if (ia_valid & ATTR_KILL_SUID) {
 		if (mode & S_ISUID) {
-- 
1.8.3.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ