summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKangjie Lu <kangjielu@gmail.com>2016-05-03 16:44:07 -0400
committerSasha Levin <alexander.levin@verizon.com>2016-08-19 23:08:46 -0400
commit1b7d7bce7467cf10f21007a5c952688877ead95e (patch)
tree9cabfe6cb83eb39769e104338ba5a25408c5556c
parentc65b5c9c0085bab46706f35c4889dd03cf2b0c08 (diff)
ALSA: timer: Fix leak in SNDRV_TIMER_IOCTL_PARAMS
[ Upstream commit cec8f96e49d9be372fdb0c3836dcf31ec71e457e ] The stack object “tread” has a total size of 32 bytes. Its field “event” and “val” both contain 4 bytes padding. These 8 bytes padding bytes are sent to user without being initialized. Signed-off-by: Kangjie Lu <kjlu@gatech.edu> Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
-rw-r--r--sound/core/timer.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/sound/core/timer.c b/sound/core/timer.c
index 7e3020c1e9d3..e55f045d6289 100644
--- a/sound/core/timer.c
+++ b/sound/core/timer.c
@@ -1746,6 +1746,7 @@ static int snd_timer_user_params(struct file *file,
if (tu->timeri->flags & SNDRV_TIMER_IFLG_EARLY_EVENT) {
if (tu->tread) {
struct snd_timer_tread tread;
+ memset(&tread, 0, sizeof(tread));
tread.event = SNDRV_TIMER_EVENT_EARLY;
tread.tstamp.tv_sec = 0;
tread.tstamp.tv_nsec = 0;