Patch "ALSA: hda: prevent undefined shift in snd_hdac_ext_bus_get_link()" has been added to the 5.4-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: hda: prevent undefined shift in snd_hdac_ext_bus_get_link()

to the 5.4-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-hda-prevent-undefined-shift-in-snd_hdac_ext_bus.patch
and it can be found in the queue-5.4 subdirectory.

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



commit 8d908395c4e841f09230599e2946d9e5ab668c19
Author: Dan Carpenter <dan.carpenter@xxxxxxxxxx>
Date:   Tue Nov 3 13:18:07 2020 +0300

    ALSA: hda: prevent undefined shift in snd_hdac_ext_bus_get_link()
    
    [ Upstream commit 158e1886b6262c1d1c96a18c85fac5219b8bf804 ]
    
    This is harmless, but the "addr" comes from the user and it could lead
    to a negative shift or to shift wrapping if it's too high.
    
    Fixes: 0b00a5615dc4 ("ALSA: hdac_ext: add hdac extended controller")
    Signed-off-by: Dan Carpenter <dan.carpenter@xxxxxxxxxx>
    Link: https://lore.kernel.org/r/20201103101807.GC1127762@mwanda
    Signed-off-by: Takashi Iwai <tiwai@xxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/sound/hda/ext/hdac_ext_controller.c b/sound/hda/ext/hdac_ext_controller.c
index 09ff209df4a30..c87187f635733 100644
--- a/sound/hda/ext/hdac_ext_controller.c
+++ b/sound/hda/ext/hdac_ext_controller.c
@@ -148,6 +148,8 @@ struct hdac_ext_link *snd_hdac_ext_bus_get_link(struct hdac_bus *bus,
 		return NULL;
 	if (bus->idx != bus_idx)
 		return NULL;
+	if (addr < 0 || addr > 31)
+		return NULL;
 
 	list_for_each_entry(hlink, &bus->hlink_list, list) {
 		for (i = 0; i < HDA_MAX_CODECS; i++) {



[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