public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Takashi Iwai <tiwai@suse.de>
To: Zheyu Ma <zheyuma97@gmail.com>
Cc: Jaroslav Kysela <perex@perex.cz>, Takashi Iwai <tiwai@suse.com>,
	alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] ALSA: control: Fix an out-of-bounds bug in get_ctl_id_hash()
Date: Wed, 24 Aug 2022 11:42:25 +0200	[thread overview]
Message-ID: <87ilmirn9a.wl-tiwai@suse.de> (raw)
In-Reply-To: <20220824081654.3767739-1-zheyuma97@gmail.com>

On Wed, 24 Aug 2022 10:16:54 +0200,
Zheyu Ma wrote:
> 
> Since the user can control the arguments provided to the kernel by the
> ioctl() system call, an out-of-bounds bug occurs when the 'id->name'
> provided by the user does not end with '\0'.
> 
> The following log can reveal it:
> 
> [    10.002313] BUG: KASAN: stack-out-of-bounds in snd_ctl_find_id+0x36c/0x3a0
> [    10.002895] Read of size 1 at addr ffff888109f5fe28 by task snd/439
> [    10.004934] Call Trace:
> [    10.007140]  snd_ctl_find_id+0x36c/0x3a0
> [    10.007489]  snd_ctl_ioctl+0x6cf/0x10e0
> 
> Fix this by checking the bound of 'id->name' in the loop.
> 
> Fixes: c27e1efb61c5 ("ALSA: control: Use xarray for faster lookups")
> Signed-off-by: Zheyu Ma <zheyuma97@gmail.com>

Thanks, applied now.


Takashi

      reply	other threads:[~2022-08-24  9:42 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-24  8:16 [PATCH] ALSA: control: Fix an out-of-bounds bug in get_ctl_id_hash() Zheyu Ma
2022-08-24  9:42 ` 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=87ilmirn9a.wl-tiwai@suse.de \
    --to=tiwai@suse.de \
    --cc=alsa-devel@alsa-project.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=perex@perex.cz \
    --cc=tiwai@suse.com \
    --cc=zheyuma97@gmail.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
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