All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jeremy Fitzhardinge <jeremy@goop.org>
To: Kris Shannon <kris@shannon.id.au>
Cc: Linux Kernel List <linux-kernel@vger.kernel.org>,
	Xen-devel <xen-devel@lists.xensource.com>,
	Jens Axboe <jens.axboe@oracle.com>
Subject: Re: [PATCH] Fix kernel NULL pointer dereference in xen-blkfront
Date: Tue, 03 Mar 2009 13:59:06 -0800	[thread overview]
Message-ID: <49ADA82A.6080508@goop.org> (raw)
In-Reply-To: <e51f4f550903020047m7f110039v48bcac6a345f1fd6@mail.gmail.com>

Kris Shannon wrote:
> When booting Xen Dom0 on a pre-release 3.2.1 hypervisor the system Oopses on a
> "Unable to handle kernel NULL pointer dereference" in xenwatch.
>
> From the backtrace it looks like backend_changed is calling bdget_disk
> with a NULL pointer.  Checking for NULL and returning ENODEV instead
> allows the kernel to boot.
>   

Thanks, applied.  (BTW, please cc: me and xen-devel for Xen-related 
reports.)

Jens: could you pull this; I think this is probably -rc material.  This 
crash just started happening, so I guess its a side-effect of some core 
kernel change.

The following changes since commit c7241227f61ca6606a7fa3555391360d92bd8d9b:
  Jens Axboe (1):
        xen/blkfront: use blk_rq_map_sg to generate ring entries

are available in the git repository at:

  git://git.kernel.org/pub/scm/linux/kernel/git/jeremy/xen.git xen/frontend/blkfront

Kris Shannon (1):
      Fix kernel NULL pointer dereference in xen-blkfront

 drivers/block/xen-blkfront.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)


Thanks,
    J

> ---
>  drivers/block/xen-blkfront.c |    2 ++
>  1 files changed, 2 insertions(+), 0 deletions(-)
>
> diff --git a/drivers/block/xen-blkfront.c b/drivers/block/xen-blkfront.c
> index f2fff5799ddf0fe1b41909b64d606d..3e2ab6d53adaeb70efa12f0a1f33bb 100644
> --- a/drivers/block/xen-blkfront.c
> +++ b/drivers/block/xen-blkfront.c
> @@ -905,6 +905,8 @@ static void backend_changed(struct xenbus_device *dev,
>  		break;
>
>  	case XenbusStateClosing:
> +		if (info->gd == NULL)
> +			xenbus_dev_fatal(dev, -ENODEV, "gd is NULL");
>  		bd = bdget_disk(info->gd, 0);
>  		if (bd == NULL)
>  			xenbus_dev_fatal(dev, -ENODEV, "bdget failed");
>   


WARNING: multiple messages have this Message-ID (diff)
From: Jeremy Fitzhardinge <jeremy@goop.org>
To: Kris Shannon <kris@shannon.id.au>
Cc: Xen-devel <xen-devel@lists.xensource.com>,
	Linux Kernel List <linux-kernel@vger.kernel.org>,
	Jens Axboe <jens.axboe@oracle.com>
Subject: Re: [PATCH] Fix kernel NULL pointer dereference in xen-blkfront
Date: Tue, 03 Mar 2009 13:59:06 -0800	[thread overview]
Message-ID: <49ADA82A.6080508@goop.org> (raw)
In-Reply-To: <e51f4f550903020047m7f110039v48bcac6a345f1fd6@mail.gmail.com>

Kris Shannon wrote:
> When booting Xen Dom0 on a pre-release 3.2.1 hypervisor the system Oopses on a
> "Unable to handle kernel NULL pointer dereference" in xenwatch.
>
> From the backtrace it looks like backend_changed is calling bdget_disk
> with a NULL pointer.  Checking for NULL and returning ENODEV instead
> allows the kernel to boot.
>   

Thanks, applied.  (BTW, please cc: me and xen-devel for Xen-related 
reports.)

Jens: could you pull this; I think this is probably -rc material.  This 
crash just started happening, so I guess its a side-effect of some core 
kernel change.

The following changes since commit c7241227f61ca6606a7fa3555391360d92bd8d9b:
  Jens Axboe (1):
        xen/blkfront: use blk_rq_map_sg to generate ring entries

are available in the git repository at:

  git://git.kernel.org/pub/scm/linux/kernel/git/jeremy/xen.git xen/frontend/blkfront

Kris Shannon (1):
      Fix kernel NULL pointer dereference in xen-blkfront

 drivers/block/xen-blkfront.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)


Thanks,
    J

> ---
>  drivers/block/xen-blkfront.c |    2 ++
>  1 files changed, 2 insertions(+), 0 deletions(-)
>
> diff --git a/drivers/block/xen-blkfront.c b/drivers/block/xen-blkfront.c
> index f2fff5799ddf0fe1b41909b64d606d..3e2ab6d53adaeb70efa12f0a1f33bb 100644
> --- a/drivers/block/xen-blkfront.c
> +++ b/drivers/block/xen-blkfront.c
> @@ -905,6 +905,8 @@ static void backend_changed(struct xenbus_device *dev,
>  		break;
>
>  	case XenbusStateClosing:
> +		if (info->gd == NULL)
> +			xenbus_dev_fatal(dev, -ENODEV, "gd is NULL");
>  		bd = bdget_disk(info->gd, 0);
>  		if (bd == NULL)
>  			xenbus_dev_fatal(dev, -ENODEV, "bdget failed");
>   

  reply	other threads:[~2009-03-03 21:59 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-03-02  8:47 [PATCH] Fix kernel NULL pointer dereference in xen-blkfront Kris Shannon
2009-03-03 21:59 ` Jeremy Fitzhardinge [this message]
2009-03-03 21:59   ` Jeremy Fitzhardinge
2009-03-04 10:16   ` Jens Axboe

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=49ADA82A.6080508@goop.org \
    --to=jeremy@goop.org \
    --cc=jens.axboe@oracle.com \
    --cc=kris@shannon.id.au \
    --cc=linux-kernel@vger.kernel.org \
    --cc=xen-devel@lists.xensource.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.