From: "Roger Pau Monné" <roger.pau@citrix.com>
To: Felipe Pena <felipensp@gmail.com>,
Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>,
Boris Ostrovsky <boris.ostrovsky@oracle.com>,
David Vrabel <david.vrabel@citrix.com>
Cc: <xen-devel@lists.xenproject.org>, <linux-kernel@vger.kernel.org>
Subject: Re: [Xen-devel] [PATCH] block: xen-blkfront: Fix possible NULL ptr dereference
Date: Mon, 11 Nov 2013 10:48:00 +0100 [thread overview]
Message-ID: <5280A7D0.5040101@citrix.com> (raw)
In-Reply-To: <1384011369-4381-1-git-send-email-felipensp@gmail.com>
On 09/11/13 16:36, Felipe Pena wrote:
> In the blkif_release function the bdget_disk() call might returns
> a NULL ptr which might be dereferenced on bdev->bd_openers checking
>
> Signed-off-by: Felipe Pena <felipensp@gmail.com>
> ---
> drivers/block/xen-blkfront.c | 4 ++++
> 1 file changed, 4 insertions(+)
>
> diff --git a/drivers/block/xen-blkfront.c b/drivers/block/xen-blkfront.c
> index a4660bb..7bb1552 100644
> --- a/drivers/block/xen-blkfront.c
> +++ b/drivers/block/xen-blkfront.c
> @@ -1959,6 +1959,9 @@ static void blkif_release(struct gendisk *disk, fmode_t mode)
>
> bdev = bdget_disk(disk, 0);
>
> + if (!bdev)
> + goto out_mutex;
Is this actually possible? By looking at blkfront code, it seems like we
don't remove the device if it is still open, so maybe this should be a
BUG_ON instead of failing silently.
Roger.
prev parent reply other threads:[~2013-11-11 9:48 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-11-09 15:36 [PATCH] block: xen-blkfront: Fix possible NULL ptr dereference Felipe Pena
2013-11-11 9:48 ` Roger Pau Monné [this message]
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=5280A7D0.5040101@citrix.com \
--to=roger.pau@citrix.com \
--cc=boris.ostrovsky@oracle.com \
--cc=david.vrabel@citrix.com \
--cc=felipensp@gmail.com \
--cc=konrad.wilk@oracle.com \
--cc=linux-kernel@vger.kernel.org \
--cc=xen-devel@lists.xenproject.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).