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] [day] [month] [year] [list]
Date:	Mon, 01 Nov 2010 10:39:14 +0100
From:	Takashi Iwai <tiwai@...e.de>
To:	Jesper Juhl <jj@...osbits.net>
Cc:	linux-kernel@...r.kernel.org, Jaroslav Kysela <perex@...ex.cz>
Subject: Re: [PATCH] USB PCM Sound driver neglects kmalloc return value check and may deref NULL.

At Fri, 29 Oct 2010 20:40:23 +0200 (CEST),
Jesper Juhl wrote:
> 
> 
> sound/usb/pcm.c::snd_usb_pcm_check_knot() fails to check the return value 
> from kmalloc() and may end up dereferencing a null pointer.
> The patch below (compile tested only) should take care of that little 
> problem.
> 
> 
> Signed-off-by: Jesper Juhl <jj@...osbits.net>

Applied now.  Thanks!


Takashi

> ---
>  pcm.c |    4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/sound/usb/pcm.c b/sound/usb/pcm.c
> index cff3a3c..4132522 100644
> --- a/sound/usb/pcm.c
> +++ b/sound/usb/pcm.c
> @@ -676,8 +676,10 @@ static int snd_usb_pcm_check_knot(struct snd_pcm_runtime *runtime,
>  	if (!needs_knot)
>  		return 0;
>  
> -	subs->rate_list.count = count;
>  	subs->rate_list.list = kmalloc(sizeof(int) * count, GFP_KERNEL);
> +	if (!subs->rate_list.list)
> +		return -ENOMEM;
> +	subs->rate_list.count = count;
>  	subs->rate_list.mask = 0;
>  	count = 0;
>  	list_for_each_entry(fp, &subs->fmt_list, list) {
> 
> 
> -- 
> Jesper Juhl <jj@...osbits.net>             http://www.chaosbits.net/
> Plain text mails only, please      http://www.expita.com/nomime.html
> Don't top-post  http://www.catb.org/~esr/jargon/html/T/top-post.html
> 
--
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