WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-changelog

[Xen-changelog] [linux-2.6.18-xen] blkfront: avoid NULL de-reference in

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [linux-2.6.18-xen] blkfront: avoid NULL de-reference in CDROM ioctl handling
From: Xen patchbot-linux-2.6.18-xen <patchbot@xxxxxxx>
Date: Fri, 08 Jul 2011 13:33:04 +0100
Delivery-date: Fri, 08 Jul 2011 05:33:23 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User Jan Beulich <jbeulich@xxxxxxxxxx>
# Date 1310127827 -3600
# Node ID 73e47d0fdb100e92233ee9142964c54fa2084795
# Parent  d1a48f331c67d2667c91bc24f314abbdaba40e72
blkfront: avoid NULL de-reference in CDROM ioctl handling

Just like already done in the default case, for CDROM_GET_CAPABILITY
info->gd should not be blindly de-referenced, as the ioctl can be
called prior to full device setup having completed.

Signed-off-by: Jan Beulich <jbeulich@xxxxxxxxxx>
---


diff -r d1a48f331c67 -r 73e47d0fdb10 drivers/xen/blkfront/blkfront.c
--- a/drivers/xen/blkfront/blkfront.c   Fri Jul 08 13:18:31 2011 +0100
+++ b/drivers/xen/blkfront/blkfront.c   Fri Jul 08 13:23:47 2011 +0100
@@ -566,12 +566,11 @@
                                return -EFAULT;
                return 0;
 
-       case CDROM_GET_CAPABILITY: {
-               struct gendisk *gd = info->gd;
-               if (gd->flags & GENHD_FL_CD)
+       case CDROM_GET_CAPABILITY:
+               if (info->gd && (info->gd->flags & GENHD_FL_CD))
                        return 0;
                return -EINVAL;
-       }
+
        default:
                if (info->mi && info->gd) {
                        switch (info->mi->major) {

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [linux-2.6.18-xen] blkfront: avoid NULL de-reference in CDROM ioctl handling, Xen patchbot-linux-2 . 6 . 18-xen <=