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: <CAN_LGv3a=X2GSjanvJAPG_0H14PUbw+XZZ+yoo6QnXwxunRDFw@mail.gmail.com>
Date:	Sun, 27 May 2012 17:18:38 +0600
From:	"Alexander E. Patrakov" <patrakov@...il.com>
To:	Clemens Ladisch <clemens@...isch.de>
Cc:	linux-kernel@...r.kernel.org, alsa-devel@...a-project.org
Subject: Re: kmemleak findings about USB audio recording on 3.3.2

2012/5/18 Clemens Ladisch <clemens@...isch.de>:
> Please try this patch.
>
> --8<---------------------------------------------------------------->8--
> ALSA: usb-audio: fix rate_list memory leak
>
> The array of sample rates is reallocated every time when opening
> the PCM device, but was freed only once when unplugging the device.
>
> Reported-by: "Alexander E. Patrakov" <patrakov@...il.com>
> Signed-off-by: Clemens Ladisch <clemens@...isch.de>
> ---
>  sound/usb/pcm.c |    3 +++
>  1 files changed, 3 insertions(+), 0 deletions(-)
>
> --- a/sound/usb/pcm.c
> +++ b/sound/usb/pcm.c
> @@ -783,6 +783,9 @@ static int snd_usb_pcm_check_knot(struct snd_pcm_runtime *runtime,
>        int count = 0, needs_knot = 0;
>        int err;
>
> +       kfree(subs->rate_list.list);
> +       subs->rate_list.list = NULL;
> +
>        list_for_each_entry(fp, &subs->fmt_list, list) {
>                if (fp->rates & SNDRV_PCM_RATE_CONTINUOUS)
>                        return 0;

I have applied this on top of 3.4.0. So far, the microphone works, and
there are no leaks detected.

-- 
Alexander E. Patrakov
--
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