mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Takashi Iwai <tiwai@suse.de>
To: Dan Rosenberg <drosenberg@vsecurity.com>
Cc: perex@perex.cz, alsa-devel@alsa-project.org,
	linux-kernel@vger.kernel.org, security@kernel.org,
	stable@kernel.org
Subject: Re: [PATCH] sound/pci/rme9652: prevent reading uninitialized stack memory
Date: Sat, 25 Sep 2010 17:52:35 +0200	[thread overview]
Message-ID: <s5hk4m9kegs.wl%tiwai@suse.de> (raw)
In-Reply-To: <1285427247.7957.35.camel@Dan>

At Sat, 25 Sep 2010 11:07:27 -0400,
Dan Rosenberg wrote:
> 
> 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 <dan.j.rosenberg@gmail.com>

Thanks, applied now with minor optimization (memset outside
spinlock).


Takashi


> diff -urp linux-2.6.35.5.orig/sound/pci/rme9652/hdsp.c linux-2.6.35.5/sound/pci/rme9652/hdsp.c
> --- linux-2.6.35.5.orig/sound/pci/rme9652/hdsp.c	2010-09-20 16:59:09.000000000 -0400
> +++ linux-2.6.35.5/sound/pci/rme9652/hdsp.c	2010-09-25 10:59:42.000000000 -0400
> @@ -4601,6 +4601,8 @@ static int snd_hdsp_hwdep_ioctl(struct s
>  		unsigned long flags;
>  		int i;
>  
> +		memset(&info, 0, sizeof(info));
> +
>  		err = hdsp_check_for_iobox(hdsp);
>  		if (err < 0)
>  			return err;
> diff -urp linux-2.6.35.5.orig/sound/pci/rme9652/hdspm.c linux-2.6.35.5/sound/pci/rme9652/hdspm.c
> --- linux-2.6.35.5.orig/sound/pci/rme9652/hdspm.c	2010-09-20 16:59:09.000000000 -0400
> +++ linux-2.6.35.5/sound/pci/rme9652/hdspm.c	2010-09-25 10:58:44.000000000 -0400
> @@ -4128,6 +4128,9 @@ static int snd_hdspm_hwdep_ioctl(struct 
>  	case SNDRV_HDSPM_IOCTL_GET_CONFIG_INFO:
>  
>  		spin_lock_irq(&hdspm->lock);
> +		
> +		memset(&info, 0, sizeof(info));
> +		
>  		info.pref_sync_ref = hdspm_pref_sync_ref(hdspm);
>  		info.wordclock_sync_check = hdspm_wc_sync_check(hdspm);
>  
> 
> 

      reply	other threads:[~2010-09-25 15:52 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-09-25 15:07 Dan Rosenberg
2010-09-25 15:52 ` Takashi Iwai [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=s5hk4m9kegs.wl%tiwai@suse.de \
    --to=tiwai@suse.de \
    --cc=alsa-devel@alsa-project.org \
    --cc=drosenberg@vsecurity.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=perex@perex.cz \
    --cc=security@kernel.org \
    --cc=stable@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®