aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2018-04-21 13:32:16 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2018-04-21 13:32:16 -0400
commit5e7c7806111ade52f4e198fa0f576c538fbfb0df (patch)
tree3d530826473ff72715bad6bb361876060a28aac7
parente46096b6a33a698100cbe923f6cf7f05cd5ad1ad (diff)
parent8a56ef4f3ffba9ebf4967b61ef600b0a7ba10f11 (diff)
Merge tag 'sound-4.17-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound
Pull sound fixes from Takashi Iwai: "A few small fixes: - a fix for the NULL-dereference in rawmidi compat ioctls, triggered by fuzzer - HD-audio Realtek codec quirks, a VIA controller fixup - a long-standing bug fix in LINE6 MIDI" * tag 'sound-4.17-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound: ALSA: rawmidi: Fix missing input substream checks in compat ioctls ALSA: hda/realtek - adjust the location of one mic ALSA: hda/realtek - set PINCFG_HEADSET_MIC to parse_flags ALSA: hda - New VIA controller suppor no-snoop path ALSA: line6: Use correct endpoint type for midi output
-rw-r--r--sound/core/rawmidi_compat.c18
-rw-r--r--sound/pci/hda/hda_intel.c3
-rw-r--r--sound/pci/hda/patch_realtek.c3
-rw-r--r--sound/usb/line6/midi.c2
4 files changed, 18 insertions, 8 deletions
diff --git a/sound/core/rawmidi_compat.c b/sound/core/rawmidi_compat.c
index f69764d7cdd7..e30e30ba6e39 100644
--- a/sound/core/rawmidi_compat.c
+++ b/sound/core/rawmidi_compat.c
@@ -36,8 +36,6 @@ static int snd_rawmidi_ioctl_params_compat(struct snd_rawmidi_file *rfile,
36 struct snd_rawmidi_params params; 36 struct snd_rawmidi_params params;
37 unsigned int val; 37 unsigned int val;
38 38
39 if (rfile->output == NULL)
40 return -EINVAL;
41 if (get_user(params.stream, &src->stream) || 39 if (get_user(params.stream, &src->stream) ||
42 get_user(params.buffer_size, &src->buffer_size) || 40 get_user(params.buffer_size, &src->buffer_size) ||
43 get_user(params.avail_min, &src->avail_min) || 41 get_user(params.avail_min, &src->avail_min) ||
@@ -46,8 +44,12 @@ static int snd_rawmidi_ioctl_params_compat(struct snd_rawmidi_file *rfile,
46 params.no_active_sensing = val; 44 params.no_active_sensing = val;
47 switch (params.stream) { 45 switch (params.stream) {
48 case SNDRV_RAWMIDI_STREAM_OUTPUT: 46 case SNDRV_RAWMIDI_STREAM_OUTPUT:
47 if (!rfile->output)
48 return -EINVAL;
49 return snd_rawmidi_output_params(rfile->output, &params); 49 return snd_rawmidi_output_params(rfile->output, &params);
50 case SNDRV_RAWMIDI_STREAM_INPUT: 50 case SNDRV_RAWMIDI_STREAM_INPUT:
51 if (!rfile->input)
52 return -EINVAL;
51 return snd_rawmidi_input_params(rfile->input, &params); 53 return snd_rawmidi_input_params(rfile->input, &params);
52 } 54 }
53 return -EINVAL; 55 return -EINVAL;
@@ -67,16 +69,18 @@ static int snd_rawmidi_ioctl_status_compat(struct snd_rawmidi_file *rfile,
67 int err; 69 int err;
68 struct snd_rawmidi_status status; 70 struct snd_rawmidi_status status;
69 71
70 if (rfile->output == NULL)
71 return -EINVAL;
72 if (get_user(status.stream, &src->stream)) 72 if (get_user(status.stream, &src->stream))
73 return -EFAULT; 73 return -EFAULT;
74 74
75 switch (status.stream) { 75 switch (status.stream) {
76 case SNDRV_RAWMIDI_STREAM_OUTPUT: 76 case SNDRV_RAWMIDI_STREAM_OUTPUT:
77 if (!rfile->output)
78 return -EINVAL;
77 err = snd_rawmidi_output_status(rfile->output, &status); 79 err = snd_rawmidi_output_status(rfile->output, &status);
78 break; 80 break;
79 case SNDRV_RAWMIDI_STREAM_INPUT: 81 case SNDRV_RAWMIDI_STREAM_INPUT:
82 if (!rfile->input)
83 return -EINVAL;
80 err = snd_rawmidi_input_status(rfile->input, &status); 84 err = snd_rawmidi_input_status(rfile->input, &status);
81 break; 85 break;
82 default: 86 default:
@@ -112,16 +116,18 @@ static int snd_rawmidi_ioctl_status_x32(struct snd_rawmidi_file *rfile,
112 int err; 116 int err;
113 struct snd_rawmidi_status status; 117 struct snd_rawmidi_status status;
114 118
115 if (rfile->output == NULL)
116 return -EINVAL;
117 if (get_user(status.stream, &src->stream)) 119 if (get_user(status.stream, &src->stream))
118 return -EFAULT; 120 return -EFAULT;
119 121
120 switch (status.stream) { 122 switch (status.stream) {
121 case SNDRV_RAWMIDI_STREAM_OUTPUT: 123 case SNDRV_RAWMIDI_STREAM_OUTPUT:
124 if (!rfile->output)
125 return -EINVAL;
122 err = snd_rawmidi_output_status(rfile->output, &status); 126 err = snd_rawmidi_output_status(rfile->output, &status);
123 break; 127 break;
124 case SNDRV_RAWMIDI_STREAM_INPUT: 128 case SNDRV_RAWMIDI_STREAM_INPUT:
129 if (!rfile->input)
130 return -EINVAL;
125 err = snd_rawmidi_input_status(rfile->input, &status); 131 err = snd_rawmidi_input_status(rfile->input, &status);
126 break; 132 break;
127 default: 133 default:
diff --git a/sound/pci/hda/hda_intel.c b/sound/pci/hda/hda_intel.c
index 7a111a1b5836..b0c8c79848a9 100644
--- a/sound/pci/hda/hda_intel.c
+++ b/sound/pci/hda/hda_intel.c
@@ -1647,7 +1647,8 @@ static void azx_check_snoop_available(struct azx *chip)
1647 */ 1647 */
1648 u8 val; 1648 u8 val;
1649 pci_read_config_byte(chip->pci, 0x42, &val); 1649 pci_read_config_byte(chip->pci, 0x42, &val);
1650 if (!(val & 0x80) && chip->pci->revision == 0x30) 1650 if (!(val & 0x80) && (chip->pci->revision == 0x30 ||
1651 chip->pci->revision == 0x20))
1651 snoop = false; 1652 snoop = false;
1652 } 1653 }
1653 1654
diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c
index aef1f52db7d9..fc77bf7a1544 100644
--- a/sound/pci/hda/patch_realtek.c
+++ b/sound/pci/hda/patch_realtek.c
@@ -6370,6 +6370,8 @@ static const struct hda_fixup alc269_fixups[] = {
6370 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */ 6370 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
6371 { } 6371 { }
6372 }, 6372 },
6373 .chained = true,
6374 .chain_id = ALC269_FIXUP_HEADSET_MIC
6373 }, 6375 },
6374}; 6376};
6375 6377
@@ -6573,6 +6575,7 @@ static const struct snd_pci_quirk alc269_fixup_tbl[] = {
6573 SND_PCI_QUIRK(0x17aa, 0x30bb, "ThinkCentre AIO", ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY), 6575 SND_PCI_QUIRK(0x17aa, 0x30bb, "ThinkCentre AIO", ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY),
6574 SND_PCI_QUIRK(0x17aa, 0x30e2, "ThinkCentre AIO", ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY), 6576 SND_PCI_QUIRK(0x17aa, 0x30e2, "ThinkCentre AIO", ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY),
6575 SND_PCI_QUIRK(0x17aa, 0x310c, "ThinkCentre Station", ALC294_FIXUP_LENOVO_MIC_LOCATION), 6577 SND_PCI_QUIRK(0x17aa, 0x310c, "ThinkCentre Station", ALC294_FIXUP_LENOVO_MIC_LOCATION),
6578 SND_PCI_QUIRK(0x17aa, 0x3138, "ThinkCentre Station", ALC294_FIXUP_LENOVO_MIC_LOCATION),
6576 SND_PCI_QUIRK(0x17aa, 0x313c, "ThinkCentre Station", ALC294_FIXUP_LENOVO_MIC_LOCATION), 6579 SND_PCI_QUIRK(0x17aa, 0x313c, "ThinkCentre Station", ALC294_FIXUP_LENOVO_MIC_LOCATION),
6577 SND_PCI_QUIRK(0x17aa, 0x3112, "ThinkCentre AIO", ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY), 6580 SND_PCI_QUIRK(0x17aa, 0x3112, "ThinkCentre AIO", ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY),
6578 SND_PCI_QUIRK(0x17aa, 0x3902, "Lenovo E50-80", ALC269_FIXUP_DMIC_THINKPAD_ACPI), 6581 SND_PCI_QUIRK(0x17aa, 0x3902, "Lenovo E50-80", ALC269_FIXUP_DMIC_THINKPAD_ACPI),
diff --git a/sound/usb/line6/midi.c b/sound/usb/line6/midi.c
index 6d7cde56a355..e2cf55c53ea8 100644
--- a/sound/usb/line6/midi.c
+++ b/sound/usb/line6/midi.c
@@ -125,7 +125,7 @@ static int send_midi_async(struct usb_line6 *line6, unsigned char *data,
125 } 125 }
126 126
127 usb_fill_int_urb(urb, line6->usbdev, 127 usb_fill_int_urb(urb, line6->usbdev,
128 usb_sndbulkpipe(line6->usbdev, 128 usb_sndintpipe(line6->usbdev,
129 line6->properties->ep_ctrl_w), 129 line6->properties->ep_ctrl_w),
130 transfer_buffer, length, midi_sent, line6, 130 transfer_buffer, length, midi_sent, line6,
131 line6->interval); 131 line6->interval);