From: Luis Henriques <luis.henriques@canonical.com>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: Bret Towe <magnade@gmail.com>,
linux-kernel@vger.kernel.org, ocfs2-devel@oss.oracle.com,
mfasheh@suse.com, jlbec@evilplan.org, sunil.mushran@oracle.com
Subject: [PATCH] ocfs2: Fix NULL pointer dereferrence in __ocfs2_change_file_space
Date: Wed, 20 Jun 2012 23:34:44 +0100 [thread overview]
Message-ID: <1340231684-1667-1-git-send-email-luis.henriques@canonical.com> (raw)
In-Reply-To: <20120620145659.a5fff5f6.akpm@linux-foundation.org>
As ocfs2_fallocate() will invoke __ocfs2_change_file_space() with a NULL
as the first parameter (file), it may trigger a NULL pointer dereferrence
due to a missing check. See http://bugs.launchpad.net/bugs/1006012.
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
fs/ocfs2/file.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/fs/ocfs2/file.c b/fs/ocfs2/file.c
index 6e39668..84822a4 100644
--- a/fs/ocfs2/file.c
+++ b/fs/ocfs2/file.c
@@ -1950,7 +1950,7 @@ static int __ocfs2_change_file_space(struct file *file, struct inode *inode,
if (ret < 0)
mlog_errno(ret);
- if (file->f_flags & O_SYNC)
+ if (file && (file->f_flags & O_SYNC))
handle->h_sync = 1;
ocfs2_commit_trans(osb, handle);
--
1.7.9.5
next prev parent reply other threads:[~2012-06-20 22:34 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-01-05 22:23 BUG in ofcs2_change_file_space Bret Towe
2012-05-22 3:11 ` Bret Towe
2012-06-20 17:38 ` Bret Towe
2012-06-20 18:01 ` Luis Henriques
2012-06-20 21:56 ` Andrew Morton
2012-06-20 22:29 ` Luis Henriques
2012-06-20 22:34 ` Luis Henriques [this message]
2012-06-20 22:39 ` [PATCH] ocfs2: Fix NULL pointer dereferrence in __ocfs2_change_file_space Luis Henriques
2012-06-20 22:42 ` Andrew Morton
2012-06-20 23:18 ` Mark Fasheh
2012-06-21 6:12 ` Joel Becker
2012-06-21 4:39 ` Bret Towe
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1340231684-1667-1-git-send-email-luis.henriques@canonical.com \
--to=luis.henriques@canonical.com \
--cc=akpm@linux-foundation.org \
--cc=jlbec@evilplan.org \
--cc=linux-kernel@vger.kernel.org \
--cc=magnade@gmail.com \
--cc=mfasheh@suse.com \
--cc=ocfs2-devel@oss.oracle.com \
--cc=sunil.mushran@oracle.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®