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>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1417493050-13594-4-git-send-email-sasha.levin@oracle.com>
Date:	Mon,  1 Dec 2014 23:04:08 -0500
From:	Sasha Levin <sasha.levin@...cle.com>
To:	linux-kernel@...r.kernel.org
Cc:	Sasha Levin <sasha.levin@...cle.com>,
	linux-mm@...ck.org (open list:MEMORY MANAGEMENT)
Subject: [PATCH] mm: fadvise: avoid signed integer overflow calculating offset

Both offset and len are signed integers who's overflow isn't defined. Use
unsigned addition to avoid the issue.

Signed-off-by: Sasha Levin <sasha.levin@...cle.com>
---
 mm/fadvise.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/mm/fadvise.c b/mm/fadvise.c
index 3bcfd81d..762cb63 100644
--- a/mm/fadvise.c
+++ b/mm/fadvise.c
@@ -67,7 +67,7 @@ SYSCALL_DEFINE4(fadvise64_64, int, fd, loff_t, offset, loff_t, len, int, advice)
 	}
 
 	/* Careful about overflows. Len == 0 means "as much as possible" */
-	endbyte = offset + len;
+	endbyte = offset + (u64)len;
 	if (!len || endbyte < len)
 		endbyte = -1;
 	else
-- 
1.7.10.4

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ