Received: by 2002:a05:6a10:9e8c:0:0:0:0 with SMTP id y12csp578123pxx; Wed, 28 Oct 2020 11:32:52 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxy43wSFWYXp3fTmEVmTzH375uRojb1fv4HN+9+uijvB+0Z0Lq0kC0eOiw9kaEhZjfTsUdy X-Received: by 2002:a05:6402:6ca:: with SMTP id n10mr192039edy.273.1603909971944; Wed, 28 Oct 2020 11:32:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603909971; cv=none; d=google.com; s=arc-20160816; b=MMInCS6+uL25m9dIfQFMy36bJ59DUetct/TelgYi9jn9fWmy/4cFGpZryLIzqYr7rE HK+YMa0m0Vt7tAmhoK3CWhX8jcyyvqhkNFOQ13YH4cFkpbLOwpTuN4wByasDLwkmdKN8 R67yzgfbtKpjBn6ph8jN0OC0B1zDRnwrfyQAIZIgWXZYrX9l5Z9NbnqS1H+4jou7knE8 5z9nSLTVfEoRIFPi2eaYKn12xh7hS/kSdH8+CpAzhgkWUOCcRwCnmgUaC3AF7FHtv35V 73ONUfDpYdmo34B4BV+DSBd10NPxo3ulB9ju04Q6H8xqSwZhv1sBRDItVx6wiM+SUilQ qCaw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=0YfDY2KZiJKxLN/83X78G8rkfdwNqfUwH/iNI8LxNEA=; b=RyCqP+ABW+WCARC2zd9iXoFxksrZ6LQouOowu84r5YuQKKraoqt5hmPts555tF7NbO f/LMue4fOrrkyXQb4nMqfI6uf7ZZgEvncGhi7oA2gnNVRLbqxgWqCqqOvmqnY1Gd0nB3 3v5GLQtC+TgkDZBqGWeiUlITY2vzAvoYnzHT2cvd+S0rKeLRInKRte3AXAljxUmSYyXI jY200TFtEEoRe1BW7GcIrsl+gosKh5UANg4O1UCbXj8ewq33x38yeGcPTzE/7kvL1rkA RiB8vYa71CJoUoM10lWNKA5UsMOf+Z30I+nyKlml+Q6D5KdNmX9GBcm6dlDINS9ONpwO hT3A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=Os6SbSZ5; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id ay1si32292edb.3.2020.10.28.11.32.30; Wed, 28 Oct 2020 11:32:51 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=Os6SbSZ5; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1825194AbgJ0SJd (ORCPT + 99 others); Tue, 27 Oct 2020 14:09:33 -0400 Received: from mail.kernel.org ([198.145.29.99]:37270 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2508489AbgJ0OP0 (ORCPT ); Tue, 27 Oct 2020 10:15:26 -0400 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (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 B24B8206F7; Tue, 27 Oct 2020 14:15:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1603808125; bh=OCj/8NsSojQ0BxbpC31Yz318JM50e/36vBJazaoYzYk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Os6SbSZ53t+ar2a24KJnxg91pPJr7qHKOj9NtS1zha9L29Vs7/V+98+586hw2Ny7T cACDGkDr4u+0SlGfpJ0GzWpKKVy0gC+QzMmtEGvEtojnOpjFE4N6LKvmmEJQVNahQi 6r42Y1vaewspFb2tD+TKMy7FfYqOKklTsErFKLPw= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, syzbot+998261c2ae5932458f6c@syzkaller.appspotmail.com, Oliver Neukum , Sean Young , Mauro Carvalho Chehab , Sasha Levin Subject: [PATCH 4.14 138/191] media: ati_remote: sanity check for both endpoints Date: Tue, 27 Oct 2020 14:49:53 +0100 Message-Id: <20201027134916.346698319@linuxfoundation.org> X-Mailer: git-send-email 2.29.1 In-Reply-To: <20201027134909.701581493@linuxfoundation.org> References: <20201027134909.701581493@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Oliver Neukum [ 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 Signed-off-by: Sean Young Signed-off-by: Mauro Carvalho Chehab Signed-off-by: Sasha Levin --- 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 d0871d60a7231..8e3af398a6c4e 100644 --- a/drivers/media/rc/ati_remote.c +++ b/drivers/media/rc/ati_remote.c @@ -845,6 +845,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