From: Greg Kroah-Hartman Date: Wed, 9 Oct 2024 13:41:23 +0000 (+0200) Subject: 5.15-stable patches X-Git-Tag: v6.6.55~3 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=2832a520fc36732ca73bc37d1e11ec1de6cf70de;p=thirdparty%2Fkernel%2Fstable-queue.git 5.15-stable patches added patches: alsa-usb-audio-fix-possible-null-pointer-dereference-in-snd_usb_pcm_has_fixed_rate.patch --- diff --git a/queue-5.15/alsa-usb-audio-fix-possible-null-pointer-dereference-in-snd_usb_pcm_has_fixed_rate.patch b/queue-5.15/alsa-usb-audio-fix-possible-null-pointer-dereference-in-snd_usb_pcm_has_fixed_rate.patch new file mode 100644 index 00000000000..a71753329de --- /dev/null +++ b/queue-5.15/alsa-usb-audio-fix-possible-null-pointer-dereference-in-snd_usb_pcm_has_fixed_rate.patch @@ -0,0 +1,40 @@ +From 92a9c0ad86d47ff4cce899012e355c400f02cfb8 Mon Sep 17 00:00:00 2001 +From: Jaroslav Kysela +Date: Fri, 13 Jan 2023 09:53:11 +0100 +Subject: ALSA: usb-audio: Fix possible NULL pointer dereference in snd_usb_pcm_has_fixed_rate() + +From: Jaroslav Kysela + +commit 92a9c0ad86d47ff4cce899012e355c400f02cfb8 upstream. + +The subs function argument may be NULL, so do not use it before the NULL check. + +Fixes: 291e9da91403 ("ALSA: usb-audio: Always initialize fixed_rate in snd_usb_find_implicit_fb_sync_format()") +Reported-by: coverity-bot +Link: https://lore.kernel.org/alsa-devel/202301121424.4A79A485@keescook/ +Signed-off-by: Jaroslav Kysela +Link: https://lore.kernel.org/r/20230113085311.623325-1-perex@perex.cz +Signed-off-by: Takashi Iwai +Signed-off-by: Sasha Levin +Signed-off-by: Harshvardhan Jha +Signed-off-by: Greg Kroah-Hartman +--- + sound/usb/pcm.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +--- a/sound/usb/pcm.c ++++ b/sound/usb/pcm.c +@@ -160,11 +160,12 @@ find_substream_format(struct snd_usb_sub + bool snd_usb_pcm_has_fixed_rate(struct snd_usb_substream *subs) + { + const struct audioformat *fp; +- struct snd_usb_audio *chip = subs->stream->chip; ++ struct snd_usb_audio *chip; + int rate = -1; + + if (!subs) + return false; ++ chip = subs->stream->chip; + if (!(chip->quirk_flags & QUIRK_FLAG_FIXED_RATE)) + return false; + list_for_each_entry(fp, &subs->fmt_list, list) { diff --git a/queue-5.15/series b/queue-5.15/series index 5200611264d..f2edb1aa896 100644 --- a/queue-5.15/series +++ b/queue-5.15/series @@ -589,3 +589,4 @@ ext4-fix-inode-tree-inconsistency-caused-by-enomem.patch vhost-scsi-null-ptr-dereference-in-vhost_scsi_get_req.patch perf-report-fix-segfault-when-sym-sort-key-is-not-used.patch clk-imx6ul-fix-failed-to-get-parent-error.patch +alsa-usb-audio-fix-possible-null-pointer-dereference-in-snd_usb_pcm_has_fixed_rate.patch