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>] [day] [month] [year] [list]
Message-Id: <20181124144840.14608-1-colin.king@canonical.com>
Date:   Sat, 24 Nov 2018 14:48:40 +0000
From:   Colin King <colin.king@...onical.com>
To:     Bernie Thompson <bernie@...gable.com>,
        Bartlomiej Zolnierkiewicz <b.zolnierkie@...sung.com>,
        linux-fbdev@...r.kernel.org, dri-devel@...ts.freedesktop.org
Cc:     kernel-janitors@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: [PATCH] udlfb: don't call unregister_framebuffer on a null pointer

From: Colin Ian King <colin.king@...onical.com>

Just before calling unregister_framebuffer with info there is a
null check on info, implying info may possibly zero.  Calling
unregister_framebuffer with a null pointer will cause a null
pointer dereference, fix this by moving the call to the block
where info has been null checked.

Detected by CoverityScan, CID#1473969 ("Dereference after null check")

Fixes: 68a958a915ca ("udlfb: handle unplug properly")
Signed-off-by: Colin Ian King <colin.king@...onical.com>
---
 drivers/video/fbdev/udlfb.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/video/fbdev/udlfb.c b/drivers/video/fbdev/udlfb.c
index 070026a7e55a..cf8597f43d7e 100644
--- a/drivers/video/fbdev/udlfb.c
+++ b/drivers/video/fbdev/udlfb.c
@@ -1735,9 +1735,9 @@ static void dlfb_usb_disconnect(struct usb_interface *intf)
 		for (i = 0; i < ARRAY_SIZE(fb_device_attrs); i++)
 			device_remove_file(info->dev, &fb_device_attrs[i]);
 		device_remove_bin_file(info->dev, &edid_attr);
+		unregister_framebuffer(info);
 	}
 
-	unregister_framebuffer(info);
 }
 
 static struct usb_driver dlfb_driver = {
-- 
2.19.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ