From: Greg Kroah-Hartman Date: Sat, 8 May 2021 11:35:29 +0000 (+0200) Subject: 5.4-stable patches X-Git-Tag: v5.4.118~69 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=1745e2f7efd702094e923dda0024b5fe5253354b;p=thirdparty%2Fkernel%2Fstable-queue.git 5.4-stable patches added patches: alsa-emu8000-fix-a-use-after-free-in-snd_emu8000_create_mixer.patch alsa-hda-conexant-re-order-cx5066-quirk-table-entries.patch alsa-sb-fix-two-use-after-free-in-snd_sb_qsound_build.patch alsa-usb-audio-add-db-range-mapping-for-sennheiser-communications-headset-pc-8.patch alsa-usb-audio-explicitly-set-up-the-clock-selector.patch alsa-usb-audio-more-constifications.patch --- diff --git a/queue-5.4/alsa-emu8000-fix-a-use-after-free-in-snd_emu8000_create_mixer.patch b/queue-5.4/alsa-emu8000-fix-a-use-after-free-in-snd_emu8000_create_mixer.patch new file mode 100644 index 00000000000..1a891a0f883 --- /dev/null +++ b/queue-5.4/alsa-emu8000-fix-a-use-after-free-in-snd_emu8000_create_mixer.patch @@ -0,0 +1,44 @@ +From 1c98f574403dbcf2eb832d5535a10d967333ef2d Mon Sep 17 00:00:00 2001 +From: Lv Yunlong +Date: Mon, 26 Apr 2021 06:11:29 -0700 +Subject: ALSA: emu8000: Fix a use after free in snd_emu8000_create_mixer + +From: Lv Yunlong + +commit 1c98f574403dbcf2eb832d5535a10d967333ef2d upstream. + +Our code analyzer reported a uaf. + +In snd_emu8000_create_mixer, the callee snd_ctl_add(..,emu->controls[i]) +calls snd_ctl_add_replace(.., kcontrol,..). Inside snd_ctl_add_replace(), +if error happens, kcontrol will be freed by snd_ctl_free_one(kcontrol). +Then emu->controls[i] points to a freed memory, and the execution comes +to __error branch of snd_emu8000_create_mixer. The freed emu->controls[i] +is used in snd_ctl_remove(card, emu->controls[i]). + +My patch set emu->controls[i] to NULL if snd_ctl_add() failed to avoid +the uaf. + +Signed-off-by: Lv Yunlong +Cc: +Link: https://lore.kernel.org/r/20210426131129.4796-1-lyl2019@mail.ustc.edu.cn +Signed-off-by: Takashi Iwai +Signed-off-by: Greg Kroah-Hartman +--- + sound/isa/sb/emu8000.c | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +--- a/sound/isa/sb/emu8000.c ++++ b/sound/isa/sb/emu8000.c +@@ -1029,8 +1029,10 @@ snd_emu8000_create_mixer(struct snd_card + + memset(emu->controls, 0, sizeof(emu->controls)); + for (i = 0; i < EMU8000_NUM_CONTROLS; i++) { +- if ((err = snd_ctl_add(card, emu->controls[i] = snd_ctl_new1(mixer_defs[i], emu))) < 0) ++ if ((err = snd_ctl_add(card, emu->controls[i] = snd_ctl_new1(mixer_defs[i], emu))) < 0) { ++ emu->controls[i] = NULL; + goto __error; ++ } + } + return 0; + diff --git a/queue-5.4/alsa-hda-conexant-re-order-cx5066-quirk-table-entries.patch b/queue-5.4/alsa-hda-conexant-re-order-cx5066-quirk-table-entries.patch new file mode 100644 index 00000000000..51b630a0056 --- /dev/null +++ b/queue-5.4/alsa-hda-conexant-re-order-cx5066-quirk-table-entries.patch @@ -0,0 +1,51 @@ +From 2e6a731296be9d356fdccee9fb6ae345dad96438 Mon Sep 17 00:00:00 2001 +From: Takashi Iwai +Date: Wed, 28 Apr 2021 13:27:04 +0200 +Subject: ALSA: hda/conexant: Re-order CX5066 quirk table entries + +From: Takashi Iwai + +commit 2e6a731296be9d356fdccee9fb6ae345dad96438 upstream. + +Just re-order the cx5066_fixups[] entries for HP devices for avoiding +the oversight of the duplicated or unapplied item in future. +No functional changes. + +Also Cc-to-stable for the further patch applications. + +Cc: +Link: https://lore.kernel.org/r/20210428112704.23967-14-tiwai@suse.de +Signed-off-by: Takashi Iwai +Signed-off-by: Greg Kroah-Hartman +--- + sound/pci/hda/patch_conexant.c | 14 +++++++------- + 1 file changed, 7 insertions(+), 7 deletions(-) + +--- a/sound/pci/hda/patch_conexant.c ++++ b/sound/pci/hda/patch_conexant.c +@@ -898,18 +898,18 @@ static const struct snd_pci_quirk cxt506 + SND_PCI_QUIRK(0x103c, 0x8079, "HP EliteBook 840 G3", CXT_FIXUP_HP_DOCK), + SND_PCI_QUIRK(0x103c, 0x807C, "HP EliteBook 820 G3", CXT_FIXUP_HP_DOCK), + SND_PCI_QUIRK(0x103c, 0x80FD, "HP ProBook 640 G2", CXT_FIXUP_HP_DOCK), +- SND_PCI_QUIRK(0x103c, 0x828c, "HP EliteBook 840 G4", CXT_FIXUP_HP_DOCK), +- SND_PCI_QUIRK(0x103c, 0x83b2, "HP EliteBook 840 G5", CXT_FIXUP_HP_DOCK), +- SND_PCI_QUIRK(0x103c, 0x83b3, "HP EliteBook 830 G5", CXT_FIXUP_HP_DOCK), +- SND_PCI_QUIRK(0x103c, 0x83d3, "HP ProBook 640 G4", CXT_FIXUP_HP_DOCK), +- SND_PCI_QUIRK(0x103c, 0x8174, "HP Spectre x360", CXT_FIXUP_HP_SPECTRE), + SND_PCI_QUIRK(0x103c, 0x8115, "HP Z1 Gen3", CXT_FIXUP_HP_GATE_MIC), + SND_PCI_QUIRK(0x103c, 0x814f, "HP ZBook 15u G3", CXT_FIXUP_MUTE_LED_GPIO), ++ SND_PCI_QUIRK(0x103c, 0x8174, "HP Spectre x360", CXT_FIXUP_HP_SPECTRE), + SND_PCI_QUIRK(0x103c, 0x822e, "HP ProBook 440 G4", CXT_FIXUP_MUTE_LED_GPIO), +- SND_PCI_QUIRK(0x103c, 0x836e, "HP ProBook 455 G5", CXT_FIXUP_MUTE_LED_GPIO), +- SND_PCI_QUIRK(0x103c, 0x837f, "HP ProBook 470 G5", CXT_FIXUP_MUTE_LED_GPIO), ++ SND_PCI_QUIRK(0x103c, 0x828c, "HP EliteBook 840 G4", CXT_FIXUP_HP_DOCK), + SND_PCI_QUIRK(0x103c, 0x8299, "HP 800 G3 SFF", CXT_FIXUP_HP_MIC_NO_PRESENCE), + SND_PCI_QUIRK(0x103c, 0x829a, "HP 800 G3 DM", CXT_FIXUP_HP_MIC_NO_PRESENCE), ++ SND_PCI_QUIRK(0x103c, 0x836e, "HP ProBook 455 G5", CXT_FIXUP_MUTE_LED_GPIO), ++ SND_PCI_QUIRK(0x103c, 0x837f, "HP ProBook 470 G5", CXT_FIXUP_MUTE_LED_GPIO), ++ SND_PCI_QUIRK(0x103c, 0x83b2, "HP EliteBook 840 G5", CXT_FIXUP_HP_DOCK), ++ SND_PCI_QUIRK(0x103c, 0x83b3, "HP EliteBook 830 G5", CXT_FIXUP_HP_DOCK), ++ SND_PCI_QUIRK(0x103c, 0x83d3, "HP ProBook 640 G4", CXT_FIXUP_HP_DOCK), + SND_PCI_QUIRK(0x103c, 0x8402, "HP ProBook 645 G4", CXT_FIXUP_MUTE_LED_GPIO), + SND_PCI_QUIRK(0x103c, 0x8455, "HP Z2 G4", CXT_FIXUP_HP_MIC_NO_PRESENCE), + SND_PCI_QUIRK(0x103c, 0x8456, "HP Z2 G4 SFF", CXT_FIXUP_HP_MIC_NO_PRESENCE), diff --git a/queue-5.4/alsa-sb-fix-two-use-after-free-in-snd_sb_qsound_build.patch b/queue-5.4/alsa-sb-fix-two-use-after-free-in-snd_sb_qsound_build.patch new file mode 100644 index 00000000000..0a86362ad46 --- /dev/null +++ b/queue-5.4/alsa-sb-fix-two-use-after-free-in-snd_sb_qsound_build.patch @@ -0,0 +1,50 @@ +From 4fb44dd2c1dda18606348acdfdb97e8759dde9df Mon Sep 17 00:00:00 2001 +From: Lv Yunlong +Date: Mon, 26 Apr 2021 07:55:41 -0700 +Subject: ALSA: sb: Fix two use after free in snd_sb_qsound_build + +From: Lv Yunlong + +commit 4fb44dd2c1dda18606348acdfdb97e8759dde9df upstream. + +In snd_sb_qsound_build, snd_ctl_add(..,p->qsound_switch...) and +snd_ctl_add(..,p->qsound_space..) are called. But the second +arguments of snd_ctl_add() could be freed via snd_ctl_add_replace() +->snd_ctl_free_one(). After the error code is returned, +snd_sb_qsound_destroy(p) is called in __error branch. + +But in snd_sb_qsound_destroy(), the freed p->qsound_switch and +p->qsound_space are still used by snd_ctl_remove(). + +My patch set p->qsound_switch and p->qsound_space to NULL if +snd_ctl_add() failed to avoid the uaf bugs. But these codes need +to further be improved with the code style. + +Signed-off-by: Lv Yunlong +Cc: +Link: https://lore.kernel.org/r/20210426145541.8070-1-lyl2019@mail.ustc.edu.cn +Signed-off-by: Takashi Iwai +Signed-off-by: Greg Kroah-Hartman +--- + sound/isa/sb/sb16_csp.c | 8 ++++++-- + 1 file changed, 6 insertions(+), 2 deletions(-) + +--- a/sound/isa/sb/sb16_csp.c ++++ b/sound/isa/sb/sb16_csp.c +@@ -1045,10 +1045,14 @@ static int snd_sb_qsound_build(struct sn + + spin_lock_init(&p->q_lock); + +- if ((err = snd_ctl_add(card, p->qsound_switch = snd_ctl_new1(&snd_sb_qsound_switch, p))) < 0) ++ if ((err = snd_ctl_add(card, p->qsound_switch = snd_ctl_new1(&snd_sb_qsound_switch, p))) < 0) { ++ p->qsound_switch = NULL; + goto __error; +- if ((err = snd_ctl_add(card, p->qsound_space = snd_ctl_new1(&snd_sb_qsound_space, p))) < 0) ++ } ++ if ((err = snd_ctl_add(card, p->qsound_space = snd_ctl_new1(&snd_sb_qsound_space, p))) < 0) { ++ p->qsound_space = NULL; + goto __error; ++ } + + return 0; + diff --git a/queue-5.4/alsa-usb-audio-add-db-range-mapping-for-sennheiser-communications-headset-pc-8.patch b/queue-5.4/alsa-usb-audio-add-db-range-mapping-for-sennheiser-communications-headset-pc-8.patch new file mode 100644 index 00000000000..70edb39ac39 --- /dev/null +++ b/queue-5.4/alsa-usb-audio-add-db-range-mapping-for-sennheiser-communications-headset-pc-8.patch @@ -0,0 +1,53 @@ +From ab2165e2e6ed17345ffa8ee88ca764e8788ebcd7 Mon Sep 17 00:00:00 2001 +From: Timo Gurr +Date: Mon, 3 May 2021 13:08:22 +0200 +Subject: ALSA: usb-audio: Add dB range mapping for Sennheiser Communications Headset PC 8 + +From: Timo Gurr + +commit ab2165e2e6ed17345ffa8ee88ca764e8788ebcd7 upstream. + +The decibel volume range contains a negative maximum value resulting in +pipewire complaining about the device and effectivly having no sound +output. The wrong values also resulted in the headset sounding muted +already at a mixer level of about ~25%. + +PipeWire BugLink: https://gitlab.freedesktop.org/pipewire/pipewire/-/issues/1049 + +BugLink: https://bugzilla.kernel.org/show_bug.cgi?id=212897 +Signed-off-by: Timo Gurr +Cc: +Link: https://lore.kernel.org/r/20210503110822.10222-1-tiwai@suse.de +Signed-off-by: Takashi Iwai +Signed-off-by: Greg Kroah-Hartman +--- + sound/usb/mixer_maps.c | 12 ++++++++++++ + 1 file changed, 12 insertions(+) + +--- a/sound/usb/mixer_maps.c ++++ b/sound/usb/mixer_maps.c +@@ -337,6 +337,13 @@ static struct usbmix_name_map bose_compa + { 0 } /* terminator */ + }; + ++/* Sennheiser Communications Headset [PC 8], the dB value is reported as -6 negative maximum */ ++static const struct usbmix_dB_map sennheiser_pc8_dB = {-9500, 0}; ++static const struct usbmix_name_map sennheiser_pc8_map[] = { ++ { 9, NULL, .dB = &sennheiser_pc8_dB }, ++ { 0 } /* terminator */ ++}; ++ + /* + * Dell usb dock with ALC4020 codec had a firmware problem where it got + * screwed up when zero volume is passed; just skip it as a workaround +@@ -619,5 +626,10 @@ static struct usbmix_ctl_map uac3_badd_u + .id = UAC3_FUNCTION_SUBCLASS_SPEAKERPHONE, + .map = uac3_badd_speakerphone_map, + }, ++ { ++ /* Sennheiser Communications Headset [PC 8] */ ++ .id = USB_ID(0x1395, 0x0025), ++ .map = sennheiser_pc8_map, ++ }, + { 0 } /* terminator */ + }; diff --git a/queue-5.4/alsa-usb-audio-explicitly-set-up-the-clock-selector.patch b/queue-5.4/alsa-usb-audio-explicitly-set-up-the-clock-selector.patch new file mode 100644 index 00000000000..b5e705d17e4 --- /dev/null +++ b/queue-5.4/alsa-usb-audio-explicitly-set-up-the-clock-selector.patch @@ -0,0 +1,86 @@ +From d2e8f641257d0d3af6e45d6ac2d6f9d56b8ea964 Mon Sep 17 00:00:00 2001 +From: Takashi Iwai +Date: Tue, 13 Apr 2021 10:41:52 +0200 +Subject: ALSA: usb-audio: Explicitly set up the clock selector + +From: Takashi Iwai + +commit d2e8f641257d0d3af6e45d6ac2d6f9d56b8ea964 upstream. + +In the current code, we have some assumption that the audio clock +selector has been set up implicitly and don't want to touch it unless +it's really needed for the fallback autoclock setup. This works for +most devices but some seem having a problem. Partially this was +covered for the devices with a single connector at the initialization +phase (commit 086b957cc17f "ALSA: usb-audio: Skip the clock selector +inquiry for single connections"), but also there are cases where the +wrong clock set up is kept silently. The latter seems to be the cause +of the noises on Behringer devices. + +In this patch, we explicitly set up the audio clock selector whenever +the appropriate node is found. + +Reported-by: Geraldo Nascimento +BugLink: https://bugzilla.kernel.org/show_bug.cgi?id=199327 +Link: https://lore.kernel.org/r/CAEsQvcvF7LnO8PxyyCxuRCx=7jNeSCvFAd-+dE0g_rd1rOxxdw@mail.gmail.com +Cc: +Link: https://lore.kernel.org/r/20210413084152.32325-1-tiwai@suse.de +Signed-off-by: Takashi Iwai +Signed-off-by: Greg Kroah-Hartman +--- + sound/usb/clock.c | 18 ++++++++++++++---- + 1 file changed, 14 insertions(+), 4 deletions(-) + +--- a/sound/usb/clock.c ++++ b/sound/usb/clock.c +@@ -296,7 +296,7 @@ static int __uac_clock_find_source(struc + + selector = snd_usb_find_clock_selector(chip->ctrl_intf, entity_id); + if (selector) { +- int ret, i, cur; ++ int ret, i, cur, err; + + /* the entity ID we are looking for is a selector. + * find out what it currently selects */ +@@ -318,13 +318,17 @@ static int __uac_clock_find_source(struc + ret = __uac_clock_find_source(chip, fmt, + selector->baCSourceID[ret - 1], + visited, validate); ++ if (ret > 0) { ++ err = uac_clock_selector_set_val(chip, entity_id, cur); ++ if (err < 0) ++ return err; ++ } ++ + if (!validate || ret > 0 || !chip->autoclock) + return ret; + + /* The current clock source is invalid, try others. */ + for (i = 1; i <= selector->bNrInPins; i++) { +- int err; +- + if (i == cur) + continue; + +@@ -390,7 +394,7 @@ static int __uac3_clock_find_source(stru + + selector = snd_usb_find_clock_selector_v3(chip->ctrl_intf, entity_id); + if (selector) { +- int ret, i, cur; ++ int ret, i, cur, err; + + /* the entity ID we are looking for is a selector. + * find out what it currently selects */ +@@ -412,6 +416,12 @@ static int __uac3_clock_find_source(stru + ret = __uac3_clock_find_source(chip, fmt, + selector->baCSourceID[ret - 1], + visited, validate); ++ if (ret > 0) { ++ err = uac_clock_selector_set_val(chip, entity_id, cur); ++ if (err < 0) ++ return err; ++ } ++ + if (!validate || ret > 0 || !chip->autoclock) + return ret; + diff --git a/queue-5.4/alsa-usb-audio-more-constifications.patch b/queue-5.4/alsa-usb-audio-more-constifications.patch new file mode 100644 index 00000000000..2c688fbdfa5 --- /dev/null +++ b/queue-5.4/alsa-usb-audio-more-constifications.patch @@ -0,0 +1,598 @@ +From a01df925d1bbc97d6f7fe07b157aadb565315337 Mon Sep 17 00:00:00 2001 +From: Takashi Iwai +Date: Sun, 5 Jan 2020 15:47:26 +0100 +Subject: ALSA: usb-audio: More constifications + +From: Takashi Iwai + +commit a01df925d1bbc97d6f7fe07b157aadb565315337 upstream. + +Apply const prefix to the remaining places: the static table for the +unit information, the mixer maps, the validator tables, etc. + +Just for minor optimization and no functional changes. + +Link: https://lore.kernel.org/r/20200105144823.29547-12-tiwai@suse.de +Signed-off-by: Takashi Iwai +Signed-off-by: Greg Kroah-Hartman +--- + sound/usb/mixer.c | 60 ++++++++++++++++++++++----------------------- + sound/usb/mixer_maps.c | 56 +++++++++++++++++++++--------------------- + sound/usb/mixer_quirks.c | 6 ++-- + sound/usb/mixer_scarlett.c | 14 +++++----- + sound/usb/proc.c | 2 - + sound/usb/stream.c | 4 +-- + sound/usb/validate.c | 4 +-- + 7 files changed, 73 insertions(+), 73 deletions(-) + +--- a/sound/usb/mixer.c ++++ b/sound/usb/mixer.c +@@ -1030,7 +1030,7 @@ struct usb_feature_control_info { + int type_uac2; /* data type for uac2 if different from uac1, else -1 */ + }; + +-static struct usb_feature_control_info audio_feature_info[] = { ++static const struct usb_feature_control_info audio_feature_info[] = { + { UAC_FU_MUTE, "Mute", USB_MIXER_INV_BOOLEAN, -1 }, + { UAC_FU_VOLUME, "Volume", USB_MIXER_S16, -1 }, + { UAC_FU_BASS, "Tone Control - Bass", USB_MIXER_S8, -1 }, +@@ -1544,7 +1544,7 @@ static void check_no_speaker_on_headset( + strlcpy(kctl->id.name, "Headphone", sizeof(kctl->id.name)); + } + +-static struct usb_feature_control_info *get_feature_control_info(int control) ++static const struct usb_feature_control_info *get_feature_control_info(int control) + { + int i; + +@@ -1562,7 +1562,7 @@ static void __build_feature_ctl(struct u + struct usb_audio_term *oterm, + int unitid, int nameid, int readonly_mask) + { +- struct usb_feature_control_info *ctl_info; ++ const struct usb_feature_control_info *ctl_info; + unsigned int len = 0; + int mapped_name = 0; + struct snd_kcontrol *kctl; +@@ -2237,7 +2237,7 @@ static const struct snd_kcontrol_new mix + */ + struct procunit_value_info { + int control; +- char *suffix; ++ const char *suffix; + int val_type; + int min_value; + }; +@@ -2245,44 +2245,44 @@ struct procunit_value_info { + struct procunit_info { + int type; + char *name; +- struct procunit_value_info *values; ++ const struct procunit_value_info *values; + }; + +-static struct procunit_value_info undefined_proc_info[] = { ++static const struct procunit_value_info undefined_proc_info[] = { + { 0x00, "Control Undefined", 0 }, + { 0 } + }; + +-static struct procunit_value_info updown_proc_info[] = { ++static const struct procunit_value_info updown_proc_info[] = { + { UAC_UD_ENABLE, "Switch", USB_MIXER_BOOLEAN }, + { UAC_UD_MODE_SELECT, "Mode Select", USB_MIXER_U8, 1 }, + { 0 } + }; +-static struct procunit_value_info prologic_proc_info[] = { ++static const struct procunit_value_info prologic_proc_info[] = { + { UAC_DP_ENABLE, "Switch", USB_MIXER_BOOLEAN }, + { UAC_DP_MODE_SELECT, "Mode Select", USB_MIXER_U8, 1 }, + { 0 } + }; +-static struct procunit_value_info threed_enh_proc_info[] = { ++static const struct procunit_value_info threed_enh_proc_info[] = { + { UAC_3D_ENABLE, "Switch", USB_MIXER_BOOLEAN }, + { UAC_3D_SPACE, "Spaciousness", USB_MIXER_U8 }, + { 0 } + }; +-static struct procunit_value_info reverb_proc_info[] = { ++static const struct procunit_value_info reverb_proc_info[] = { + { UAC_REVERB_ENABLE, "Switch", USB_MIXER_BOOLEAN }, + { UAC_REVERB_LEVEL, "Level", USB_MIXER_U8 }, + { UAC_REVERB_TIME, "Time", USB_MIXER_U16 }, + { UAC_REVERB_FEEDBACK, "Feedback", USB_MIXER_U8 }, + { 0 } + }; +-static struct procunit_value_info chorus_proc_info[] = { ++static const struct procunit_value_info chorus_proc_info[] = { + { UAC_CHORUS_ENABLE, "Switch", USB_MIXER_BOOLEAN }, + { UAC_CHORUS_LEVEL, "Level", USB_MIXER_U8 }, + { UAC_CHORUS_RATE, "Rate", USB_MIXER_U16 }, + { UAC_CHORUS_DEPTH, "Depth", USB_MIXER_U16 }, + { 0 } + }; +-static struct procunit_value_info dcr_proc_info[] = { ++static const struct procunit_value_info dcr_proc_info[] = { + { UAC_DCR_ENABLE, "Switch", USB_MIXER_BOOLEAN }, + { UAC_DCR_RATE, "Ratio", USB_MIXER_U16 }, + { UAC_DCR_MAXAMPL, "Max Amp", USB_MIXER_S16 }, +@@ -2292,7 +2292,7 @@ static struct procunit_value_info dcr_pr + { 0 } + }; + +-static struct procunit_info procunits[] = { ++static const struct procunit_info procunits[] = { + { UAC_PROCESS_UP_DOWNMIX, "Up Down", updown_proc_info }, + { UAC_PROCESS_DOLBY_PROLOGIC, "Dolby Prologic", prologic_proc_info }, + { UAC_PROCESS_STEREO_EXTENDER, "3D Stereo Extender", threed_enh_proc_info }, +@@ -2302,16 +2302,16 @@ static struct procunit_info procunits[] + { 0 }, + }; + +-static struct procunit_value_info uac3_updown_proc_info[] = { ++static const struct procunit_value_info uac3_updown_proc_info[] = { + { UAC3_UD_MODE_SELECT, "Mode Select", USB_MIXER_U8, 1 }, + { 0 } + }; +-static struct procunit_value_info uac3_stereo_ext_proc_info[] = { ++static const struct procunit_value_info uac3_stereo_ext_proc_info[] = { + { UAC3_EXT_WIDTH_CONTROL, "Width Control", USB_MIXER_U8 }, + { 0 } + }; + +-static struct procunit_info uac3_procunits[] = { ++static const struct procunit_info uac3_procunits[] = { + { UAC3_PROCESS_UP_DOWNMIX, "Up Down", uac3_updown_proc_info }, + { UAC3_PROCESS_STEREO_EXTENDER, "3D Stereo Extender", uac3_stereo_ext_proc_info }, + { UAC3_PROCESS_MULTI_FUNCTION, "Multi-Function", undefined_proc_info }, +@@ -2321,23 +2321,23 @@ static struct procunit_info uac3_procuni + /* + * predefined data for extension units + */ +-static struct procunit_value_info clock_rate_xu_info[] = { ++static const struct procunit_value_info clock_rate_xu_info[] = { + { USB_XU_CLOCK_RATE_SELECTOR, "Selector", USB_MIXER_U8, 0 }, + { 0 } + }; +-static struct procunit_value_info clock_source_xu_info[] = { ++static const struct procunit_value_info clock_source_xu_info[] = { + { USB_XU_CLOCK_SOURCE_SELECTOR, "External", USB_MIXER_BOOLEAN }, + { 0 } + }; +-static struct procunit_value_info spdif_format_xu_info[] = { ++static const struct procunit_value_info spdif_format_xu_info[] = { + { USB_XU_DIGITAL_FORMAT_SELECTOR, "SPDIF/AC3", USB_MIXER_BOOLEAN }, + { 0 } + }; +-static struct procunit_value_info soft_limit_xu_info[] = { ++static const struct procunit_value_info soft_limit_xu_info[] = { + { USB_XU_SOFT_LIMIT_SELECTOR, " ", USB_MIXER_BOOLEAN }, + { 0 } + }; +-static struct procunit_info extunits[] = { ++static const struct procunit_info extunits[] = { + { USB_XU_CLOCK_RATE, "Clock rate", clock_rate_xu_info }, + { USB_XU_CLOCK_SOURCE, "DigitalIn CLK source", clock_source_xu_info }, + { USB_XU_DIGITAL_IO_STATUS, "DigitalOut format:", spdif_format_xu_info }, +@@ -2349,7 +2349,7 @@ static struct procunit_info extunits[] = + * build a processing/extension unit + */ + static int build_audio_procunit(struct mixer_build *state, int unitid, +- void *raw_desc, struct procunit_info *list, ++ void *raw_desc, const struct procunit_info *list, + bool extension_unit) + { + struct uac_processing_unit_descriptor *desc = raw_desc; +@@ -2357,14 +2357,14 @@ static int build_audio_procunit(struct m + struct usb_mixer_elem_info *cval; + struct snd_kcontrol *kctl; + int i, err, nameid, type, len; +- struct procunit_info *info; +- struct procunit_value_info *valinfo; ++ const struct procunit_info *info; ++ const struct procunit_value_info *valinfo; + const struct usbmix_name_map *map; +- static struct procunit_value_info default_value_info[] = { ++ static const struct procunit_value_info default_value_info[] = { + { 0x01, "Switch", USB_MIXER_BOOLEAN }, + { 0 } + }; +- static struct procunit_info default_info = { ++ static const struct procunit_info default_info = { + 0, NULL, default_value_info + }; + const char *name = extension_unit ? +@@ -2842,7 +2842,7 @@ struct uac3_badd_profile { + int st_chmask; /* side tone mixing channel mask */ + }; + +-static struct uac3_badd_profile uac3_badd_profiles[] = { ++static const struct uac3_badd_profile uac3_badd_profiles[] = { + { + /* + * BAIF, BAOF or combination of both +@@ -2903,7 +2903,7 @@ static struct uac3_badd_profile uac3_bad + }; + + static bool uac3_badd_func_has_valid_channels(struct usb_mixer_interface *mixer, +- struct uac3_badd_profile *f, ++ const struct uac3_badd_profile *f, + int c_chmask, int p_chmask) + { + /* +@@ -2947,7 +2947,7 @@ static int snd_usb_mixer_controls_badd(s + struct usb_device *dev = mixer->chip->dev; + struct usb_interface_assoc_descriptor *assoc; + int badd_profile = mixer->chip->badd_profile; +- struct uac3_badd_profile *f; ++ const struct uac3_badd_profile *f; + const struct usbmix_ctl_map *map; + int p_chmask = 0, c_chmask = 0, st_chmask = 0; + int i; +@@ -3241,7 +3241,7 @@ static void snd_usb_mixer_dump_cval(stru + struct usb_mixer_elem_list *list) + { + struct usb_mixer_elem_info *cval = mixer_elem_list_to_info(list); +- static char *val_types[] = {"BOOLEAN", "INV_BOOLEAN", ++ static const char * const val_types[] = {"BOOLEAN", "INV_BOOLEAN", + "S8", "U8", "S16", "U16"}; + snd_iprintf(buffer, " Info: id=%i, control=%i, cmask=0x%x, " + "channels=%i, type=\"%s\"\n", cval->head.id, +--- a/sound/usb/mixer_maps.c ++++ b/sound/usb/mixer_maps.c +@@ -14,7 +14,7 @@ struct usbmix_name_map { + int id; + const char *name; + int control; +- struct usbmix_dB_map *dB; ++ const struct usbmix_dB_map *dB; + }; + + struct usbmix_selector_map { +@@ -53,7 +53,7 @@ Mic-IN[9] --+->FU[10]------------------- + ++--+->SU[11]-->FU[12] --------------------------------------------------------------------------------------> USB_OUT[13] + */ + +-static struct usbmix_name_map extigy_map[] = { ++static const struct usbmix_name_map extigy_map[] = { + /* 1: IT pcm */ + { 2, "PCM Playback" }, /* FU */ + /* 3: IT pcm */ +@@ -94,12 +94,12 @@ static struct usbmix_name_map extigy_map + * e.g. no Master and fake PCM volume + * Pavel Mihaylov + */ +-static struct usbmix_dB_map mp3plus_dB_1 = {.min = -4781, .max = 0}; ++static const struct usbmix_dB_map mp3plus_dB_1 = {.min = -4781, .max = 0}; + /* just guess */ +-static struct usbmix_dB_map mp3plus_dB_2 = {.min = -1781, .max = 618}; ++static const struct usbmix_dB_map mp3plus_dB_2 = {.min = -1781, .max = 618}; + /* just guess */ + +-static struct usbmix_name_map mp3plus_map[] = { ++static const struct usbmix_name_map mp3plus_map[] = { + /* 1: IT pcm */ + /* 2: IT mic */ + /* 3: IT line */ +@@ -140,7 +140,7 @@ Lin_IN[7]-+--->FU[8]---+ +- + | ^ + +->FU[13]--------------------------------------+ + */ +-static struct usbmix_name_map audigy2nx_map[] = { ++static const struct usbmix_name_map audigy2nx_map[] = { + /* 1: IT pcm playback */ + /* 4: IT digital in */ + { 6, "Digital In Playback" }, /* FU */ +@@ -168,12 +168,12 @@ static struct usbmix_name_map audigy2nx_ + { 0 } /* terminator */ + }; + +-static struct usbmix_name_map mbox1_map[] = { ++static const struct usbmix_name_map mbox1_map[] = { + { 1, "Clock" }, + { 0 } /* terminator */ + }; + +-static struct usbmix_selector_map c400_selectors[] = { ++static const struct usbmix_selector_map c400_selectors[] = { + { + .id = 0x80, + .count = 2, +@@ -182,7 +182,7 @@ static struct usbmix_selector_map c400_s + { 0 } /* terminator */ + }; + +-static struct usbmix_selector_map audigy2nx_selectors[] = { ++static const struct usbmix_selector_map audigy2nx_selectors[] = { + { + .id = 14, /* Capture Source */ + .count = 3, +@@ -202,21 +202,21 @@ static struct usbmix_selector_map audigy + }; + + /* Creative SoundBlaster Live! 24-bit External */ +-static struct usbmix_name_map live24ext_map[] = { ++static const struct usbmix_name_map live24ext_map[] = { + /* 2: PCM Playback Volume */ + { 5, "Mic Capture" }, /* FU, default PCM Capture Volume */ + { 0 } /* terminator */ + }; + + /* LineX FM Transmitter entry - needed to bypass controls bug */ +-static struct usbmix_name_map linex_map[] = { ++static const struct usbmix_name_map linex_map[] = { + /* 1: IT pcm */ + /* 2: OT Speaker */ + { 3, "Master" }, /* FU: master volume - left / right / mute */ + { 0 } /* terminator */ + }; + +-static struct usbmix_name_map maya44_map[] = { ++static const struct usbmix_name_map maya44_map[] = { + /* 1: IT line */ + { 2, "Line Playback" }, /* FU */ + /* 3: IT line */ +@@ -239,7 +239,7 @@ static struct usbmix_name_map maya44_map + * so this map removes all unwanted sliders from alsamixer + */ + +-static struct usbmix_name_map justlink_map[] = { ++static const struct usbmix_name_map justlink_map[] = { + /* 1: IT pcm playback */ + /* 2: Not present */ + { 3, NULL}, /* IT mic (No mic input on device) */ +@@ -256,7 +256,7 @@ static struct usbmix_name_map justlink_m + }; + + /* TerraTec Aureon 5.1 MkII USB */ +-static struct usbmix_name_map aureon_51_2_map[] = { ++static const struct usbmix_name_map aureon_51_2_map[] = { + /* 1: IT USB */ + /* 2: IT Mic */ + /* 3: IT Line */ +@@ -275,7 +275,7 @@ static struct usbmix_name_map aureon_51_ + {} /* terminator */ + }; + +-static struct usbmix_name_map scratch_live_map[] = { ++static const struct usbmix_name_map scratch_live_map[] = { + /* 1: IT Line 1 (USB streaming) */ + /* 2: OT Line 1 (Speaker) */ + /* 3: IT Line 1 (Line connector) */ +@@ -291,7 +291,7 @@ static struct usbmix_name_map scratch_li + { 0 } /* terminator */ + }; + +-static struct usbmix_name_map ebox44_map[] = { ++static const struct usbmix_name_map ebox44_map[] = { + { 4, NULL }, /* FU */ + { 6, NULL }, /* MU */ + { 7, NULL }, /* FU */ +@@ -306,7 +306,7 @@ static struct usbmix_name_map ebox44_map + * FIXME: or mp3plus_map should use "Capture Source" too, + * so this maps can be merget + */ +-static struct usbmix_name_map hercules_usb51_map[] = { ++static const struct usbmix_name_map hercules_usb51_map[] = { + { 8, "Capture Source" }, /* SU, default "PCM Capture Source" */ + { 9, "Master Playback" }, /* FU, default "Speaker Playback" */ + { 10, "Mic Boost", 7 }, /* FU, default "Auto Gain Input" */ +@@ -317,7 +317,7 @@ static struct usbmix_name_map hercules_u + }; + + /* Plantronics Gamecom 780 has a broken volume control, better to disable it */ +-static struct usbmix_name_map gamecom780_map[] = { ++static const struct usbmix_name_map gamecom780_map[] = { + { 9, NULL }, /* FU, speaker out */ + {} + }; +@@ -331,8 +331,8 @@ static const struct usbmix_name_map scms + }; + + /* Bose companion 5, the dB conversion factor is 16 instead of 256 */ +-static struct usbmix_dB_map bose_companion5_dB = {-5006, -6}; +-static struct usbmix_name_map bose_companion5_map[] = { ++static const struct usbmix_dB_map bose_companion5_dB = {-5006, -6}; ++static const struct usbmix_name_map bose_companion5_map[] = { + { 3, NULL, .dB = &bose_companion5_dB }, + { 0 } /* terminator */ + }; +@@ -406,7 +406,7 @@ static const struct usbmix_name_map aoru + * Control map entries + */ + +-static struct usbmix_ctl_map usbmix_ctl_maps[] = { ++static const struct usbmix_ctl_map usbmix_ctl_maps[] = { + { + .id = USB_ID(0x041e, 0x3000), + .map = extigy_map, +@@ -560,37 +560,37 @@ static struct usbmix_ctl_map usbmix_ctl_ + * Control map entries for UAC3 BADD profiles + */ + +-static struct usbmix_name_map uac3_badd_generic_io_map[] = { ++static const struct usbmix_name_map uac3_badd_generic_io_map[] = { + { UAC3_BADD_FU_ID2, "Generic Out Playback" }, + { UAC3_BADD_FU_ID5, "Generic In Capture" }, + { 0 } /* terminator */ + }; +-static struct usbmix_name_map uac3_badd_headphone_map[] = { ++static const struct usbmix_name_map uac3_badd_headphone_map[] = { + { UAC3_BADD_FU_ID2, "Headphone Playback" }, + { 0 } /* terminator */ + }; +-static struct usbmix_name_map uac3_badd_speaker_map[] = { ++static const struct usbmix_name_map uac3_badd_speaker_map[] = { + { UAC3_BADD_FU_ID2, "Speaker Playback" }, + { 0 } /* terminator */ + }; +-static struct usbmix_name_map uac3_badd_microphone_map[] = { ++static const struct usbmix_name_map uac3_badd_microphone_map[] = { + { UAC3_BADD_FU_ID5, "Mic Capture" }, + { 0 } /* terminator */ + }; + /* Covers also 'headset adapter' profile */ +-static struct usbmix_name_map uac3_badd_headset_map[] = { ++static const struct usbmix_name_map uac3_badd_headset_map[] = { + { UAC3_BADD_FU_ID2, "Headset Playback" }, + { UAC3_BADD_FU_ID5, "Headset Capture" }, + { UAC3_BADD_FU_ID7, "Sidetone Mixing" }, + { 0 } /* terminator */ + }; +-static struct usbmix_name_map uac3_badd_speakerphone_map[] = { ++static const struct usbmix_name_map uac3_badd_speakerphone_map[] = { + { UAC3_BADD_FU_ID2, "Speaker Playback" }, + { UAC3_BADD_FU_ID5, "Mic Capture" }, + { 0 } /* terminator */ + }; + +-static struct usbmix_ctl_map uac3_badd_usbmix_ctl_maps[] = { ++static const struct usbmix_ctl_map uac3_badd_usbmix_ctl_maps[] = { + { + .id = UAC3_FUNCTION_SUBCLASS_GENERIC_IO, + .map = uac3_badd_generic_io_map, +--- a/sound/usb/mixer_quirks.c ++++ b/sound/usb/mixer_quirks.c +@@ -119,7 +119,7 @@ static int snd_create_std_mono_ctl(struc + * Create a set of standard UAC controls from a table + */ + static int snd_create_std_mono_table(struct usb_mixer_interface *mixer, +- struct std_mono_table *t) ++ const struct std_mono_table *t) + { + int err; + +@@ -1388,7 +1388,7 @@ static int snd_c400_create_mixer(struct + * are valid they presents mono controls as L and R channels of + * stereo. So we provide a good mixer here. + */ +-static struct std_mono_table ebox44_table[] = { ++static const struct std_mono_table ebox44_table[] = { + { + .unitid = 4, + .control = 1, +@@ -1697,7 +1697,7 @@ static struct snd_kcontrol_new snd_micro + static int snd_microii_controls_create(struct usb_mixer_interface *mixer) + { + int err, i; +- static usb_mixer_elem_resume_func_t resume_funcs[] = { ++ const static usb_mixer_elem_resume_func_t resume_funcs[] = { + snd_microii_spdif_default_update, + NULL, + snd_microii_spdif_switch_update +--- a/sound/usb/mixer_scarlett.c ++++ b/sound/usb/mixer_scarlett.c +@@ -623,7 +623,7 @@ static int add_output_ctls(struct usb_mi + /********************** device-specific config *************************/ + + /* untested... */ +-static struct scarlett_device_info s6i6_info = { ++static const struct scarlett_device_info s6i6_info = { + .matrix_in = 18, + .matrix_out = 8, + .input_len = 6, +@@ -665,7 +665,7 @@ static struct scarlett_device_info s6i6_ + }; + + /* untested... */ +-static struct scarlett_device_info s8i6_info = { ++static const struct scarlett_device_info s8i6_info = { + .matrix_in = 18, + .matrix_out = 6, + .input_len = 8, +@@ -704,7 +704,7 @@ static struct scarlett_device_info s8i6_ + } + }; + +-static struct scarlett_device_info s18i6_info = { ++static const struct scarlett_device_info s18i6_info = { + .matrix_in = 18, + .matrix_out = 6, + .input_len = 18, +@@ -741,7 +741,7 @@ static struct scarlett_device_info s18i6 + } + }; + +-static struct scarlett_device_info s18i8_info = { ++static const struct scarlett_device_info s18i8_info = { + .matrix_in = 18, + .matrix_out = 8, + .input_len = 18, +@@ -783,7 +783,7 @@ static struct scarlett_device_info s18i8 + } + }; + +-static struct scarlett_device_info s18i20_info = { ++static const struct scarlett_device_info s18i20_info = { + .matrix_in = 18, + .matrix_out = 8, + .input_len = 18, +@@ -833,7 +833,7 @@ static struct scarlett_device_info s18i2 + + + static int scarlett_controls_create_generic(struct usb_mixer_interface *mixer, +- struct scarlett_device_info *info) ++ const struct scarlett_device_info *info) + { + int i, err; + char mx[SNDRV_CTL_ELEM_ID_NAME_MAXLEN]; +@@ -896,7 +896,7 @@ int snd_scarlett_controls_create(struct + { + int err, i, o; + char mx[SNDRV_CTL_ELEM_ID_NAME_MAXLEN]; +- struct scarlett_device_info *info; ++ const struct scarlett_device_info *info; + struct usb_mixer_elem_info *elem; + static char sample_rate_buffer[4] = { '\x80', '\xbb', '\x00', '\x00' }; + +--- a/sound/usb/proc.c ++++ b/sound/usb/proc.c +@@ -60,7 +60,7 @@ void snd_usb_audio_create_proc(struct sn + static void proc_dump_substream_formats(struct snd_usb_substream *subs, struct snd_info_buffer *buffer) + { + struct audioformat *fp; +- static char *sync_types[4] = { ++ static const char * const sync_types[4] = { + "NONE", "ASYNC", "ADAPTIVE", "SYNC" + }; + +--- a/sound/usb/stream.c ++++ b/sound/usb/stream.c +@@ -240,7 +240,7 @@ static int add_chmap(struct snd_pcm *pcm + static struct snd_pcm_chmap_elem *convert_chmap(int channels, unsigned int bits, + int protocol) + { +- static unsigned int uac1_maps[] = { ++ static const unsigned int uac1_maps[] = { + SNDRV_CHMAP_FL, /* left front */ + SNDRV_CHMAP_FR, /* right front */ + SNDRV_CHMAP_FC, /* center front */ +@@ -255,7 +255,7 @@ static struct snd_pcm_chmap_elem *conver + SNDRV_CHMAP_TC, /* top */ + 0 /* terminator */ + }; +- static unsigned int uac2_maps[] = { ++ static const unsigned int uac2_maps[] = { + SNDRV_CHMAP_FL, /* front left */ + SNDRV_CHMAP_FR, /* front right */ + SNDRV_CHMAP_FC, /* front center */ +--- a/sound/usb/validate.c ++++ b/sound/usb/validate.c +@@ -233,7 +233,7 @@ static bool validate_midi_out_jack(const + #define FIXED(p, t, s) { .protocol = (p), .type = (t), .size = sizeof(s) } + #define FUNC(p, t, f) { .protocol = (p), .type = (t), .func = (f) } + +-static struct usb_desc_validator audio_validators[] = { ++static const struct usb_desc_validator audio_validators[] = { + /* UAC1 */ + FUNC(UAC_VERSION_1, UAC_HEADER, validate_uac1_header), + FIXED(UAC_VERSION_1, UAC_INPUT_TERMINAL, +@@ -288,7 +288,7 @@ static struct usb_desc_validator audio_v + { } /* terminator */ + }; + +-static struct usb_desc_validator midi_validators[] = { ++static const struct usb_desc_validator midi_validators[] = { + FIXED(UAC_VERSION_ALL, USB_MS_HEADER, + struct usb_ms_header_descriptor), + FIXED(UAC_VERSION_ALL, USB_MS_MIDI_IN_JACK, diff --git a/queue-5.4/series b/queue-5.4/series index 331daced5e7..d5060c64a24 100644 --- a/queue-5.4/series +++ b/queue-5.4/series @@ -122,3 +122,9 @@ scsi-lpfc-remove-unsupported-mbox-port_capabilities-.patch mfd-arizona-fix-rumtime-pm-imbalance-on-error.patch scsi-libfc-fix-a-format-specifier.patch s390-archrandom-add-parameter-check-for-s390_arch_ra.patch +alsa-emu8000-fix-a-use-after-free-in-snd_emu8000_create_mixer.patch +alsa-hda-conexant-re-order-cx5066-quirk-table-entries.patch +alsa-sb-fix-two-use-after-free-in-snd_sb_qsound_build.patch +alsa-usb-audio-explicitly-set-up-the-clock-selector.patch +alsa-usb-audio-more-constifications.patch +alsa-usb-audio-add-db-range-mapping-for-sennheiser-communications-headset-pc-8.patch