diff options
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.patch | 43 |
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 @@ | |||
1 | From 827be17f16d9325db1c05f012ceab345139f7cad Mon Sep 17 00:00:00 2001 | ||
2 | From: Luis Henriques <luis.henriques@canonical.com> | ||
3 | Date: Wed, 11 Jul 2012 14:02:10 -0700 | ||
4 | Subject: [PATCH 039/109] ocfs2: fix NULL pointer dereference in | ||
5 | __ocfs2_change_file_space() | ||
6 | |||
7 | commit a4e08d001f2e50bb8b3c4eebadcf08e5535f02ee upstream. | ||
8 | |||
9 | As ocfs2_fallocate() will invoke __ocfs2_change_file_space() with a NULL | ||
10 | as the first parameter (file), it may trigger a NULL pointer dereferrence | ||
11 | due to a missing check. | ||
12 | |||
13 | Addresses http://bugs.launchpad.net/bugs/1006012 | ||
14 | |||
15 | Signed-off-by: Luis Henriques <luis.henriques@canonical.com> | ||
16 | Reported-by: Bret Towe <magnade@gmail.com> | ||
17 | Tested-by: Bret Towe <magnade@gmail.com> | ||
18 | Cc: Sunil Mushran <sunil.mushran@oracle.com> | ||
19 | Acked-by: Joel Becker <jlbec@evilplan.org> | ||
20 | Acked-by: Mark Fasheh <mfasheh@suse.com> | ||
21 | Signed-off-by: Andrew Morton <akpm@linux-foundation.org> | ||
22 | Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> | ||
23 | Signed-off-by: Ben Hutchings <ben@decadent.org.uk> | ||
24 | --- | ||
25 | fs/ocfs2/file.c | 2 +- | ||
26 | 1 files changed, 1 insertions(+), 1 deletions(-) | ||
27 | |||
28 | diff --git a/fs/ocfs2/file.c b/fs/ocfs2/file.c | ||
29 | index 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 | -- | ||
42 | 1.7.7.6 | ||
43 | |||