mirror of
https://github.com/followmsi/android_kernel_google_msm.git
synced 2024-11-06 23:17:41 +00:00
ALSA: pcm: Zero-clear reserved fields of PCM status ioctl in compat mode
commit 317168d0c7
upstream.
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>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Zefan Li <lizefan@huawei.com>
This commit is contained in:
parent
358105b826
commit
ad82ca3bfb
1 changed files with 2 additions and 0 deletions
|
@ -204,6 +204,8 @@ static int snd_pcm_status_user_compat(struct snd_pcm_substream *substream,
|
|||
if (err < 0)
|
||||
return err;
|
||||
|
||||
if (clear_user(src, sizeof(*src)))
|
||||
return -EFAULT;
|
||||
if (put_user(status.state, &src->state) ||
|
||||
put_user(status.trigger_tstamp.tv_sec, &src->trigger_tstamp.tv_sec) ||
|
||||
put_user(status.trigger_tstamp.tv_nsec, &src->trigger_tstamp.tv_nsec) ||
|
||||
|
|
Loading…
Reference in a new issue