From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id CC440C433EF for ; Mon, 11 Jul 2022 10:40:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229813AbiGKKkw (ORCPT ); Mon, 11 Jul 2022 06:40:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52680 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229687AbiGKKkh (ORCPT ); Mon, 11 Jul 2022 06:40:37 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7812941D19; Mon, 11 Jul 2022 02:49:08 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id CAFA0B80E7F; Mon, 11 Jul 2022 09:49:06 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 87566C34115; Mon, 11 Jul 2022 09:49:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1657532945; bh=Bcrn+Ht8XgMok5yKFUWEZ0ZpHn+vZRkiMqyjeeMZ8oo=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=KLoO4otbf4O21ONGYCKKEBa3An0pyLc/+YZbbXUu9J6bUPcHhJswM4nstlnVkqPMl eoS9I5iE5PaLe9MQeedyddnZnmyc7dVRRUbxwQIrtus6J7uE3Ukk+eXxVhsfnhW9N1 gRfILnGQXMdf7toATPxiXsSAsmZkjwJSKkBI3EW4LVDs0uCy1LKuS88k/q5vet/e7z FnasEWb8fVo6C1141pU2zTzWY0r34uCOV9d8LP407Yot+/IAkYbj9/EoI+9+jclLUZ XsZqgwJjsFD1EtNjAsEQvmmIFGw1WZld38WQGj+d9nfPQka9jvdgWoRUlhVSmFDX/T ErxmpVfgTRODg== Received: from johan by xi.lan with local (Exim 4.94.2) (envelope-from ) id 1oAq2L-0006mg-KV; Mon, 11 Jul 2022 11:49:06 +0200 Date: Mon, 11 Jul 2022 11:49:05 +0200 From: Johan Hovold To: Mauro Carvalho Chehab , Hans Verkuil Cc: Sean Young , linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, Oliver Neukum , stable@vger.kernel.org, Dongliang Mu Subject: Re: [PATCH] media: flexcop-usb: fix endpoint type check Message-ID: References: <20220609135341.19941-1-johan@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220609135341.19941-1-johan@kernel.org> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jun 09, 2022 at 03:53:41PM +0200, Johan Hovold wrote: > Commit d725d20e81c2 ("media: flexcop-usb: sanity checking of endpoint > type") tried to add an endpoint type sanity check for the single > isochronous endpoint but instead broke the driver by checking the wrong > descriptor or random data beyond the last endpoint descriptor. > > Make sure to check the right endpoint descriptor. > > Fixes: d725d20e81c2 ("media: flexcop-usb: sanity checking of endpoint type") > Cc: Oliver Neukum > Cc: stable@vger.kernel.org # 5.9 > Reported-by: Dongliang Mu > Signed-off-by: Johan Hovold > --- I haven't received any notification about this one being added to any tree and the status is still set to "NEW" in the patch tracker so sending a reminder. > drivers/media/usb/b2c2/flexcop-usb.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/media/usb/b2c2/flexcop-usb.c b/drivers/media/usb/b2c2/flexcop-usb.c > index 7835bb0f32fc..e012b21c4fd7 100644 > --- a/drivers/media/usb/b2c2/flexcop-usb.c > +++ b/drivers/media/usb/b2c2/flexcop-usb.c > @@ -511,7 +511,7 @@ static int flexcop_usb_init(struct flexcop_usb *fc_usb) > > if (fc_usb->uintf->cur_altsetting->desc.bNumEndpoints < 1) > return -ENODEV; > - if (!usb_endpoint_is_isoc_in(&fc_usb->uintf->cur_altsetting->endpoint[1].desc)) > + if (!usb_endpoint_is_isoc_in(&fc_usb->uintf->cur_altsetting->endpoint[0].desc)) > return -ENODEV; > > switch (fc_usb->udev->speed) { Johan