]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blob - releases/3.14.60/alsa-control-avoid-kernel-warnings-from-tlv-ioctl-with-numid-0.patch
Linux 4.9.169
[thirdparty/kernel/stable-queue.git] / releases / 3.14.60 / alsa-control-avoid-kernel-warnings-from-tlv-ioctl-with-numid-0.patch
1 From c0bcdbdff3ff73a54161fca3cb8b6cdbd0bb8762 Mon Sep 17 00:00:00 2001
2 From: Takashi Iwai <tiwai@suse.de>
3 Date: Mon, 18 Jan 2016 14:12:40 +0100
4 Subject: ALSA: control: Avoid kernel warnings from tlv ioctl with numid 0
5
6 From: Takashi Iwai <tiwai@suse.de>
7
8 commit c0bcdbdff3ff73a54161fca3cb8b6cdbd0bb8762 upstream.
9
10 When a TLV ioctl with numid zero is handled, the driver may spew a
11 kernel warning with a stack trace at each call. The check was
12 intended obviously only for a kernel driver, but not for a user
13 interaction. Let's fix it.
14
15 This was spotted by syzkaller fuzzer.
16
17 Reported-by: Dmitry Vyukov <dvyukov@google.com>
18 Signed-off-by: Takashi Iwai <tiwai@suse.de>
19 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
20
21 ---
22 sound/core/control.c | 2 ++
23 1 file changed, 2 insertions(+)
24
25 --- a/sound/core/control.c
26 +++ b/sound/core/control.c
27 @@ -1325,6 +1325,8 @@ static int snd_ctl_tlv_ioctl(struct snd_
28 return -EFAULT;
29 if (tlv.length < sizeof(unsigned int) * 2)
30 return -EINVAL;
31 + if (!tlv.numid)
32 + return -EINVAL;
33 down_read(&card->controls_rwsem);
34 kctl = snd_ctl_find_numid(card, tlv.numid);
35 if (kctl == NULL) {