ALSA: hda: prevent undefined shift in snd_hdac_ext_bus_get_link()
Subsystems (2)
PATCH 1/1 ALSA: hda: prevent undefined shift in snd_hdac_ext_bus_get_link()
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 <[email protected]>
--- sound/hda/ext/hdac_ext_controller.c | 2 ++ 1 file changed, 2 insertions(+)
sound/hda/ext/hdac_ext_controller.c +2 -0
@@ -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++) {
Signature · 1 line
2.28.0
Takashi Iwai
AppliedQuoted 6 lines · Dan Carpenter
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 <[email protected]>
Thanks, applied.
Takashi