lkml.org 
[lkml]   [2020]   [Oct]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 5.9 648/757] media: ati_remote: sanity check for both endpoints
    Date
    From: Oliver Neukum <oneukum@suse.com>

    [ 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>
    ---
    drivers/media/rc/ati_remote.c | 4 ++++
    1 file changed, 4 insertions(+)

    diff --git a/drivers/media/rc/ati_remote.c b/drivers/media/rc/ati_remote.c
    index 9cdef17b4793f..c12dda73cdd53 100644
    --- a/drivers/media/rc/ati_remote.c
    +++ b/drivers/media/rc/ati_remote.c
    @@ -835,6 +835,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);
    --
    2.25.1


    \
     
     \ /
      Last update: 2020-10-27 17:14    [W:3.783 / U:0.320 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site