Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp562361ybl; Fri, 23 Aug 2019 05:11:50 -0700 (PDT) X-Google-Smtp-Source: APXvYqwtInSkekNkiiU8TALMpgZMLenMCmJ+6C8n0UcOpz1B3s4PkZAKu54qJ2G9HjyqCuwcWmo9 X-Received: by 2002:a17:902:248:: with SMTP id 66mr4495793plc.19.1566562310384; Fri, 23 Aug 2019 05:11:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1566562310; cv=none; d=google.com; s=arc-20160816; b=08Ufm1aZ26O5Gh/WyuMlKBp2W5lPfDvGI7LxplQCrPcOLyuxRk/KpCQoXhtcZSyCPA JTStTtAvLDAYn53zdY7W4P0XXxEIksti1cpQTFXdFnggsIHU8v2MC3YZeN8emhRob/3Z DBuFKzxuiooqpt8Fz/ZFX0mNiRkkthi27QilEokeB/SrTaGjY9jQ7sIBCE9ggAlG3RQ6 mLnx+l6SVyBJj0s6nW37VM7YQi5wGJSZCWfWbNaA7x67GltUSZQqo0FJ9CK/bBVB3Tj7 pINBLpGmBEnwMMN0W77uDu4zJq0ohTVBu6EdhZE/qsi3fLRhAQ2xfxnzoJfgX9goTgE/ c30w== 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=DcSMrEjAntXHizgIiWu3XfWa44mG77OHCav4/EGS8F8=; b=KPcBCwoJVNEN5/IsR+K7Nl4cKmxxi3DC/uhCBkXdkyhkBe6dzoM9QtxmODliw7znHw uVWw5i53J5HpO5oEJmMuSloH7lQGXFXKJ/O/N/pAx9vJ0SLRo5iZabCQeL5lX6Exyl1C JTVCAdB8jnE9jjqoqTCBmYrhZi8pH9tzP36cD4dIJtudHQR8zLGUcQ53yFR1+EMSW14U Gd0pD/idIgXVbffgvOuEykXO/A1Btr80xv33toDoBm88rYIeZFhC5skJAD3aolroDhfn hS5WPk/X9PmM2GIF6Yy7KgsJMxFmCfMdbaGQzBI6IQM+YDh2odcZMnKrNLCY52VfDU81 rZqQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=kMvhU1+H; 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 b30si2401149pla.299.2019.08.23.05.11.32; Fri, 23 Aug 2019 05:11:50 -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=kMvhU1+H; 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 S2390291AbfHVRr3 (ORCPT + 99 others); Thu, 22 Aug 2019 13:47:29 -0400 Received: from mail.kernel.org ([198.145.29.99]:41022 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2391388AbfHVRWg (ORCPT ); Thu, 22 Aug 2019 13:22:36 -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 6E4F2233FD; Thu, 22 Aug 2019 17:22:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1566494555; bh=9wy+n8dSBS6TzbMdKj/1fdDR1OssBlS0d1bS0Qh32tg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=kMvhU1+HbAAscoGzf1pOqOEP+Pjdvf6XVS9hXiEffVDRKSc8yfR1p7LB4hfWTiO76 V//bNDfZ38zEqR0f6dE+VqaxWWM43UeeXfXtmz19ixJTSt1eH05qq/2cfgOXRo5UHa vmPbhkoSx4Qtl4ocJ6/FcjQH8ME1FoNeBXuiVaqc= 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.4 41/78] Input: kbtab - sanity check for endpoint type Date: Thu, 22 Aug 2019 10:18:45 -0700 Message-Id: <20190822171833.231567998@linuxfoundation.org> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20190822171832.012773482@linuxfoundation.org> References: <20190822171832.012773482@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) @@ -164,8 +168,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,