Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

media: ati_remote: sanity check for both endpoints

If you do sanity checks, you should do them for both endpoints.
Hence introduce checking for endpoint type for the output
endpoint, too.

Reported-by: syzbot+998261c2ae5932458f6c@syzkaller.appspotmail.com
Signed-off-by: Oliver Neukum <oneukum@suse.com>
Signed-off-by: Sean Young <sean@mess.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>

authored by

Oliver Neukum and committed by
Mauro Carvalho Chehab
a8be8005 ce5d72b6

+4
+4
drivers/media/rc/ati_remote.c
··· 835 835 err("%s: endpoint_in message size==0? \n", __func__); 836 836 return -ENODEV; 837 837 } 838 + if (!usb_endpoint_is_int_out(endpoint_out)) { 839 + err("%s: Unexpected endpoint_out\n", __func__); 840 + return -ENODEV; 841 + } 838 842 839 843 ati_remote = kzalloc(sizeof (struct ati_remote), GFP_KERNEL); 840 844 rc_dev = rc_allocate_device(RC_DRIVER_SCANCODE);