summaryrefslogtreecommitdiff
path: root/sound/usb/helper.h
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2019-08-20 18:17:09 +0300
committerTakashi Iwai <tiwai@suse.de>2019-08-22 11:35:59 +0300
commit57f8770620e9b51c61089751f0b5ad3dbe376ff2 (patch)
tree3302223d107681aa8b7558e68fdf1bf322cdc4b4 /sound/usb/helper.h
parentf9f0e9ed350e15d51ad07364b4cf910de50c472a (diff)
downloadlinux-57f8770620e9b51c61089751f0b5ad3dbe376ff2.tar.xz
ALSA: usb-audio: More validations of descriptor units
Introduce a new helper to validate each audio descriptor unit before and check the unit before actually accessing it. This should harden against the OOB access cases with malformed descriptors that have been recently frequently reported by fuzzers. The existing descriptor checks are still kept although they become superfluous after this patch. They'll be cleaned up eventually later. Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/usb/helper.h')
-rw-r--r--sound/usb/helper.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/sound/usb/helper.h b/sound/usb/helper.h
index 6afb70156ec4..5e8a18b4e7b9 100644
--- a/sound/usb/helper.h
+++ b/sound/usb/helper.h
@@ -31,4 +31,8 @@ static inline int snd_usb_ctrl_intf(struct snd_usb_audio *chip)
return get_iface_desc(chip->ctrl_intf)->bInterfaceNumber;
}
+/* in validate.c */
+bool snd_usb_validate_audio_desc(void *p, int protocol);
+bool snd_usb_validate_midi_desc(void *p);
+
#endif /* __USBAUDIO_HELPER_H */