public inbox for linux-sound@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH AUTOSEL 5.15 09/13] ASoC: Intel: sof_sdw: fix jack detection on ADL-N variant RVP
       [not found] <20240728160907.2053634-1-sashal@kernel.org>
@ 2024-07-28 16:08 ` Sasha Levin
  2024-07-28 16:08 ` [PATCH AUTOSEL 5.15 13/13] ALSA: usb: Fix UBSAN warning in parse_audio_unit() Sasha Levin
  1 sibling, 0 replies; 4+ messages in thread
From: Sasha Levin @ 2024-07-28 16:08 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Pierre-Louis Bossart, Mark Brown, Sasha Levin, cezary.rojewski,
	liam.r.girdwood, peter.ujfalusi, yung-chuan.liao,
	ranjani.sridharan, kai.vehmanen, perex, tiwai, ckeepax,
	alsa-devel, linux-sound

From: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>

[ Upstream commit 65c90df918205bc84f5448550cde76a54dae5f52 ]

Experimental tests show that JD2_100K is required, otherwise the jack
is detected always even with nothing plugged-in.

To avoid matching with other known quirks the SKU information is used.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://patch.msgid.link/20240624121119.91552-2-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 sound/soc/intel/boards/sof_sdw.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/sound/soc/intel/boards/sof_sdw.c b/sound/soc/intel/boards/sof_sdw.c
index 089b6c7994f9a..cfa0c3eaffea7 100644
--- a/sound/soc/intel/boards/sof_sdw.c
+++ b/sound/soc/intel/boards/sof_sdw.c
@@ -258,6 +258,15 @@ static const struct dmi_system_id sof_sdw_quirk_table[] = {
 					SOF_BT_OFFLOAD_SSP(2) |
 					SOF_SSP_BT_OFFLOAD_PRESENT),
 	},
+	{
+		.callback = sof_sdw_quirk_cb,
+		.matches = {
+			DMI_MATCH(DMI_BOARD_VENDOR, "Intel Corporation"),
+			DMI_MATCH(DMI_PRODUCT_SKU, "0000000000070000"),
+		},
+		.driver_data = (void *)(SOF_SDW_TGL_HDMI |
+					RT711_JD2_100K),
+	},
 	{
 		.callback = sof_sdw_quirk_cb,
 		.matches = {
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH AUTOSEL 5.15 13/13] ALSA: usb: Fix UBSAN warning in parse_audio_unit()
       [not found] <20240728160907.2053634-1-sashal@kernel.org>
  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 ` Sasha Levin
  2024-12-17  6:24   ` Harshit Mogalapalli
  1 sibling, 1 reply; 4+ messages in thread
From: Sasha Levin @ 2024-07-28 16:08 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Takashi Iwai, syzbot+78d5b129a762182225aa, Sasha Levin, perex,
	tiwai, kl, peter.ujfalusi, xristos.thes, linux-sound

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>
---
 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)
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH AUTOSEL 5.15 13/13] ALSA: usb: Fix UBSAN warning in parse_audio_unit()
  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
  2024-12-17 19:15     ` Sasha Levin
  0 siblings, 1 reply; 4+ messages in thread
From: Harshit Mogalapalli @ 2024-12-17  6:24 UTC (permalink / raw)
  To: Sasha Levin, linux-kernel, stable
  Cc: Takashi Iwai, syzbot+78d5b129a762182225aa, perex, tiwai, kl,
	peter.ujfalusi, xristos.thes, linux-sound, Vegard Nossum

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)


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH AUTOSEL 5.15 13/13] ALSA: usb: Fix UBSAN warning in parse_audio_unit()
  2024-12-17  6:24   ` Harshit Mogalapalli
@ 2024-12-17 19:15     ` Sasha Levin
  0 siblings, 0 replies; 4+ messages in thread
From: Sasha Levin @ 2024-12-17 19:15 UTC (permalink / raw)
  To: Harshit Mogalapalli
  Cc: linux-kernel, stable, Takashi Iwai, syzbot+78d5b129a762182225aa,
	perex, tiwai, kl, peter.ujfalusi, xristos.thes, linux-sound,
	Vegard Nossum

On Tue, Dec 17, 2024 at 11:54:49AM +0530, Harshit Mogalapalli wrote:
>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.

Huh, thanks for that.

I've tried to look at the history, and I'm quite confused about what's
happening. My scripts must have gone rogue at some point.

-- 
Thanks,
Sasha

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2024-12-17 19:15 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <20240728160907.2053634-1-sashal@kernel.org>
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 13/13] ALSA: usb: Fix UBSAN warning in parse_audio_unit() Sasha Levin
2024-12-17  6:24   ` Harshit Mogalapalli
2024-12-17 19:15     ` Sasha Levin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox