Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1315653 > unrolled thread

[PATCH 4/4] make apply_to_page_range() more robust.

Started by<mika.penttila@nextfour.com>
First post2016-01-23 16:10 +0100
Last post2016-01-26 03:40 +0100
Articles 2 — 2 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [PATCH 4/4] make apply_to_page_range() more robust. <mika.penttila@nextfour.com> - 2016-01-23 16:10 +0100
    Re: [PATCH 4/4] make apply_to_page_range() more robust. David Rientjes <rientjes@google.com> - 2016-01-26 03:40 +0100

#1315653 — [PATCH 4/4] make apply_to_page_range() more robust.

From<mika.penttila@nextfour.com>
Date2016-01-23 16:10 +0100
Subject[PATCH 4/4] make apply_to_page_range() more robust.
Message-ID<qU7Z8-4tS-9@gated-at.bofh.it>
From: Mika Penttilä <mika.penttila@nextfour.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@nextfour.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

[toc] | [next] | [standalone]


#1317473

FromDavid Rientjes <rientjes@google.com>
Date2016-01-26 03:40 +0100
Message-ID<qV1HX-4RV-1@gated-at.bofh.it>
In reply to#1315653

[Multipart message — attachments visible in raw view] — view raw

On Sat, 23 Jan 2016, mika.penttila@nextfour.com wrote:

> From: Mika Penttilä <mika.penttila@nextfour.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@nextfour.com

Acked-by: David Rientjes <rientjes@google.com>

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web