diff options
author | Takashi Iwai <tiwai@suse.de> | 2014-10-28 07:42:19 -0400 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2014-10-28 07:45:53 -0400 |
commit | 317168d0c766defd14b3d0e9c2c4a9a258b803ee (patch) | |
tree | 68e3556e0e4018ba71d08c2624dd4ae7595db28c /sound/core | |
parent | d1d0b6b668818571122d30d68a0b3f768bd83a52 (diff) |
ALSA: pcm: Zero-clear reserved fields of PCM status ioctl in compat mode
In compat mode, we copy each field of snd_pcm_status struct but don't
touch the reserved fields, and this leaves uninitialized values
there. Meanwhile the native ioctl does zero-clear the whole
structure, so we should follow the same rule in compat mode, too.
Reported-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/core')
-rw-r--r-- | sound/core/pcm_compat.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/sound/core/pcm_compat.c b/sound/core/pcm_compat.c index 102e8fd1d450..2d957ba63557 100644 --- a/sound/core/pcm_compat.c +++ b/sound/core/pcm_compat.c | |||
@@ -210,6 +210,8 @@ static int snd_pcm_status_user_compat(struct snd_pcm_substream *substream, | |||
210 | if (err < 0) | 210 | if (err < 0) |
211 | return err; | 211 | return err; |
212 | 212 | ||
213 | if (clear_user(src, sizeof(*src))) | ||
214 | return -EFAULT; | ||
213 | if (put_user(status.state, &src->state) || | 215 | if (put_user(status.state, &src->state) || |
214 | compat_put_timespec(&status.trigger_tstamp, &src->trigger_tstamp) || | 216 | compat_put_timespec(&status.trigger_tstamp, &src->trigger_tstamp) || |
215 | compat_put_timespec(&status.tstamp, &src->tstamp) || | 217 | compat_put_timespec(&status.tstamp, &src->tstamp) || |