Received: by 2002:a05:6a10:9e8c:0:0:0:0 with SMTP id y12csp292544pxx; Wed, 28 Oct 2020 05:11:18 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwCeoe6thsbC+RGQy3h3cdhuSTzOsKpUGi9zoebUWa/FG99/aYMdlZ+nid9N8yaHa8BSgYe X-Received: by 2002:a17:906:3689:: with SMTP id a9mr7151391ejc.403.1603887077959; Wed, 28 Oct 2020 05:11:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603887077; cv=none; d=google.com; s=arc-20160816; b=AH9DHf0FgCyc9Y8k19gVgL2ewYeA5oCcKdYbvO6SgjbxeBPtl4ipGenbm/g+9jYZmL KcjVS5YjRhEtlw+Qp+SnKrbaszZrrbP6FMp7GCxu0ErAIOQPGgPZQgkuQFu+zb5HxThb 0ep/gbTXdUjrYQFE7/rEUDGp7savkfq7I+dtsmA6Os8qZOzdSX4syFsiYkNOEWisum1z IP4ozDllcGPVmeJsBjSklObg0vfeUVv4rW6L8yqK3vCDTQJLWykSLJ2YV5HG68/auP6Q fQ4IqONNihcnqQp2Qb2jZ7/fV1XZmYg1G+erFDhbYmuBd203+QTvfveMKTP7nKeX6B/R Kb5A== 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=q93OpizUVMbyMg6hw1wf9WfS06aau1d6bmdZviOjIflbBXqmQ9PIfrLV6ozIKS4BfO GGIzl7EAiODvSdFbU8hMR9Yac0k5jdnGzUOxHqpFhMRi//tX3CslD1TzFv7fKYz1Pzhu WTB/VMQPxBqk1iJqCWLhSWnI+S78A5IVDyl4boXdMnHRvhO90mRbOLQo6RlCupRSVNA+ vIuccDDiccWAtshxlu8Bs6eCjaBEeNOadi4DQ8G6F37dYrhMS2UPAOOSCQ8AYSq/GMBj QyN+J/k9bDYi2WxYi2N4tSu/Fm5uEsTzAEWe8Yr771M+ShVRZXWOOH8y8x8W9qP2A2FG Ig5Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=ScmyJ+S2; 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 w17si2969573ejk.629.2020.10.28.05.10.55; Wed, 28 Oct 2020 05:11:17 -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=ScmyJ+S2; 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 S1795853AbgJ0PPX (ORCPT + 99 others); Tue, 27 Oct 2020 11:15:23 -0400 Received: from mail.kernel.org ([198.145.29.99]:49050 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1794593AbgJ0PMf (ORCPT ); Tue, 27 Oct 2020 11:12:35 -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 36BA020728; Tue, 27 Oct 2020 15:12:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1603811554; bh=lnUQmhdxI1R7NBgmIqelYj+WNGdFerjAL0lYGwFQWbo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ScmyJ+S2fxrxeY9PinpCjH7Yi+jB91ZDpo0/vxF64Ee9tAZtK4nJIDMA5M0/diL4Z D7744oJu/e3un3XpbP9oRT6iO6T2Cuw37GYlJ+KEbtLYBJjsHW2Q7ZacHpXb9QtTvv FU2xoCM9IoJZXMxHIOvMAfZLDSyzqyN8yBXCjL5o= 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.8 534/633] media: ati_remote: sanity check for both endpoints Date: Tue, 27 Oct 2020 14:54:37 +0100 Message-Id: <20201027135547.831371182@linuxfoundation.org> X-Mailer: git-send-email 2.29.1 In-Reply-To: <20201027135522.655719020@linuxfoundation.org> References: <20201027135522.655719020@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