Skip to content

Commit a1a15ac

Browse files
KrisShannonJens Axboe
authored andcommitted
Fix kernel NULL pointer dereference in xen-blkfront
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.
1 parent 559595a commit a1a15ac

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

drivers/block/xen-blkfront.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -977,6 +977,8 @@ static void backend_changed(struct xenbus_device *dev,
977977
break;
978978

979979
case XenbusStateClosing:
980+
if (info->gd == NULL)
981+
xenbus_dev_fatal(dev, -ENODEV, "gd is NULL");
980982
bd = bdget_disk(info->gd, 0);
981983
if (bd == NULL)
982984
xenbus_dev_fatal(dev, -ENODEV, "bdget failed");

0 commit comments

Comments
 (0)