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>] [day] [month] [year] [list]
Date:	Mon, 04 Nov 2013 14:05:36 +0800
From:	Chen Gang <gang.chen@...anux.com>
To:	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Fwd: [PATCH v2] kernel/resource.c: use signed length comparing instead
 of position comparing


Sorry, forgot to cc linux-kernel.


-------- Original Message --------
Subject: [PATCH v2] kernel/resource.c: use signed length comparing instead of position comparing
Date: Mon, 04 Nov 2013 11:05:30 +0800
From: Chen Gang <gang.chen@...anux.com>
To: Toshi Kani <toshi.kani@...com>,  "isimatu.yasuaki@...fujitsu.com" <isimatu.yasuaki@...fujitsu.com>, gong.chen@...ux.intel.com, haokexin@...il.com
CC: Andrew Morton <akpm@...ux-foundation.org>

Theoretically, "addr + size" may be overflow (e.g. equal 0), so use
signed length comparing instead of position comparing.

Signed-off-by: Chen Gang <gang.chen@...anux.com>
---
 kernel/resource.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/kernel/resource.c b/kernel/resource.c
index 3f285dc..0783733 100644
--- a/kernel/resource.c
+++ b/kernel/resource.c
@@ -1335,7 +1335,7 @@ int iomem_is_exclusive(u64 addr)
 		 * We can probably skip the resources without
 		 * IORESOURCE_IO attribute?
 		 */
-		if (p->start >= addr + size)
+		if ((s64)(p->start - addr) >= size)
 			break;
 		if (p->end < addr)
 			continue;
-- 
1.7.7.6


--
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