lkml.org 
[lkml]   [2019]   [Aug]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 5.2 028/135] Input: iforce - add sanity checks
    Date
    From: Oliver Neukum <oneukum@suse.com>

    commit 849f5ae3a513c550cad741c68dd3d7eb2bcc2a2c upstream.

    The endpoint type should also be checked before a device
    is accepted.

    Reported-by: syzbot+5efc10c005014d061a74@syzkaller.appspotmail.com
    Signed-off-by: Oliver Neukum <oneukum@suse.com>
    Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    ---
    drivers/input/joystick/iforce/iforce-usb.c | 5 +++++
    1 file changed, 5 insertions(+)

    diff --git a/drivers/input/joystick/iforce/iforce-usb.c b/drivers/input/joystick/iforce/iforce-usb.c
    index f1569ae8381bc..a0a686f56ac4f 100644
    --- a/drivers/input/joystick/iforce/iforce-usb.c
    +++ b/drivers/input/joystick/iforce/iforce-usb.c
    @@ -129,7 +129,12 @@ static int iforce_usb_probe(struct usb_interface *intf,
    return -ENODEV;

    epirq = &interface->endpoint[0].desc;
    + if (!usb_endpoint_is_int_in(epirq))
    + return -ENODEV;
    +
    epout = &interface->endpoint[1].desc;
    + if (!usb_endpoint_is_int_out(epout))
    + return -ENODEV;

    if (!(iforce = kzalloc(sizeof(struct iforce) + 32, GFP_KERNEL)))
    goto fail;
    --
    2.20.1
    \
     
     \ /
      Last update: 2019-08-22 19:26    [W:3.417 / U:0.060 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site