projects
/
openwrt
/
staging
/
blogic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
084f71a
)
mm: check for no mmaps in exit_mmap()
author
Johannes Weiner
<
[email protected]
>
Tue, 6 Jan 2009 22:40:31 +0000
(14:40 -0800)
committer
Linus Torvalds
<
[email protected]
>
Tue, 6 Jan 2009 23:59:10 +0000
(15:59 -0800)
When dup_mmap() ooms we can end up with mm->mmap == NULL. The error
path does mmput() and unmap_vmas() gets a NULL vma which it
dereferences.
In exit_mmap() there is nothing to do at all for this case, we can
cancel the callpath right there.
[
[email protected]
: add sorely-needed comment]
Signed-off-by: Johannes Weiner <
[email protected]
>
Reported-by: Akinobu Mita <
[email protected]
>
Cc: Nick Piggin <
[email protected]
>
Cc: Hugh Dickins <
[email protected]
>
Signed-off-by: Andrew Morton <
[email protected]
>
Signed-off-by: Linus Torvalds <
[email protected]
>
mm/mmap.c
patch
|
blob
|
history
diff --git
a/mm/mmap.c
b/mm/mmap.c
index 1f97d8aa9b05fa16784cf0f8870bd3ba66f225b5..a910c045cfd4241601306257c8822bda7f1ee05a 100644
(file)
--- a/
mm/mmap.c
+++ b/
mm/mmap.c
@@
-2090,6
+2090,9
@@
void exit_mmap(struct mm_struct *mm)
arch_exit_mmap(mm);
mmu_notifier_release(mm);
+ if (!mm->mmap) /* Can happen if dup_mmap() received an OOM */
+ return;
+
if (mm->locked_vm) {
vma = mm->mmap;
while (vma) {