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: <1453820393-31179-3-git-send-email-mika.penttila@nextfour.com>
Date:	Tue, 26 Jan 2016 16:59:53 +0200
From:	<mika.penttila@...tfour.com>
To:	<linux-kernel@...r.kernel.org>
CC:	<linux-mm@...ck.org>, <linux@....linux.org.uk>,
	<catalin.marinas@....com>, <will.deacon@....com>,
	Mika Penttilä <mika.penttila@...tfour.com>
Subject: [PATCH V2 RESEND 2/2] make apply_to_page_range() more robust.

From: Mika Penttilä <mika.penttila@...tfour.com>

Now the arm/arm64 don't trigger this BUG_ON() any more,
but WARN_ON() is here enough to catch buggy callers
but still let potential other !size callers pass with warning.

Signed-off-by: Mika Penttilä mika.penttila@...tfour.com
Reviewed-by: Pekka Enberg <penberg@...nel.org>
Acked-by: David Rientjes <rientjes@...gle.com>

---
 mm/memory.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/mm/memory.c b/mm/memory.c
index 30991f8..9178ee6 100644
--- a/mm/memory.c
+++ b/mm/memory.c
@@ -1871,7 +1871,9 @@ int apply_to_page_range(struct mm_struct *mm, unsigned long addr,
 	unsigned long end = addr + size;
 	int err;
 
-	BUG_ON(addr >= end);
+	if (WARN_ON(addr >= end))
+		return -EINVAL;
+
 	pgd = pgd_offset(mm, addr);
 	do {
 		next = pgd_addr_end(addr, end);
-- 
1.9.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ