summaryrefslogtreecommitdiff
path: root/drivers/media
diff options
context:
space:
mode:
authorOliver Neukum <oneukum@suse.com>2020-09-16 16:50:51 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2020-10-29 11:07:14 +0300
commit8134f6b6318c00c6729083970059c16b6f7bb21f (patch)
tree8b7a9d8f2fc4593acefc6c3ccf3317724a4aeb42 /drivers/media
parent6763925003a6ba5ff20a4b99f8709f2aa5a9bf9f (diff)
downloadlinux-8134f6b6318c00c6729083970059c16b6f7bb21f.tar.xz
media: ati_remote: sanity check for both endpoints
[ Upstream commit a8be80053ea74bd9c3f9a3810e93b802236d6498 ] 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> Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'drivers/media')
-rw-r--r--drivers/media/rc/ati_remote.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/media/rc/ati_remote.c b/drivers/media/rc/ati_remote.c
index d0871d60a723..8e3af398a6c4 100644
--- a/drivers/media/rc/ati_remote.c
+++ b/drivers/media/rc/ati_remote.c
@@ -845,6 +845,10 @@ static int ati_remote_probe(struct usb_interface *interface,
err("%s: endpoint_in message size==0? \n", __func__);
return -ENODEV;
}
+ if (!usb_endpoint_is_int_out(endpoint_out)) {
+ err("%s: Unexpected endpoint_out\n", __func__);
+ return -ENODEV;
+ }
ati_remote = kzalloc(sizeof (struct ati_remote), GFP_KERNEL);
rc_dev = rc_allocate_device(RC_DRIVER_SCANCODE);