Received: by 2002:a05:6a10:9e8c:0:0:0:0 with SMTP id y12csp173765pxx; Wed, 28 Oct 2020 01:35:28 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzuAhSElG2NIvohs/o5BqBaVXkK9gziKRX9VPDhZqcVM4xTN+ia7h6bpElkCTmYf580S9Yq X-Received: by 2002:a05:6402:289:: with SMTP id l9mr6630452edv.294.1603874128618; Wed, 28 Oct 2020 01:35:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603874128; cv=none; d=google.com; s=arc-20160816; b=D+yr14zj6m8+h61NtI2sRizMum4m6hT5iZy8XXsO7jCYzXzA1fgCYB2XUiWQNp10t2 cKy43HmFuNUVLbx7ijLnzJ6b543RcR4KVMpg1E6+1IvHpeW8PrSf8aVKO0zcGhv/aYLu fKuJcNZqbVz2RFepc+mvSGTys7YR44SP5g6ncbYVtR20r3jvgqD69X1nmxhoZ0Z8+HLU 5QX+qh2IaFDeYX6/m6C6vhMg++iiy/NW4tpF/+Nw7IRVXqdgfK1a5OENDH6UAd1guMWd lejzVByJieL9CYjPbg6tFDXLin5MDKogm5pVFwpOZVNiJ8NQiaUwVHjrq8esZGzlX23U Aj7w== 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=vrJkrpAgHZApiev+9GMhPAgZdiTeuV2lxoqbZpfTpj4=; b=o6chZ0NI1jVFWXXc3+7+1fYXoPQEmRntcVjVh3uv0mMV35W4OImL4N3VCpifom8J0k +I86p9403QwoPBPeJ41vGp+GSmsPgCKM3DIDIaynkQJEqIXjYWy81LHAUGqLVUDIkhpP LSc7kh0Uqts7cspQwXVV6ZvkzIdzCwkFKfpzfq29Y100tJyQ1LuGblqMoopudilXef+z +XkcCy6EuxC4JAkKY3TBAohKeM1+RjKwXKPJYL1oYIDebtCgQW4djxHqKWPJQQ4NrCii aJwcy6qQceu5PM8rvqCAP9WNW+/Z3vwR+AYv1QHE6gvGNlyiAhjDpK6cQGmfEVeASGGc vUIA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=z6kx3B9n; 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 f19si2736409edx.542.2020.10.28.01.35.06; Wed, 28 Oct 2020 01:35:28 -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=z6kx3B9n; 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 S1754614AbgJ0OGN (ORCPT + 99 others); Tue, 27 Oct 2020 10:06:13 -0400 Received: from mail.kernel.org ([198.145.29.99]:54394 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754577AbgJ0OGB (ORCPT ); Tue, 27 Oct 2020 10:06:01 -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 068E322263; Tue, 27 Oct 2020 14:06:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1603807561; bh=jHv1IA6LQU7+/SPx/H7AeHePLNsVE4JaFt4uu2TZIe0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=z6kx3B9neLTbU9yg+IHyC5LMKcoRl0kn9e6P+k3Yhz/xwmt19XqtPZLR2EdyCthHl otl5N+AMSOR+O76R2cfQnyGQE8wjmx1FLAkJYf3eZxzUR73YyTYr+K2nTKkn73JXYF FulW/Bisc4lgtYbThnqsUwFCjvUahiF3majCX2KM= 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.9 096/139] media: ati_remote: sanity check for both endpoints Date: Tue, 27 Oct 2020 14:49:50 +0100 Message-Id: <20201027134906.689490365@linuxfoundation.org> X-Mailer: git-send-email 2.29.1 In-Reply-To: <20201027134902.130312227@linuxfoundation.org> References: <20201027134902.130312227@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 9f5b59706741c..7f98db4bc0277 100644 --- a/drivers/media/rc/ati_remote.c +++ b/drivers/media/rc/ati_remote.c @@ -850,6 +850,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(); -- 2.25.1