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
6 From: Takashi Iwai <tiwai@suse.de>
8 commit c0bcdbdff3ff73a54161fca3cb8b6cdbd0bb8762 upstream.
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.
15 This was spotted by syzkaller fuzzer.
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>
22 sound/core/control.c | 2 ++
23 1 file changed, 2 insertions(+)
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_
29 if (tlv.length < sizeof(unsigned int) * 2)
33 down_read(&card->controls_rwsem);
34 kctl = snd_ctl_find_numid(card, tlv.numid);