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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20211228073252.580296-1-xu.xin16@zte.com.cn>
Date:   Tue, 28 Dec 2021 07:32:52 +0000
From:   cgel.zte@...il.com
To:     lczerner@...hat.com
Cc:     adilger.kernel@...ger.ca, cgel.zte@...il.com,
        linux-ext4@...r.kernel.org, linux-kernel@...r.kernel.org,
        tytso@....edu, xu.xin16@....com.cn, zealci@....com.cn
Subject: [PATCH resend] fs/ext4: use BUG_ON instead of if condition followed by BUG

From: xu xin <xu.xin16@....com.cn>

BUG_ON would be better.

This issue was detected with the help of Coccinelle.

Reported-by: Zeal robot <zealci@....com.cn>
Reviewed-by: Lukas Czerner <lczerner@...hat.com>
Signed-off-by: xu xin <xu.xin16@....com.cn>
---
 fs/ext4/ext4.h | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/fs/ext4/ext4.h b/fs/ext4/ext4.h
index 9cc55bcda6ba..00bc3f67d37f 100644
--- a/fs/ext4/ext4.h
+++ b/fs/ext4/ext4.h
@@ -2400,8 +2400,7 @@ ext4_rec_len_from_disk(__le16 dlen, unsigned blocksize)
 
 static inline __le16 ext4_rec_len_to_disk(unsigned len, unsigned blocksize)
 {
-	if ((len > blocksize) || (blocksize > (1 << 18)) || (len & 3))
-		BUG();
+	BUG_ON((len > blocksize) || (blocksize > (1 << 18)) || (len & 3));
 #if (PAGE_SIZE >= 65536)
 	if (len < 65536)
 		return cpu_to_le16(len);
-- 
2.25.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ