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]
Message-ID: <20191206134804.4537-1-snu@amazon.com>
Date:   Fri, 6 Dec 2019 14:48:04 +0100
From:   Stefan Nuernberger <snu@...zon.com>
To:     <linux-kernel@...r.kernel.org>
CC:     Boris Ostrovsky <boris.ostrovsky@...cle.com>,
        Juergen Gross <jgross@...e.com>,
        Ross Lagerwall <ross.lagerwall@...rix.com>,
        Uwe Dannowski <uwed@...zon.de>,
        Conny Seidel <consei@...zon.de>,
        Stefan Nuernberger <snu@...zon.com>,
        <xen-devel@...ts.xenproject.org>, <stable@...r.kernel.org>
Subject: [PATCH] xen/pciback: Prevent NULL pointer dereference in quirks_show

From: Uwe Dannowski <uwed@...zon.de>

Reading /sys/bus/pci/drivers/pciback/quirks while unbinding can result
in dereferencing a NULL pointer. Instead, skip printing information
about the dangling quirk.

Reported-by: Conny Seidel <consei@...zon.de>
Signed-off-by: Uwe Dannowski <uwed@...zon.de>
Signed-off-by: Stefan Nuernberger <snu@...zon.com>

Cc: xen-devel@...ts.xenproject.org
Cc: stable@...r.kernel.org
---
 drivers/xen/xen-pciback/pci_stub.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/xen/xen-pciback/pci_stub.c b/drivers/xen/xen-pciback/pci_stub.c
index 097410a7cdb7..da725e474294 100644
--- a/drivers/xen/xen-pciback/pci_stub.c
+++ b/drivers/xen/xen-pciback/pci_stub.c
@@ -1346,6 +1346,8 @@ static ssize_t quirks_show(struct device_driver *drv, char *buf)
 				   quirk->devid.subdevice);
 
 		dev_data = pci_get_drvdata(quirk->pdev);
+		if (!dev_data)
+			continue;
 
 		list_for_each_entry(cfg_entry, &dev_data->config_fields, list) {
 			field = cfg_entry->field;
-- 
2.23.0




Amazon Development Center Germany GmbH
Krausenstr. 38
10117 Berlin
Geschaeftsfuehrung: Christian Schlaeger, Ralf Herbrich
Eingetragen am Amtsgericht Charlottenburg unter HRB 149173 B
Sitz: Berlin
Ust-ID: DE 289 237 879



Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ