Received: by 2002:a05:6a10:9e8c:0:0:0:0 with SMTP id y12csp234648pxx; Wed, 28 Oct 2020 03:39:03 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx+VYTl/eqFYjfU9nQp2SJ2NCE4OWyZ9kUHXSDNTxNtnRXuHD/XmtlGdIdFBy42WAeNG3Ez X-Received: by 2002:a50:a683:: with SMTP id e3mr7026281edc.33.1603881542589; Wed, 28 Oct 2020 03:39:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603881542; cv=none; d=google.com; s=arc-20160816; b=HYu69vAk0VXIK5yj7JoVzV5X3W8z2841N5JRI7fqGLQX2Np46qm+QaN0EpDeXQvVbH ljQgpMq6KPDMZeC5lJmnKHJCZkXyDA/i8X13ViGRvR2aPhRV5TqW4bbBKPRSi+3CLbN8 zqhGjTbh2TMqh2Ei1eoaINpMKFElDwYSuS3nd4QlwThudvrHvibYuc+nXqS6Cx/PtUOI U+DpgJZpNIh1k3nG5XVhapspz5NZNPQV3/DO08nz6rAEUgGSCJxBw4qunUCv7VLw0m9h paBydIB9Sj+rdNsGEZ49OlpshGWKQ3Kqv4z98JSb7/gAVziAAiXx4RWOIGUgIc6Zbsy1 pGhQ== 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=J3BmBfXMQlGbYsf1liH39/mC4b9zCTulqxnRMp84mbc=; b=majl3kKLrvRm7ZtLngW17e4RZoFMg4gT81kS1AJXRIceotCFHTHNCkxXPg0h/LpGc9 MiVQt1Fn0zONGs183WfTvfL5AkM1VPKxfIgIzl0F6nRipoBwVwjC73HRqBSx3oUeejC8 So4agKaienclmTGCVBluEZ5cNDTPM1wSiZMje2MFCrGS3RRBqMvFsVa+V3yNVbi4BhrZ NtrYFvyhUIkwpilCp7rzND+zanPCZBLehgdWBgRKks8NpX8jOFQi4LeYQek29Eyxgn2w wtSnIJyNyiNV5RImG1mvlZi90nq++LoTQSaSKLeJLFXnKFRfCnfgWGtzHj7y3CuMUEnE 8yUA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=o+Kcop5u; 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 o10si2705925ejr.482.2020.10.28.03.38.40; Wed, 28 Oct 2020 03:39:02 -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=o+Kcop5u; 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 S1763076AbgJ0Oon (ORCPT + 99 others); Tue, 27 Oct 2020 10:44:43 -0400 Received: from mail.kernel.org ([198.145.29.99]:43402 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1762205AbgJ0Ong (ORCPT ); Tue, 27 Oct 2020 10:43:36 -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 71F9F20773; Tue, 27 Oct 2020 14:43:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1603809816; bh=lnUQmhdxI1R7NBgmIqelYj+WNGdFerjAL0lYGwFQWbo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=o+Kcop5uPv/3NnQffcLzng7EXY+WXTqZcIl6eQy6+u82wxZdVKtb4R2XAmXxyFGgX oZk5xpUlADEERQfDte8gAxBchlHS1bASQEsaS9ry9EcfDRBn88wNA/uMZGM6WLVY0g nG1SQ1Tv9FskwbtCLmL2UEkO19xQNxUwlrdqA1kI= 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 5.4 330/408] media: ati_remote: sanity check for both endpoints Date: Tue, 27 Oct 2020 14:54:28 +0100 Message-Id: <20201027135510.344490597@linuxfoundation.org> X-Mailer: git-send-email 2.29.1 In-Reply-To: <20201027135455.027547757@linuxfoundation.org> References: <20201027135455.027547757@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 9cdef17b4793f..c12dda73cdd53 100644 --- a/drivers/media/rc/ati_remote.c +++ b/drivers/media/rc/ati_remote.c @@ -835,6 +835,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