Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp221628ybl; Thu, 22 Aug 2019 23:18:01 -0700 (PDT) X-Google-Smtp-Source: APXvYqxl+CVeqzwLNs3+ptkR8dEc+YiUXniRvr3Nyk/sTNwxHfOkbeg229E7GawMK94p4KL5Uwvk X-Received: by 2002:a65:638c:: with SMTP id h12mr2494872pgv.436.1566541081240; Thu, 22 Aug 2019 23:18:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1566541081; cv=none; d=google.com; s=arc-20160816; b=PItXOR/Oddo2AbRwh3so/5d8185KrxU1LVcC0/oCEB/Pf6aQeNBBmPUdfA3P8TaOHd e2xneQl8S6yQyZzQI+sohnQylLq79XbRu2tFfM1At59GPfYy09sYgFE9BXImMwuo/A9b CfvQYHOljOXkYePPaYDjkpv40HRmFfoEJn54AgyRhBrQ53Op6yPs2f/gfKu2tIC7gjbI McHkR9OgBbgW/YNd2hmRaVJnZJuVn7oDwCR6InWNdKmS+YdTbP+zxs/IfQXGqIx/qLEu 0cyr8m928V8OMWT9AK/pSZkPIJZmrO0ZEetDCFec14AXTH4sVPFFa/BHe4HeYFXyHqeZ DApg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=eMebeJfUuwDJDrOZjKBkrXkVrNjA8PxcEvDKOqhp8lw=; b=rFigLz0mBQaXG4Kyz1LgI33IHTjZjUuXCPvXHNlVln7z6voVO0QK4hNf+3Rjyd5L4G X6ZsPGbawMdJFUb8s+Wrhabf8LYEXf4dj/eewsxQIXml3hAUSgz67FUqM+IW0hGz+Jth PvZj1Px9MLjiVJ94xf59wLoNn5gvw2NqyYQ4XG03HiEn/pe5FTBMUJDtu0chY+ZoYgWi Y/VdIeC8OQDom+YFltJO3W+p+XFUpXzOHaPrAGefH575hV01q0wBN+pafHzb37DYsl1G NsllsWhkPoJodqSBz5vVMDIzdYckDkmhYuhEFa6/cLEo2ui4uobRx+oymQblgmiPRZmF RyzA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=BeXA2lWy; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h91si1607830pld.200.2019.08.22.23.17.45; Thu, 22 Aug 2019 23:18:01 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=BeXA2lWy; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2405153AbfHVRlx (ORCPT + 99 others); Thu, 22 Aug 2019 13:41:53 -0400 Received: from mail.kernel.org ([198.145.29.99]:44602 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2391740AbfHVRXy (ORCPT ); Thu, 22 Aug 2019 13:23:54 -0400 Received: from localhost (wsip-184-188-36-2.sd.sd.cox.net [184.188.36.2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 7B47723428; Thu, 22 Aug 2019 17:23:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1566494633; bh=1wM/SEQJfDfuIKMxA3jc2vKJwCSpwRpH0U615cu6rx4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=BeXA2lWyG1brnZBqNDvnKiuaPQD6JEwHHwftqudgN0s6QFnrRGceyqaUTn+/LmiE9 ODhNYCJXdhdWQ5I8pBchDP1J2k5QhrHcbybSeqZJE8mEah6K0C8X/PEhqVFC6xvBLV 3yoquUJZrAD2d/qRPhayqUoNbIw/SlxHAj5lCGJM= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, syzbot+c7df50363aaff50aa363@syzkaller.appspotmail.com, Oliver Neukum , Dmitry Torokhov Subject: [PATCH 4.9 065/103] Input: kbtab - sanity check for endpoint type Date: Thu, 22 Aug 2019 10:18:53 -0700 Message-Id: <20190822171731.406317755@linuxfoundation.org> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20190822171728.445189830@linuxfoundation.org> References: <20190822171728.445189830@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Oliver Neukum commit c88090dfc84254fa149174eb3e6a8458de1912c4 upstream. The driver should check whether the endpoint it uses has the correct type. Reported-by: syzbot+c7df50363aaff50aa363@syzkaller.appspotmail.com Signed-off-by: Oliver Neukum Signed-off-by: Dmitry Torokhov Signed-off-by: Greg Kroah-Hartman --- drivers/input/tablet/kbtab.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) --- a/drivers/input/tablet/kbtab.c +++ b/drivers/input/tablet/kbtab.c @@ -125,6 +125,10 @@ static int kbtab_probe(struct usb_interf if (intf->cur_altsetting->desc.bNumEndpoints < 1) return -ENODEV; + endpoint = &intf->cur_altsetting->endpoint[0].desc; + if (!usb_endpoint_is_int_in(endpoint)) + return -ENODEV; + kbtab = kzalloc(sizeof(struct kbtab), GFP_KERNEL); input_dev = input_allocate_device(); if (!kbtab || !input_dev) @@ -163,8 +167,6 @@ static int kbtab_probe(struct usb_interf input_set_abs_params(input_dev, ABS_Y, 0, 0x1750, 4, 0); input_set_abs_params(input_dev, ABS_PRESSURE, 0, 0xff, 0, 0); - endpoint = &intf->cur_altsetting->endpoint[0].desc; - usb_fill_int_urb(kbtab->irq, dev, usb_rcvintpipe(dev, endpoint->bEndpointAddress), kbtab->data, 8,