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: <20230316155356.13391-1-valthebrewer@yandex.ru>
Date:   Thu, 16 Mar 2023 18:53:55 +0300
From:   Valery Zabrovsky <valthebrewer@...dex.ru>
To:     Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Cc:     Valery Zabrovsky <valthebrewer@...dex.ru>,
        Guo Zhengkui <guozhengkui@...o.com>,
        Aaro Koskinen <aaro.koskinen@....fi>,
        Alan Stern <stern@...land.harvard.edu>,
        Mian Yousaf Kaukab <yousaf.kaukab@...el.com>,
        Felipe Balbi <balbi@...com>,
        Alexey Khoroshilov <khoroshilov@...ras.ru>,
        linux-usb@...r.kernel.org, linux-kernel@...r.kernel.org,
        lvc-project@...uxtesting.org
Subject: [PATCH] usb: gadget: net2280: fix NULL pointer dereference

In net2280_free_request():
If _ep is NULL, then ep is NULL and is dereferenced
while trying to produce an error message.
The patch replaces dev_err() with pr_err() which works fine.

Found by Linux Verification Center (linuxtesting.org) with SVACE.

Fixes: 9ceafcc2b3ad ("usb: gadget: net2280: print error in ep_ops error paths")
Signed-off-by: Valery Zabrovsky <valthebrewer@...dex.ru>
---
 drivers/usb/gadget/udc/net2280.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/usb/gadget/udc/net2280.c b/drivers/usb/gadget/udc/net2280.c
index 1b929c519cd7..a027d1323993 100644
--- a/drivers/usb/gadget/udc/net2280.c
+++ b/drivers/usb/gadget/udc/net2280.c
@@ -584,8 +584,7 @@ static void net2280_free_request(struct usb_ep *_ep, struct usb_request *_req)
 
 	ep = container_of(_ep, struct net2280_ep, ep);
 	if (!_ep || !_req) {
-		dev_err(&ep->dev->pdev->dev, "%s: Invalid ep=%p or req=%p\n",
-							__func__, _ep, _req);
+		pr_err("%s: Invalid ep=%p or req=%p\n", __func__, _ep, _req);
 		return;
 	}
 
-- 
2.34.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ