From: Josef Bacik <jbacik@fusionio.com>
To: Cong Ding <dinggnu@gmail.com>
Cc: Chris Mason <clmason@fusionio.com>,
"linux-btrfs@vger.kernel.org" <linux-btrfs@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] btrfs: fix potential null pointer dereference bug
Date: Thu, 24 Jan 2013 10:34:20 -0500 [thread overview]
Message-ID: <20130124153420.GC2349@localhost.localdomain> (raw)
In-Reply-To: <1358609265-347-1-git-send-email-dinggnu@gmail.com>
On Sat, Jan 19, 2013 at 08:27:45AM -0700, Cong Ding wrote:
> The bug happens when rb_node == NULL. It causes variable node to be NULL and
> then the NULL pointer is dereferenced this line:
> BUG_ON((struct btrfs_root *)node->data != root);
>
> Based on my analysis, function tree_search should not return NULL to variable
> rb_node in this case (otherwise here has to be something unknown thing wrong),
> so I replace "if (rb_node)" with UG_ON(!rb_node).
>
> Signed-off-by: Cong Ding <dinggnu@gmail.com>
I don't want to add more BUG_ON()'s, just return an error.
Josef
next prev parent reply other threads:[~2013-01-24 15:34 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-01-19 15:27 [PATCH] btrfs: fix potential null pointer dereference bug Cong Ding
2013-01-24 15:34 ` Josef Bacik [this message]
2013-01-24 23:46 ` Cong Ding
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=20130124153420.GC2349@localhost.localdomain \
--to=jbacik@fusionio.com \
--cc=clmason@fusionio.com \
--cc=dinggnu@gmail.com \
--cc=linux-btrfs@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
/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).