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-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20190503213235.GA9080@amd>
Date:   Fri, 3 May 2019 23:32:35 +0200
From:   Pavel Machek <pavel@...x.de>
To:     Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Cc:     linux-kernel@...r.kernel.org, stable@...r.kernel.org,
        Aditya Pakki <pakki001@....edu>,
        Richard Leitner <richard.leitner@...data.com>,
        "Sasha Levin (Microsoft)" <sashal@...nel.org>
Subject: Re: [PATCH 4.19 57/72] usb: usb251xb: fix to avoid potential NULL
 pointer dereference

On Thu 2019-05-02 17:21:19, Greg Kroah-Hartman wrote:
> [ Upstream commit 41f00e6e9e55546390031996b773e7f3c1d95928 ]
> 
> of_match_device in usb251xb_probe can fail and returns a NULL pointer.
> The patch avoids a potential NULL pointer dereference in this scenario.
> 
> Signed-off-by: Aditya Pakki <pakki001@....edu>
> Reviewed-by: Richard Leitner <richard.leitner@...data.com>
> Signed-off-by: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
> Signed-off-by: Sasha Levin (Microsoft) <sashal@...nel.org>
> ---
>  drivers/usb/misc/usb251xb.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/usb/misc/usb251xb.c b/drivers/usb/misc/usb251xb.c
> index a6efb9a72939..5f7734c729b1 100644
> --- a/drivers/usb/misc/usb251xb.c
> +++ b/drivers/usb/misc/usb251xb.c
> @@ -601,7 +601,7 @@ static int usb251xb_probe(struct usb251xb *hub)
>  							   dev);
>  	int err;
>  
> -	if (np) {
> +	if (np && of_id) {
>  		err = usb251xb_get_ofdata(hub,
>  					  (struct usb251xb_data *)of_id->data);
>  		if (err) {

Are you sure this si correct?

If of_id is NULL, this will proceed without setting up hub->conf_data
etc.

I'd expect it to just return error from probe...?

Was this tested?
									Pavel
-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html

Download attachment "signature.asc" of type "application/pgp-signature" (182 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ