Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp6015240ybc; Wed, 27 Nov 2019 13:26:11 -0800 (PST) X-Google-Smtp-Source: APXvYqwBuExl4L7AOCxN8Oh8n1mzdviQahZg3hQ6OHhSEQjYu1wwF640+1f58QAt1epr0FV7hbaV X-Received: by 2002:a17:906:edc4:: with SMTP id sb4mr3103496ejb.113.1574889970889; Wed, 27 Nov 2019 13:26:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1574889970; cv=none; d=google.com; s=arc-20160816; b=QQdeHxWf8ly8w8W4l5sKsnEdntOeH5fvukrIYZ4+1WsYORCDFtkL7AoFYmNMMK0bIz lgNRAdI8OON4HIUfZw3KpEtAWdDHgr3pB2+d/lhg9L91G/Z5wFV9cfx4fi8SvPY787Q5 0vfF3nwthjKSklPWbx4epBatt6nl2qNGggv5sxQ06bYsPK4XjyLozNsyuPe/ltwy7src odYGaguxVQtLgyQJVAxJeobSZ8yLo7sAjDKWZhMg4LYFLida8OL64K+szW45NBFlUQLK 6rwXbvrkRxdTHTW0fp/Q4pTQzliGUAqm8gxz6EUGTERefr4dOXV1bkazbcm0zWWbvxbz 6bmQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=Ph6KFKxTnyS7WmWI6ytIN0oZsn5blbRDrVw+1DEwWTc=; b=mbRKAuxqRpwbcmFv3PzSb7Z9JX+A+5V7UIl6wf7LlDB/lrtg5vXLNi7MfhoKCt7cMt 2pSIyg1J6Gyqrp0eSbajNNKS4M9sjwekJUAvKtwre7gnzM6bit/M1y2kWrbqOGWNNTOx Buhw6YYu1F+LZWF7tWDypcEIDMhbdanWPw/Ena6D6ts+5fGX2bAJ8xPH1MqT/vgYOpxN nStWN7z+lesLkWYaFenSXXjV6J1EA67y6U9kBoVsXLO2txxX0oCCjQikscUJErFqJ+bU nnTpuo+nrkLsoUvVykPmd3/QeTUhSDqmPXFl3xiZqSmCcUtzr45y7ud5gtfIDsMKz8+p ZyWA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=lbau14lc; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g21si207829ejr.195.2019.11.27.13.25.46; Wed, 27 Nov 2019 13:26:10 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=lbau14lc; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732573AbfK0VHR (ORCPT + 99 others); Wed, 27 Nov 2019 16:07:17 -0500 Received: from mail.kernel.org ([198.145.29.99]:33312 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732568AbfK0VHN (ORCPT ); Wed, 27 Nov 2019 16:07:13 -0500 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (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 0AFD5217D6; Wed, 27 Nov 2019 21:07:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1574888832; bh=aJqLwpf/G8NqfB0sL2MWBrc35kuUJFRONfEAYaqxE9U=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=lbau14lcPSfR25RI4CwdoWsZRL0LloII3/VVyViadOahXMg0xGBgwll2NE9j8vbU7 q+LiU8mVDzio4vcU2gSUp/tJAWjkNiivVi1agIQsVSFmeCln+2Vh2ybrU6kdNdpPPl AIxBMmrFsVevb6XiPtStWRR2yvDnLd0gzodmZFAk= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, syzbot+d93dff37e6a89431c158@syzkaller.appspotmail.com, Oliver Neukum , Sean Young , Mauro Carvalho Chehab Subject: [PATCH 4.19 288/306] media: b2c2-flexcop-usb: add sanity checking Date: Wed, 27 Nov 2019 21:32:18 +0100 Message-Id: <20191127203135.815814577@linuxfoundation.org> X-Mailer: git-send-email 2.24.0 In-Reply-To: <20191127203114.766709977@linuxfoundation.org> References: <20191127203114.766709977@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Oliver Neukum commit 1b976fc6d684e3282914cdbe7a8d68fdce19095c upstream. The driver needs an isochronous endpoint to be present. It will oops in its absence. Add checking for it. Reported-by: syzbot+d93dff37e6a89431c158@syzkaller.appspotmail.com Signed-off-by: Oliver Neukum Signed-off-by: Sean Young Signed-off-by: Mauro Carvalho Chehab Signed-off-by: Greg Kroah-Hartman --- drivers/media/usb/b2c2/flexcop-usb.c | 3 +++ 1 file changed, 3 insertions(+) --- a/drivers/media/usb/b2c2/flexcop-usb.c +++ b/drivers/media/usb/b2c2/flexcop-usb.c @@ -537,6 +537,9 @@ static int flexcop_usb_probe(struct usb_ struct flexcop_device *fc = NULL; int ret; + if (intf->cur_altsetting->desc.bNumEndpoints < 1) + return -ENODEV; + if ((fc = flexcop_device_kmalloc(sizeof(struct flexcop_usb))) == NULL) { err("out of memory\n"); return -ENOMEM;