summaryrefslogtreecommitdiffstats
path: root/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0039-ocfs2-fix-NULL-pointer-dereference-in-__ocfs2_change.patch
diff options
context:
space:
mode:
Diffstat (limited to 'recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0039-ocfs2-fix-NULL-pointer-dereference-in-__ocfs2_change.patch')
-rw-r--r--recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0039-ocfs2-fix-NULL-pointer-dereference-in-__ocfs2_change.patch43
1 files changed, 43 insertions, 0 deletions
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0039-ocfs2-fix-NULL-pointer-dereference-in-__ocfs2_change.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0039-ocfs2-fix-NULL-pointer-dereference-in-__ocfs2_change.patch
new file mode 100644
index 00000000..64d18e28
--- /dev/null
+++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0039-ocfs2-fix-NULL-pointer-dereference-in-__ocfs2_change.patch
@@ -0,0 +1,43 @@
1From 827be17f16d9325db1c05f012ceab345139f7cad Mon Sep 17 00:00:00 2001
2From: Luis Henriques <luis.henriques@canonical.com>
3Date: Wed, 11 Jul 2012 14:02:10 -0700
4Subject: [PATCH 039/109] ocfs2: fix NULL pointer dereference in
5 __ocfs2_change_file_space()
6
7commit a4e08d001f2e50bb8b3c4eebadcf08e5535f02ee upstream.
8
9As ocfs2_fallocate() will invoke __ocfs2_change_file_space() with a NULL
10as the first parameter (file), it may trigger a NULL pointer dereferrence
11due to a missing check.
12
13Addresses http://bugs.launchpad.net/bugs/1006012
14
15Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
16Reported-by: Bret Towe <magnade@gmail.com>
17Tested-by: Bret Towe <magnade@gmail.com>
18Cc: Sunil Mushran <sunil.mushran@oracle.com>
19Acked-by: Joel Becker <jlbec@evilplan.org>
20Acked-by: Mark Fasheh <mfasheh@suse.com>
21Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
22Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
23Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
24---
25 fs/ocfs2/file.c | 2 +-
26 1 files changed, 1 insertions(+), 1 deletions(-)
27
28diff --git a/fs/ocfs2/file.c b/fs/ocfs2/file.c
29index 07ee5b4..1c7d45e 100644
30--- a/fs/ocfs2/file.c
31+++ b/fs/ocfs2/file.c
32@@ -1950,7 +1950,7 @@ static int __ocfs2_change_file_space(struct file *file, struct inode *inode,
33 if (ret < 0)
34 mlog_errno(ret);
35
36- if (file->f_flags & O_SYNC)
37+ if (file && (file->f_flags & O_SYNC))
38 handle->h_sync = 1;
39
40 ocfs2_commit_trans(osb, handle);
41--
421.7.7.6
43