OSDN Git Service

ALSA: pcm: Avoid possible info leaks from PCM stream buffers
authorTakashi Iwai <tiwai@suse.de>
Wed, 11 Dec 2019 15:57:42 +0000 (16:57 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 4 Jan 2020 12:34:19 +0000 (13:34 +0100)
commit408d9794b634b1e401f17bda546bdea15d9306c1
tree7fe157281f077e27c01c4faad58c7d939f4c890a
parentd24bdac247dfa31c38ad1f9ff40191df22bc8eab
ALSA: pcm: Avoid possible info leaks from PCM stream buffers

commit add9d56d7b3781532208afbff5509d7382fb6efe upstream.

The current PCM code doesn't initialize explicitly the buffers
allocated for PCM streams, hence it might leak some uninitialized
kernel data or previous stream contents by mmapping or reading the
buffer before actually starting the stream.

Since this is a common problem, this patch simply adds the clearance
of the buffer data at hw_params callback.  Although this does only
zero-clear no matter which format is used, which doesn't mean the
silence for some formats, but it should be OK because the intention is
just to clear the previous data on the buffer.

Reported-by: Lionel Koenig <lionel.koenig@gmail.com>
Cc: <stable@vger.kernel.org>
Link: https://lore.kernel.org/r/20191211155742.3213-1-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
sound/core/pcm_native.c