]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
sound: sgio2audio/pdaudiocf/usb-audio: initialize PCM buffer
authorClemens Ladisch <clemens@ladisch.de>
Fri, 18 Dec 2009 08:27:24 +0000 (09:27 +0100)
committerGreg Kroah-Hartman <gregkh@suse.de>
Wed, 6 Jan 2010 23:17:10 +0000 (15:17 -0800)
commit 3e85fd614c7b6bb7f33bb04a0dcb5a3bfca4c0fe upstream.

When allocating the PCM buffer, use vmalloc_user() instead of vmalloc().
Otherwise, it would be possible for applications to play the previous
contents of the kernel memory to the speakers, or to read it directly if
the buffer is exported to userspace.

Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
sound/mips/sgio2audio.c
sound/pcmcia/pdaudiocf/pdaudiocf_pcm.c
sound/usb/usbaudio.c

index 4c63504348dc4ba155cfd8ab79a4e03347db8d84..c1b777d68c03db203e82a2daa8be8cf9417b137e 100644 (file)
@@ -609,7 +609,7 @@ static int snd_sgio2audio_pcm_hw_params(struct snd_pcm_substream *substream,
        /* alloc virtual 'dma' area */
        if (runtime->dma_area)
                vfree(runtime->dma_area);
-       runtime->dma_area = vmalloc(size);
+       runtime->dma_area = vmalloc_user(size);
        if (runtime->dma_area == NULL)
                return -ENOMEM;
        runtime->dma_bytes = size;
index 01066c95580e806b2ba83841e5edb52765e4a444..51fd452b516bcb4fc2dbba3e4ad07203e8325203 100644 (file)
@@ -51,7 +51,7 @@ static int snd_pcm_alloc_vmalloc_buffer(struct snd_pcm_substream *subs, size_t s
                        return 0; /* already enough large */
                vfree(runtime->dma_area);
        }
-       runtime->dma_area = vmalloc_32(size);
+       runtime->dma_area = vmalloc_32_user(size);
        if (! runtime->dma_area)
                return -ENOMEM;
        runtime->dma_bytes = size;
index 915a1316724ccd586431a14c336ece8346493e35..04e5d2eb8ea9075dc8d53d7ad9170fd2c2af7f28 100644 (file)
@@ -740,7 +740,7 @@ static int snd_pcm_alloc_vmalloc_buffer(struct snd_pcm_substream *subs, size_t s
                        return 0; /* already large enough */
                vfree(runtime->dma_area);
        }
-       runtime->dma_area = vmalloc(size);
+       runtime->dma_area = vmalloc_user(size);
        if (!runtime->dma_area)
                return -ENOMEM;
        runtime->dma_bytes = size;