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, 10 Jan 2011 11:15:21 +0100
From:	Takashi Iwai <tiwai@...e.de>
To:	Jesper Juhl <jj@...osbits.net>
Cc:	alsa-devel@...a-project.org, linux-kernel@...r.kernel.org,
	Jaroslav Kysela <perex@...ex.cz>
Subject: Re: [PATCH] Don't leak in sound/core/oss/pcm_oss.c::snd_pcm_hw_param_near()

At Thu, 6 Jan 2011 22:19:47 +0100 (CET),
Jesper Juhl wrote:
> 
> 
> snd_pcm_hw_param_near() will leak the memory allocated to 'save' if the 
> call to snd_pcm_hw_param_max() returns less than zero.
> This patch makes sure we never leak.
> 
> Signed-off-by: Jesper Juhl <jj@...osbits.net>

Applied now.  Thanks.


Takashi


> ---
>  pcm_oss.c |    4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/sound/core/oss/pcm_oss.c b/sound/core/oss/pcm_oss.c
> index b753ec6..a2e4eb3 100644
> --- a/sound/core/oss/pcm_oss.c
> +++ b/sound/core/oss/pcm_oss.c
> @@ -453,8 +453,10 @@ static int snd_pcm_hw_param_near(struct snd_pcm_substream *pcm,
>  	} else {
>  		*params = *save;
>  		max = snd_pcm_hw_param_max(pcm, params, var, max, &maxdir);
> -		if (max < 0)
> +		if (max < 0) {
> +			kfree(save);
>  			return max;
> +		}
>  		last = 1;
>  	}
>   _end:
> 
> 
> 
> -- 
> Jesper Juhl <jj@...osbits.net>            http://www.chaosbits.net/
> Don't top-post http://www.catb.org/~esr/jargon/html/T/top-post.html
> Plain text mails only, please.
> 
--
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