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>] [day] [month] [year] [list]
Message-ID: <deb817fe-07c1-f330-2c31-b786a1d82153@x41-dsec.de>
Date:   Wed, 11 Oct 2017 10:28:29 +0200
From:   Eric Sesterhenn <eric.sesterhenn@...-dsec.de>
To:     linux-kernel@...r.kernel.org
Subject: [PATCH 3/7] Fix snprintf calculation in filecheck


snprintf can return a value bigger than remain if the string does not fit.

Signed-off-by: Eric Sesterhenn <eric.sesterhenn@...-dsec.de>
---
 fs/ocfs2/filecheck.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/ocfs2/filecheck.c b/fs/ocfs2/filecheck.c
index 2cabbcf2f28e..66d8aee30d0f 100644
--- a/fs/ocfs2/filecheck.c
+++ b/fs/ocfs2/filecheck.c
@@ -435,7 +435,7 @@ static ssize_t ocfs2_filecheck_show(struct kobject
*kobj,
 			total = ret;
 			break;
 		}
-		if (ret == remain) {
+		if (ret >= remain) {
 			/* snprintf() didn't fit */
 			total = -E2BIG;
 			break;

-- 
Eric Sesterhenn (Principal Security Consultant)
X41 D-SEC GmbH, Dennewartstr. 25-27, D-52068 Aachen
T: +49 241 9809418-0, Fax: -9
Unternehmenssitz: Aachen, Amtsgericht Aachen: HRB19989
Geschäftsführer: Markus Vervier



Download attachment "signature.asc" of type "application/pgp-signature" (834 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ