提交 a1a15ac5 编写于 作者: K Kris Shannon 提交者: Jens Axboe

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.
上级 559595a9
...@@ -977,6 +977,8 @@ static void backend_changed(struct xenbus_device *dev, ...@@ -977,6 +977,8 @@ static void backend_changed(struct xenbus_device *dev,
break; break;
case XenbusStateClosing: case XenbusStateClosing:
if (info->gd == NULL)
xenbus_dev_fatal(dev, -ENODEV, "gd is NULL");
bd = bdget_disk(info->gd, 0); bd = bdget_disk(info->gd, 0);
if (bd == NULL) if (bd == NULL)
xenbus_dev_fatal(dev, -ENODEV, "bdget failed"); xenbus_dev_fatal(dev, -ENODEV, "bdget failed");
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册