The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Takashi Iwai <tiwai@suse.de>
To: Shipei Qu <qu@darknavy.com>
Cc: Jaroslav Kysela <perex@perex.cz>, Takashi Iwai <tiwai@suse.com>,
	alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org,
	vr@darknavy.com
Subject: Re: [PATCH v3] ALSA: usb-mixer: us16x08: validate meter packet indices
Date: Wed, 17 Dec 2025 10:07:27 +0100	[thread overview]
Message-ID: <87y0n1cw8g.wl-tiwai@suse.de> (raw)
In-Reply-To: <20251217024630.59576-1-qu@darknavy.com>

On Wed, 17 Dec 2025 03:46:30 +0100,
Shipei Qu wrote:
> 
> get_meter_levels_from_urb() parses the 64-byte meter packets sent by
> the device and fills the per-channel arrays meter_level[],
> comp_level[] and master_level[] in struct snd_us16x08_meter_store.
> 
> Currently the function derives the channel index directly from the
> meter packet (MUB2(meter_urb, s) - 1) and uses it to index those
> arrays without validating the range. If the packet contains a
> negative or out-of-range channel number, the driver may write past
> the end of these arrays.
> 
> Introduce a local channel variable and validate it before updating the
> arrays. We reject negative indices, limit meter_level[] and
> comp_level[] to SND_US16X08_MAX_CHANNELS, and guard master_level[]
> updates with ARRAY_SIZE(master_level).
> 
> Reported-by: DARKNAVY (@DarkNavyOrg) <vr@darknavy.com>
> Signed-off-by: Shipei Qu <qu@darknavy.com>

Applied now.  Thanks.


Takashi

      reply	other threads:[~2025-12-17  9:07 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-12-16  6:01 [PATCH v2] ALSA: usb-mixer: us16x08: validate meter packet indices Shipei Qu
2025-12-16 10:47 ` Takashi Iwai
2025-12-17  2:46   ` [PATCH v3] " Shipei Qu
2025-12-17  9:07     ` 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=87y0n1cw8g.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=qu@darknavy.com \
    --cc=tiwai@suse.com \
    --cc=vr@darknavy.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