Skip to content

Commit e68d3b3

Browse files
Dan Rosenbergtiwai
authored andcommitted
ALSA: sound/pci/rme9652: prevent reading uninitialized stack memory
The SNDRV_HDSP_IOCTL_GET_CONFIG_INFO and SNDRV_HDSP_IOCTL_GET_CONFIG_INFO ioctls in hdspm.c and hdsp.c allow unprivileged users to read uninitialized kernel stack memory, because several fields of the hdsp{m}_config_info structs declared on the stack are not altered or zeroed before being copied back to the user. This patch takes care of it. Signed-off-by: Dan Rosenberg <[email protected]> Cc: <[email protected]> Signed-off-by: Takashi Iwai <[email protected]>
1 parent 0873a5a commit e68d3b3

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

sound/pci/rme9652/hdsp.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4609,6 +4609,7 @@ static int snd_hdsp_hwdep_ioctl(struct snd_hwdep *hw, struct file *file, unsigne
46094609
if (err < 0)
46104610
return err;
46114611

4612+
memset(&info, 0, sizeof(info));
46124613
spin_lock_irqsave(&hdsp->lock, flags);
46134614
info.pref_sync_ref = (unsigned char)hdsp_pref_sync_ref(hdsp);
46144615
info.wordclock_sync_check = (unsigned char)hdsp_wc_sync_check(hdsp);

sound/pci/rme9652/hdspm.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4127,6 +4127,7 @@ static int snd_hdspm_hwdep_ioctl(struct snd_hwdep * hw, struct file *file,
41274127

41284128
case SNDRV_HDSPM_IOCTL_GET_CONFIG_INFO:
41294129

4130+
memset(&info, 0, sizeof(info));
41304131
spin_lock_irq(&hdspm->lock);
41314132
info.pref_sync_ref = hdspm_pref_sync_ref(hdspm);
41324133
info.wordclock_sync_check = hdspm_wc_sync_check(hdspm);

0 commit comments

Comments
 (0)