All of lore.kernel.org
 help / color / mirror / Atom feed
From: Harshit Mogalapalli <harshit.m.mogalapalli@oracle.com>
To: Sasha Levin <sashal@kernel.org>,
	linux-kernel@vger.kernel.org, stable@vger.kernel.org
Cc: Takashi Iwai <tiwai@suse.de>,
	syzbot+78d5b129a762182225aa@syzkaller.appspotmail.com,
	perex@perex.cz, tiwai@suse.com, kl@kl.wtf,
	peter.ujfalusi@linux.intel.com, xristos.thes@gmail.com,
	linux-sound@vger.kernel.org,
	Vegard Nossum <vegard.nossum@oracle.com>
Subject: Re: [PATCH AUTOSEL 5.15 13/13] ALSA: usb: Fix UBSAN warning in parse_audio_unit()
Date: Tue, 17 Dec 2024 11:54:49 +0530	[thread overview]
Message-ID: <92eb4af2-8a38-4075-9353-21afe34d57d9@oracle.com> (raw)
In-Reply-To: <20240728160907.2053634-13-sashal@kernel.org>

Hi Sasha,

On 28/07/24 21:38, Sasha Levin wrote:
> From: Takashi Iwai <tiwai@suse.de>
> 
> [ Upstream commit 2f38cf730caedaeacdefb7ff35b0a3c1168117f9 ]
> 
> A malformed USB descriptor may pass the lengthy mixer description with
> a lot of channels, and this may overflow the 32bit integer shift
> size, as caught by syzbot UBSAN test.  Although this won't cause any
> real trouble, it's better to address.
> 
> This patch introduces a sanity check of the number of channels to bail
> out the parsing when too many channels are found.
> 
> Reported-by: syzbot+78d5b129a762182225aa@syzkaller.appspotmail.com
> Closes: https://lore.kernel.org/0000000000000adac5061d3c7355@google.com
> Link: https://patch.msgid.link/20240715123619.26612-1-tiwai@suse.de
> Signed-off-by: Takashi Iwai <tiwai@suse.de>
> Signed-off-by: Sasha Levin <sashal@kernel.org>

FYI: This 13 patch series and similar AUTOSEL sets for other stable 
kernels didn't go into stable yet.

Thanks,
Harshit

> ---
>   sound/usb/mixer.c | 7 +++++++
>   1 file changed, 7 insertions(+)
> 
> diff --git a/sound/usb/mixer.c b/sound/usb/mixer.c
> index d818eee53c90a..f10634dc118d6 100644
> --- a/sound/usb/mixer.c
> +++ b/sound/usb/mixer.c
> @@ -1985,6 +1985,13 @@ static int parse_audio_feature_unit(struct mixer_build *state, int unitid,
>   		bmaControls = ftr->bmaControls;
>   	}
>   
> +	if (channels > 32) {
> +		usb_audio_info(state->chip,
> +			       "usbmixer: too many channels (%d) in unit %d\n",
> +			       channels, unitid);
> +		return -EINVAL;
> +	}
> +
>   	/* parse the source unit */
>   	err = parse_audio_unit(state, hdr->bSourceID);
>   	if (err < 0)


  reply	other threads:[~2024-12-17  6:25 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-07-28 16:08 [PATCH AUTOSEL 5.15 01/13] PCI: Add ACS quirk for Broadcom BCM5760X NIC Sasha Levin
2024-07-28 16:08 ` [PATCH AUTOSEL 5.15 02/13] PCI: Use preserve_config in place of pci_flags Sasha Levin
2024-07-28 16:08 ` [PATCH AUTOSEL 5.15 03/13] usb: cdns3: Add quirk flag to enable suspend residency Sasha Levin
2024-07-28 16:08 ` [PATCH AUTOSEL 5.15 04/13] usb: dwc2: gadget: Don't write invalid mapped sg entries into dma_desc with iommu enabled Sasha Levin
2024-07-28 16:08 ` [PATCH AUTOSEL 5.15 05/13] usb: typec: ucsi: Fix null pointer dereference in trace Sasha Levin
2024-07-28 16:08 ` [PATCH AUTOSEL 5.15 06/13] MIPS: Loongson64: DTS: Fix msi node for ls7a Sasha Levin
2024-07-28 16:08 ` [PATCH AUTOSEL 5.15 07/13] MIPS: Loongson64: DTS: Fix PCIe port nodes " Sasha Levin
2024-07-28 16:08 ` [PATCH AUTOSEL 5.15 08/13] PCI/AER: Disable AER service on suspend Sasha Levin
2024-07-28 16:08   ` Sasha Levin
2024-07-28 16:08 ` [PATCH AUTOSEL 5.15 09/13] ASoC: Intel: sof_sdw: fix jack detection on ADL-N variant RVP Sasha Levin
2024-07-28 16:08 ` [PATCH AUTOSEL 5.15 10/13] PCI: keystone: Add workaround for Errata #i2037 (AM65x SR 1.0) Sasha Levin
2024-07-28 16:08 ` [PATCH AUTOSEL 5.15 11/13] PCI: vmd: Create domain symlink before pci_bus_add_devices() Sasha Levin
2024-07-28 16:08 ` [PATCH AUTOSEL 5.15 12/13] PCI: Add missing bridge lock to pci_bus_lock() Sasha Levin
2024-07-28 16:08 ` [PATCH AUTOSEL 5.15 13/13] ALSA: usb: Fix UBSAN warning in parse_audio_unit() Sasha Levin
2024-12-17  6:24   ` Harshit Mogalapalli [this message]
2024-12-17 19:15     ` Sasha Levin

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=92eb4af2-8a38-4075-9353-21afe34d57d9@oracle.com \
    --to=harshit.m.mogalapalli@oracle.com \
    --cc=kl@kl.wtf \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-sound@vger.kernel.org \
    --cc=perex@perex.cz \
    --cc=peter.ujfalusi@linux.intel.com \
    --cc=sashal@kernel.org \
    --cc=stable@vger.kernel.org \
    --cc=syzbot+78d5b129a762182225aa@syzkaller.appspotmail.com \
    --cc=tiwai@suse.com \
    --cc=tiwai@suse.de \
    --cc=vegard.nossum@oracle.com \
    --cc=xristos.thes@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.