summaryrefslogtreecommitdiffstats
path: root/sound/usb/helper.h
diff options
context:
space:
mode:
authorTakashi Iwai2019-06-24 15:08:28 +0200
committerTakashi Iwai2019-06-24 15:11:06 +0200
commit801ebf1043ae7b182588554cc9b9ad3c14bc2ab5 (patch)
tree0259d975fddf2d2efd55f82377fad81357d1591e /sound/usb/helper.h
parentALSA: firewire-motu: unify common tracepoints for both direction (diff)
downloadkernel-qcow2-linux-801ebf1043ae7b182588554cc9b9ad3c14bc2ab5.tar.gz
kernel-qcow2-linux-801ebf1043ae7b182588554cc9b9ad3c14bc2ab5.tar.xz
kernel-qcow2-linux-801ebf1043ae7b182588554cc9b9ad3c14bc2ab5.zip
ALSA: usb-audio: Sanity checks for each pipe and EP types
The recent USB core code performs sanity checks for the given pipe and EP types, and it can be hit by manipulated USB descriptors by syzbot. For making syzbot happier, this patch introduces a local helper for a sanity check in the driver side and calls it at each place before the message handling, so that we can avoid the WARNING splats. Reported-by: syzbot+d952e5e28f5fb7718d23@syzkaller.appspotmail.com Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/usb/helper.h')
-rw-r--r--sound/usb/helper.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/sound/usb/helper.h b/sound/usb/helper.h
index d338bd0e0ca6..6afb70156ec4 100644
--- a/sound/usb/helper.h
+++ b/sound/usb/helper.h
@@ -7,6 +7,7 @@ unsigned int snd_usb_combine_bytes(unsigned char *bytes, int size);
void *snd_usb_find_desc(void *descstart, int desclen, void *after, u8 dtype);
void *snd_usb_find_csint_desc(void *descstart, int desclen, void *after, u8 dsubtype);
+int snd_usb_pipe_sanity_check(struct usb_device *dev, unsigned int pipe);
int snd_usb_ctl_msg(struct usb_device *dev, unsigned int pipe,
__u8 request, __u8 requesttype, __u16 value, __u16 index,
void *data, __u16 size);