UPSTREAM: ALSA: timer: Fix leak in SNDRV_TIMER_IOCTL_PARAMS
authorKangjie Lu <kangjielu@gmail.com>
Tue, 3 May 2016 20:44:07 +0000 (16:44 -0400)
committerAmit Pundir <amit.pundir@linaro.org>
Mon, 11 Jul 2016 07:13:04 +0000 (12:43 +0530)
(cherry pick from 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>
Bug: 28980557
Change-Id: Ibda2d126f6d72fedf797a98796c3cde7bb03db76

sound/core/timer.c

index b982d1b089bd90ff44267f528dff8690d76ad4db..cfa3500a3327c3a2ebc8e24afca8438b1cfdb5ac 100644 (file)
@@ -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;