Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp116501ybl; Thu, 22 Aug 2019 21:04:12 -0700 (PDT) X-Google-Smtp-Source: APXvYqy6bzAOhowt88pq4DzD6UOI8/7tQ0n5TA2QlsDHXI1Y8ADwLYe3zDCqyV/F6BhFJPTQ0UeN X-Received: by 2002:a17:902:b48c:: with SMTP id y12mr2384904plr.202.1566533052063; Thu, 22 Aug 2019 21:04:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1566533052; cv=none; d=google.com; s=arc-20160816; b=IwfYnv1rqMm4gct6yZxaiQqMPMBgml11TADLboTvtIrA1ArDO4Vc2MZZwG9Gdjpvkv JMBQ1LndWdqxMkAhOp8199BWav9ILtI1krenRIJkO0d8MX3RiGm+uZWDjxgRZabGatZ2 r6NCy+ye9hXCGgN5P+QlL4bRsDPzOaadawoAiVy1/CcqRhk/SagESD6tDauT7ShsI6GS l+LAH7fo/zzpyB6WGrlVc1DSBTb2JkP8AAObN9AoZCLLiojfDeFptVDM4fIae7oc1a5J PM0VuE0oepJsdf9QrrkHjvPlGCgPx1sNum+yvaCk2mrLtb/J7nZaMxPN6yCs96x7axEx 3MNQ== 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=VNnV8L5CMIMxN8WFCQxo8X+wRPIoeJsBioAsrjnRydA=; b=acFPKaP4UprbD/iHlF9+fRl9umQaFZB4bnQh/V1T5C3qvgK01yNtsL0Wkyd5dpj1UT IkqtS4miX6gHgBA1yMyPZQQ7EH6zBHyNHGPo45OTPCLaRMyqOhW6L2GPn1uizfqIf6EI qgds250JiIypF0lztrsXemV2y6zdLgBUT+Ot7+VAZvYiv4xXE6ofCSnSt53ANkzYkdpH oTsHF9wAsTsXFYkb9K0mvyVGfmerSDjSxMkTGn8Pj3tmOpc/C7xB4UZB80qfK4W5wx12 jMl5OTPIFUdDUR7yugfbas0A4yxbO3nPbiEh6p6CInBuHtjcNAWeSoBa0W2F84a3tEcD pFVQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=aCi7tSu0; 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 w9si1275802plp.329.2019.08.22.21.03.57; Thu, 22 Aug 2019 21:04:12 -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=aCi7tSu0; 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 S2403962AbfHVRdN (ORCPT + 99 others); Thu, 22 Aug 2019 13:33:13 -0400 Received: from mail.kernel.org ([198.145.29.99]:49230 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2391842AbfHVRZc (ORCPT ); Thu, 22 Aug 2019 13:25:32 -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 C9F3C2341E; Thu, 22 Aug 2019 17:25:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1566494730; bh=H9PxVcmkwzH7ZZsM5nkJr9QnieR3VHq7pO6yyAPZ9XM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=aCi7tSu0+LWSh7WZQjPGGU/Iw8ce6snzAnQMvvBeW2LMsYHoyTP+T2p9xT3EShLol V4vp/L83LPpFKSkGkeMs4Sm0PA0szWJ9WHOBwEqFuNgtqsFoqrb9cr0+/8qYN5reB8 bCarBRCWp9WTPexOiWioqbxKTqhlRogma9coIHbk= 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.19 21/85] Input: kbtab - sanity check for endpoint type Date: Thu, 22 Aug 2019 10:18:54 -0700 Message-Id: <20190822171732.079738646@linuxfoundation.org> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20190822171731.012687054@linuxfoundation.org> References: <20190822171731.012687054@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 @@ -116,6 +116,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) @@ -154,8 +158,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,