]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blob - releases/3.2.6/proc-mem_release-should-check-mm-null.patch
6.1-stable patches
[thirdparty/kernel/stable-queue.git] / releases / 3.2.6 / proc-mem_release-should-check-mm-null.patch
1 From 71879d3cb3dd8f2dfdefb252775c1b3ea04a3dd4 Mon Sep 17 00:00:00 2001
2 From: Oleg Nesterov <oleg@redhat.com>
3 Date: Tue, 31 Jan 2012 17:14:38 +0100
4 Subject: proc: mem_release() should check mm != NULL
5
6 From: Oleg Nesterov <oleg@redhat.com>
7
8 commit 71879d3cb3dd8f2dfdefb252775c1b3ea04a3dd4 upstream.
9
10 mem_release() can hit mm == NULL, add the necessary check.
11
12 Signed-off-by: Oleg Nesterov <oleg@redhat.com>
13 Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
14 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
15
16 ---
17 fs/proc/base.c | 4 ++--
18 1 file changed, 2 insertions(+), 2 deletions(-)
19
20 --- a/fs/proc/base.c
21 +++ b/fs/proc/base.c
22 @@ -886,8 +886,8 @@ loff_t mem_lseek(struct file *file, loff
23 static int mem_release(struct inode *inode, struct file *file)
24 {
25 struct mm_struct *mm = file->private_data;
26 -
27 - mmput(mm);
28 + if (mm)
29 + mmput(mm);
30 return 0;
31 }
32