Alsa-Devel Archive on lore.kernel.org
 help / color / Atom feed
From: Takashi Iwai <tiwai@suse.de>
To: yangerkun <yangerkun@huawei.com>
Cc: alsa-devel@alsa-project.org, tiwai@suse.com
Subject: Re: [RFC v2] ALSA: control: fix a error handling exist in snd_ctl_elem_add
Date: Tue, 14 Apr 2020 08:54:34 +0200
Message-ID: <s5h4ktmlfpx.wl-tiwai@suse.de> (raw)
In-Reply-To: <20200414065109.6923-1-yangerkun@huawei.com>

On Tue, 14 Apr 2020 08:51:09 +0200,
yangerkun wrote:
> 
> CVE-2020-11725 report that 'count = info->owner' may result a
> SIZE_OVERFLOW. 'info->owner' represent a pid, and actually, we should
> use info->count.
> 
> Signed-off-by: yangerkun <yangerkun@huawei.com>

The CVE report is simply wrong.  info->owner is used intentionally for
this specific API to add a user-space control.  For the normal kernel
kctls, the field is used indeed for storing the pid, but but the
user-space kctl addition API usage is an exception.

You can see the another use of info->count of field in the very same
function at a later point and find it has a different meaning.

The CVE should be disputed.


thanks,

Takashi

> ---
>  sound/core/control.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> v1->v2: reword the patch head
> 
> diff --git a/sound/core/control.c b/sound/core/control.c
> index aa0c0cf182af..c77ca7f39637 100644
> --- a/sound/core/control.c
> +++ b/sound/core/control.c
> @@ -1431,7 +1431,7 @@ static int snd_ctl_elem_add(struct snd_ctl_file *file,
>  		return -ENOMEM;
>  
>  	/* Check the number of elements for this userspace control. */
> -	count = info->owner;
> +	count = info->count;
>  	if (count == 0)
>  		count = 1;
>  
> -- 
> 2.21.1
> 

  reply index

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-14  6:51 yangerkun
2020-04-14  6:54 ` Takashi Iwai [this message]
2020-04-14  9:03   ` yangerkun

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=s5h4ktmlfpx.wl-tiwai@suse.de \
    --to=tiwai@suse.de \
    --cc=alsa-devel@alsa-project.org \
    --cc=tiwai@suse.com \
    --cc=yangerkun@huawei.com \
    /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

Alsa-Devel Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/alsa-devel/0 alsa-devel/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 alsa-devel alsa-devel/ https://lore.kernel.org/alsa-devel \
		alsa-devel@alsa-project.org
	public-inbox-index alsa-devel

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.alsa-project.alsa-devel


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git