]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
xen-blkfront: check for null drvdata in blkback_changed (XenbusStateClosing)
authorCathy Avery <cathy.avery@oracle.com>
Fri, 23 Oct 2015 10:12:46 +0000 (18:12 +0800)
committerSantosh Shilimkar <santosh.shilimkar@oracle.com>
Fri, 30 Oct 2015 16:10:21 +0000 (09:10 -0700)
Orabug: 21935345

xen-blkfront will crash if the check to talk_to_blkback()
in blkback_changed()(XenbusStateInitWait) returns an error.
The driver data is freed and info is set to NULL. Later during
the close process via talk_to_blkback's call to xenbus_dev_fatal()
the null pointer is passed to and dereference in blkfront_closing.

Signed-off-by: Cathy Avery <cathy.avery@oracle.com>
Acked-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Signed-off-by: Joe Jin <joe.jin@oracle.com>
drivers/block/xen-blkfront.c

index 7a8a73f1fc0462feab5bad706573ff6eb4536ef7..d68b08ae4be1a483bf53107fada88cbc5db6fad0 100644 (file)
@@ -1984,7 +1984,8 @@ static void blkback_changed(struct xenbus_device *dev,
                        break;
                /* Missed the backend's Closing state -- fallthrough */
        case XenbusStateClosing:
-               blkfront_closing(info);
+               if (info)
+                       blkfront_closing(info);
                break;
        }
 }