Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e68d3b31 authored by Dan Rosenberg's avatar Dan Rosenberg Committed by Takashi Iwai
Browse files

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: default avatarDan Rosenberg <dan.j.rosenberg@gmail.com>
Cc: <stable@kernel.org>
Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parent 0873a5ae
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -4609,6 +4609,7 @@ static int snd_hdsp_hwdep_ioctl(struct snd_hwdep *hw, struct file *file, unsigne
		if (err < 0)
			return err;

		memset(&info, 0, sizeof(info));
		spin_lock_irqsave(&hdsp->lock, flags);
		info.pref_sync_ref = (unsigned char)hdsp_pref_sync_ref(hdsp);
		info.wordclock_sync_check = (unsigned char)hdsp_wc_sync_check(hdsp);
+1 −0
Original line number Diff line number Diff line
@@ -4127,6 +4127,7 @@ static int snd_hdspm_hwdep_ioctl(struct snd_hwdep * hw, struct file *file,

	case SNDRV_HDSPM_IOCTL_GET_CONFIG_INFO:

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