lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date:	Thu, 07 Jul 2016 01:40:54 -0600
From:	"Jan Beulich" <JBeulich@...e.com>
To:	"Roger Pau Monne" <roger.pau@...rix.com>,
	"Konrad Rzeszutek Wilk" <konrad.wilk@...cle.com>
Cc:	<xen-devel@...ts.xenproject.org>, <linux-kernel@...r.kernel.org>
Subject: [PATCH] xen-blkfront: avoid NULL de-reference in CDROM ioctl
 handling

The ioctl can be called prior to full device setup having completed.

Signed-off-by: Jan Beulich <jbeulich@...e.com>
---
 drivers/block/xen-blkfront.c |    6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

--- 4.7-rc6-xen.orig/drivers/block/xen-blkfront.c
+++ 4.7-rc6-xen/drivers/block/xen-blkfront.c
@@ -496,12 +496,10 @@ static int blkif_ioctl(struct block_devi
 				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:
 		/*printk(KERN_ALERT "ioctl %08x not supported by Xen blkdev\n",



Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ