a7b0d91
From b06a443b5679e9a0298e2f206ddb60845569f62f Mon Sep 17 00:00:00 2001
a7b0d91
From: Kangjie Lu <kangjielu@gmail.com>
a7b0d91
Date: Tue, 3 May 2016 16:44:32 -0400
a7b0d91
Subject: [PATCH 3/3] ALSA: timer: Fix leak in events via
a7b0d91
 snd_timer_user_tinterrupt
a7b0d91
MIME-Version: 1.0
a7b0d91
Content-Type: text/plain; charset=UTF-8
a7b0d91
Content-Transfer-Encoding: 8bit
a7b0d91
a7b0d91
The stack object “r1” has a total size of 32 bytes. Its field
a7b0d91
“event” and “val” both contain 4 bytes padding. These 8 bytes
a7b0d91
padding bytes are sent to user without being initialized.
a7b0d91
a7b0d91
Signed-off-by: Kangjie Lu <kjlu@gatech.edu>
a7b0d91
Signed-off-by: Takashi Iwai <tiwai@suse.de>
a7b0d91
---
a7b0d91
 sound/core/timer.c | 1 +
a7b0d91
 1 file changed, 1 insertion(+)
a7b0d91
a7b0d91
diff --git a/sound/core/timer.c b/sound/core/timer.c
a7b0d91
index e98fa5feb731..c69a27155433 100644
a7b0d91
--- a/sound/core/timer.c
a7b0d91
+++ b/sound/core/timer.c
a7b0d91
@@ -1268,6 +1268,7 @@ static void snd_timer_user_tinterrupt(struct snd_timer_instance *timeri,
a7b0d91
 	}
a7b0d91
 	if ((tu->filter & (1 << SNDRV_TIMER_EVENT_RESOLUTION)) &&
a7b0d91
 	    tu->last_resolution != resolution) {
a7b0d91
+		memset(&r1, 0, sizeof(r1));
a7b0d91
 		r1.event = SNDRV_TIMER_EVENT_RESOLUTION;
a7b0d91
 		r1.tstamp = tstamp;
a7b0d91
 		r1.val = resolution;
a7b0d91
-- 
a7b0d91
2.5.5
a7b0d91