[<prev] [next>] [day] [month] [year] [list]
Message-ID: <ed33087d-fc38-e6c5-2633-0d6f7c3877c5@x41-dsec.de>
Date: Wed, 11 Oct 2017 10:28:26 +0200
From: Eric Sesterhenn <eric.sesterhenn@...-dsec.de>
To: linux-kernel@...r.kernel.org
Subject: [PATCH 2/7] Handle snprintf calculation in stackglue
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/stackglue.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/fs/ocfs2/stackglue.c b/fs/ocfs2/stackglue.c
index d6c350ba25b9..b00d67b4cf43 100644
--- a/fs/ocfs2/stackglue.c
+++ b/fs/ocfs2/stackglue.c
@@ -520,7 +520,7 @@ static ssize_t
ocfs2_loaded_cluster_plugins_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