Received: by 2002:a05:6a10:9e8c:0:0:0:0 with SMTP id y12csp1094277pxx; Tue, 27 Oct 2020 08:08:35 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzuG69rQSL1Nfav+6O184tFLZkKPlTjSIHafPoq4MQ92DfAlc3U3hcpHXCckQmJK7/OUrUo X-Received: by 2002:a50:a454:: with SMTP id v20mr2676321edb.98.1603811315532; Tue, 27 Oct 2020 08:08:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603811315; cv=none; d=google.com; s=arc-20160816; b=HlWD+LYaIg4JF73zdREfUe1JBtc+H/xQUn0uv1wDqapMXXmRhPbplfA1FXSP/Xkxei FuauGL8JF6SK5CSbK2lu3Y1SA8zk0LlLByfmXvRSZc/lqvAZ+dZRZt/MKc9ajuv6FQKD 6hLbYqnwZ45prp0ObmBP1Cy9Trcn5KLGmsWIkwj+XjL+7uPACqEExNSVIft0aEy1x2Jp IuJ4pYFcTan7oycyHwTDbDlckgqmhha7hZn/2fvVi1sNGglP14durvx8AB36l06xNFHx CFaOSqor6PadhFiy0DAudksJD7wkBZrO3tn8svPbTDZE/jGYcnwV5OGzskHCQbmMDWP6 5+JA== 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=+rrdYEhbZ6BeSbpbfA69Nm3uKQq9K5AGz2dsEfRekH4=; b=Q0O92j1OiVGcVW4ID/TmXBe8jvxS1K7NeqNFWawRKarl5XZqBEmEqSagtJAvTlrNb6 QXqpEOqFFuX/d15vi1UW8SlIvTdniY+Co1DUTluPz+PhlWbj82NM/AvMwe5EKXJbmgUQ H7MpxMi5TL+zEgPil5vwA62SKEHb7NvJGZ0SkxlrNcpSI4AN47NQ+fC6WM+Yd8k4Okzd 4aHUCOe5QlIW6cGyN2azCm6MYs2snKUmadc/xrUv25QqKJPvqSKVKbb/Qf3ut+Aa/mmU nmT4qOgPzUK3iUTqx8wKCkn/pSyQcOt5Q8nHuRPl57Y8g451zXZPSbkIa36L6KtrjdMS NVww== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=CrK2LUuF; 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 v3si1182157ejx.576.2020.10.27.08.08.03; Tue, 27 Oct 2020 08:08:35 -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=CrK2LUuF; 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 S2506179AbgJ0OHA (ORCPT + 99 others); Tue, 27 Oct 2020 10:07:00 -0400 Received: from mail.kernel.org ([198.145.29.99]:47426 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753375AbgJ0N76 (ORCPT ); Tue, 27 Oct 2020 09:59:58 -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 0293A2068D; Tue, 27 Oct 2020 13:59:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1603807198; bh=1hl3tSGkMvAO2zttaOP20rG5Ux1kiz5ts/NfBrKhXiY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=CrK2LUuFZZ4Y4baneZGvUAQ2GFDE66RTpvPSq1YvAusRuygdAtYXqOKInnEqf2ons kwbBowVsb5vuogmQUHyxIYC0vU95Ro4kLRv7t3OIYUjNjfdGdd3dmV69DD1Xpd+lMR csL5fYRU+k1ULr41c4zUrUVbwQVeef5HNe20fl18= 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.4 078/112] media: ati_remote: sanity check for both endpoints Date: Tue, 27 Oct 2020 14:49:48 +0100 Message-Id: <20201027134904.234334188@linuxfoundation.org> X-Mailer: git-send-email 2.29.1 In-Reply-To: <20201027134900.532249571@linuxfoundation.org> References: <20201027134900.532249571@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 a35631891cc00..3c3f4c4f6be40 100644 --- a/drivers/media/rc/ati_remote.c +++ b/drivers/media/rc/ati_remote.c @@ -843,6 +843,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