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: <CAJSP0QViU7OKuQ9JoX8OrDv_o8xTzHkTDVbxehEBfJdG2_Ps_A@mail.gmail.com>
Date:	Tue, 20 May 2014 09:34:11 +0200
From:	Stefan Hajnoczi <stefanha@...il.com>
To:	Rickard Strandqvist <rickard_strandqvist@...ctrumdigital.se>
Cc:	Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
	Rashika Kheria <rashika.kheria@...il.com>,
	Dan Carpenter <dan.carpenter@...cle.com>,
	devel@...verdev.osuosl.org,
	linux-kernel <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] staging: line6: toneport.c: Fix for possible null pointer dereference

On Mon, May 19, 2014 at 11:39 PM, Rickard Strandqvist
<rickard_strandqvist@...ctrumdigital.se> wrote:
> There is otherwise a risk of a possible null pointer dereference.
>
> Was largely found by using a static code analysis program called cppcheck.
>
> Signed-off-by: Rickard Strandqvist <rickard_strandqvist@...ctrumdigital.se>
> ---
>  drivers/staging/line6/toneport.c |   14 ++++++++------
>  1 file changed, 8 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/staging/line6/toneport.c b/drivers/staging/line6/toneport.c
> index af2e7e5..36fe76d 100644
> --- a/drivers/staging/line6/toneport.c
> +++ b/drivers/staging/line6/toneport.c
> @@ -431,11 +431,15 @@ void line6_toneport_disconnect(struct usb_interface *interface)
>  {
>         struct usb_line6_toneport *toneport;
>         u16 idProduct;
> +       struct snd_line6_pcm *line6pcm;
>
>         if (interface == NULL)
>                 return;
>
>         toneport = usb_get_intfdata(interface);
> +       if (toneport == NULL)
> +               return;
> +
>         del_timer_sync(&toneport->timer);
>         idProduct = le16_to_cpu(toneport->line6.usbdev->descriptor.idProduct);
>
> @@ -444,13 +448,11 @@ void line6_toneport_disconnect(struct usb_interface *interface)
>                 device_remove_file(&interface->dev, &dev_attr_led_green);
>         }
>
> -       if (toneport != NULL) {
> -               struct snd_line6_pcm *line6pcm = toneport->line6.line6pcm;

Didn't look into this but it's the traditional "use before NULL
check".  Can't hurt to fix it.

Reviewed-by: Stefan Hajnoczi <stefanha@...il.com>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ