From: "Yan, Zheng" <zheng.z.yan@intel.com>
To: ceph-devel@vger.kernel.org
Cc: sage@inktank.com, dan.carpenter@oracle.com, "Yan,
Zheng" <zheng.z.yan@intel.com>
Subject: [PATCH 1/2] ceph: check rinfo->dir_dir before dereferencing it.
Date: Sat, 28 Sep 2013 20:34:44 +0800 [thread overview]
Message-ID: <1380371685-11577-1-git-send-email-zheng.z.yan@intel.com> (raw)
From: "Yan, Zheng" <zheng.z.yan@intel.com>
Signed-off-by: Yan, Zheng <zheng.z.yan@intel.com>
---
fs/ceph/inode.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/fs/ceph/inode.c b/fs/ceph/inode.c
index 49d4de0..6f0a35c 100644
--- a/fs/ceph/inode.c
+++ b/fs/ceph/inode.c
@@ -1288,7 +1288,8 @@ int ceph_readdir_prepopulate(struct ceph_mds_request *req,
u64 r_readdir_offset = req->r_readdir_offset;
u32 frag = le32_to_cpu(rhead->args.readdir.frag);
- if (le32_to_cpu(rinfo->dir_dir->frag) != frag) {
+ if (rinfo->dir_dir &&
+ le32_to_cpu(rinfo->dir_dir->frag) != frag) {
dout("readdir_prepopulate got new frag %x -> %x\n",
frag, le32_to_cpu(rinfo->dir_dir->frag));
frag = le32_to_cpu(rinfo->dir_dir->frag);
--
1.8.1.4
next reply other threads:[~2013-09-28 12:35 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-09-28 12:34 Yan, Zheng [this message]
2013-09-28 12:34 ` [PATCH 2/2] ceph: fix use-after-free bug Yan, Zheng
2013-09-30 21:55 ` [PATCH 1/2] ceph: check rinfo->dir_dir before dereferencing it Sage Weil
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=1380371685-11577-1-git-send-email-zheng.z.yan@intel.com \
--to=zheng.z.yan@intel.com \
--cc=ceph-devel@vger.kernel.org \
--cc=dan.carpenter@oracle.com \
--cc=sage@inktank.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;
as well as URLs for NNTP newsgroup(s).