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:   Fri,  9 Nov 2018 23:25:10 +0300
From:   Alexey Khoroshilov <khoroshilov@...ras.ru>
To:     Mikulas Patocka <mpatocka@...hat.com>,
        Bernie Thompson <bernie@...gable.com>,
        Bartlomiej Zolnierkiewicz <b.zolnierkie@...sung.com>
Cc:     Alexey Khoroshilov <khoroshilov@...ras.ru>,
        linux-fbdev@...r.kernel.org, dri-devel@...ts.freedesktop.org,
        linux-kernel@...r.kernel.org, ldv-project@...uxtesting.org
Subject: [PATCH] udlfb: fix NULL pointer dereference in dlfb_usb_probe()

If memory allocation for dlfb fails, error handling code
unconditionally dereference NULL pointer.

Found by Linux Driver Verification project (linuxtesting.org).

Signed-off-by: Alexey Khoroshilov <khoroshilov@...ras.ru>
Fixes: 68a958a915ca ("udlfb: handle unplug properly")
---
 drivers/video/fbdev/udlfb.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/video/fbdev/udlfb.c b/drivers/video/fbdev/udlfb.c
index 070026a7e55a..9643fe7c8349 100644
--- a/drivers/video/fbdev/udlfb.c
+++ b/drivers/video/fbdev/udlfb.c
@@ -1590,7 +1590,7 @@ static int dlfb_usb_probe(struct usb_interface *intf,
 	int i;
 	const struct device_attribute *attr;
 	struct dlfb_data *dlfb;
-	struct fb_info *info;
+	struct fb_info *info = NULL;
 	int retval = -ENOMEM;
 	struct usb_device *usbdev = interface_to_usbdev(intf);
 
@@ -1701,8 +1701,8 @@ static int dlfb_usb_probe(struct usb_interface *intf,
 	return 0;
 
 error:
-	if (dlfb->info) {
-		dlfb_ops_destroy(dlfb->info);
+	if (info) {
+		dlfb_ops_destroy(info);
 	} else if (dlfb) {
 		usb_put_dev(dlfb->udev);
 		kfree(dlfb);
-- 
2.7.4

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ