mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] ima: Fix warn potential negative subtraction from max
@ 2017-12-21 15:55 Vasyl Gomonovych
  2017-12-21 18:00 ` Serge E. Hallyn
  0 siblings, 1 reply; 3+ messages in thread
From: Vasyl Gomonovych @ 2017-12-21 15:55 UTC (permalink / raw)
  To: zohar, dmitry.kasatkin, james.l.morris, serge, linux-integrity,
	linux-security-module, gomonovych
  Cc: linux-kernel

Found by smatch:
security/integrity/ima/ima_queue.c:122 ima_add_digest_entry() warn:
potential negative subtraction from max '(~0)- size'

Signed-off-by: Vasyl Gomonovych <gomonovych@gmail.com>
---
 security/integrity/ima/ima_queue.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/security/integrity/ima/ima_queue.c b/security/integrity/ima/ima_queue.c
index a02a86d51102..446018478b81 100644
--- a/security/integrity/ima/ima_queue.c
+++ b/security/integrity/ima/ima_queue.c
@@ -116,7 +116,7 @@ static int ima_add_digest_entry(struct ima_template_entry *entry,
 	}
 
 	if (binary_runtime_size != ULONG_MAX) {
-		int size;
+		unsigned int size;
 
 		size = get_binary_runtime_size(entry);
 		binary_runtime_size = (binary_runtime_size < ULONG_MAX - size) ?
-- 
1.9.1

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2017-12-21 21:55 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-12-21 15:55 [PATCH] ima: Fix warn potential negative subtraction from max Vasyl Gomonovych
2017-12-21 18:00 ` Serge E. Hallyn
2017-12-21 21:54   ` [PATCH v2] " Vasyl Gomonovych

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®