Skip to content

Commit

Permalink
ALSA: hdspm - prevent reading unitialized stack memory
Browse files Browse the repository at this point in the history
Original patch by Dan Rosenberg <[email protected]> under commit
e68d3b3. I'm copying his text here:

The SNDRV_HDSPM_IOCTL_GET_CONFIG_INFO ioctl in hdspm.c allow unprivileged
users to read uninitialized kernel stack memory, because several fields
of the hdspm_config struct 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: Adrian Knoth <[email protected]>
Signed-off-by: Takashi Iwai <[email protected]>
  • Loading branch information
adiknoth authored and tiwai committed Feb 23, 2011
1 parent 7c4a95b commit 4ab69a2
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions sound/pci/rme9652/hdspm.c
Original file line number Diff line number Diff line change
Expand Up @@ -6081,6 +6081,7 @@ static int snd_hdspm_hwdep_ioctl(struct snd_hwdep *hw, struct file *file,

case SNDRV_HDSPM_IOCTL_GET_CONFIG:

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);
Expand Down

0 comments on commit 4ab69a2

Please sign in to comment.