Patch "ALSA: usb-audio: fix null pointer dereference on pointer cs_desc" has been added to the 5.15-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    ALSA: usb-audio: fix null pointer dereference on pointer cs_desc

to the 5.15-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     alsa-usb-audio-fix-null-pointer-dereference-on-point.patch
and it can be found in the queue-5.15 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit cf2536e79d3ed64ec8276f43e49fa862f510153f
Author: Chengfeng Ye <cyeaa@xxxxxxxxxxxxxx>
Date:   Sun Oct 24 04:17:36 2021 -0700

    ALSA: usb-audio: fix null pointer dereference on pointer cs_desc
    
    [ Upstream commit b97053df0f04747c3c1e021ecbe99db675342954 ]
    
    The pointer cs_desc return from snd_usb_find_clock_source could
    be null, so there is a potential null pointer dereference issue.
    Fix this by adding a null check before dereference.
    
    Signed-off-by: Chengfeng Ye <cyeaa@xxxxxxxxxxxxxx>
    Link: https://lore.kernel.org/r/20211024111736.11342-1-cyeaa@xxxxxxxxxxxxxx
    Signed-off-by: Takashi Iwai <tiwai@xxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/sound/usb/clock.c b/sound/usb/clock.c
index 81d5ce07d548b..98345a695dccb 100644
--- a/sound/usb/clock.c
+++ b/sound/usb/clock.c
@@ -496,6 +496,10 @@ int snd_usb_set_sample_rate_v2v3(struct snd_usb_audio *chip,
 	union uac23_clock_source_desc *cs_desc;
 
 	cs_desc = snd_usb_find_clock_source(chip, clock, fmt->protocol);
+
+	if (!cs_desc)
+		return 0;
+
 	if (fmt->protocol == UAC_VERSION_3)
 		bmControls = le32_to_cpu(cs_desc->v3.bmControls);
 	else



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux