Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1309880
| From | Mika Penttilä <mika.penttila@nextfour.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | [PATCH] mm: make apply_to_page_range more robust |
| Date | 2016-01-15 06:50 +0100 |
| Message-ID | <qR5qO-1xR-3@gated-at.bofh.it> (permalink) |
| Organization | linux.* mail to news gateway |
Recent changes (4.4.0+) in module loader triggered oops on ARM. While
loading a module, size in :
apply_to_page_range(struct mm_struct *mm, unsigned long addr, unsigned
long size, pte_fn_t fn, void *data);
can be 0 triggering the bug BUG_ON(addr >= end);.
Fix by letting call with zero size succeed.
--Mika
Signed-off-by: mika.penttila@nextfour.com
---
diff --git a/mm/memory.c b/mm/memory.c
index c387430..c3d1a2e 100644
--- a/mm/memory.c
+++ b/mm/memory.c
@@ -1884,6 +1884,9 @@ int apply_to_page_range(struct mm_struct *mm,
unsigned long addr,
unsigned long end = addr + size;
int err;
+ if (!size)
+ return 0;
+
BUG_ON(addr >= end);
pgd = pgd_offset(mm, addr);
do {
Back to linux.kernel | Previous | Next — Next in thread | Find similar | Unroll thread
[PATCH] mm: make apply_to_page_range more robust Mika Penttilä <mika.penttila@nextfour.com> - 2016-01-15 06:50 +0100 Re: [PATCH] mm: make apply_to_page_range more robust Pekka Enberg <penberg@kernel.org> - 2016-01-17 11:10 +0100 Re: [PATCH] mm: make apply_to_page_range more robust David Rientjes <rientjes@google.com> - 2016-01-19 23:30 +0100
csiph-web