Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp1634217rwb; Sun, 14 Aug 2022 08:22:59 -0700 (PDT) X-Google-Smtp-Source: AA6agR6/onvxh5x/KtV95CLU/L7LCkb75Fuxy8or62J8Wv/1lOyg+1VsPOwfM7GucDkEC+9xdcLC X-Received: by 2002:a05:6402:1f87:b0:43b:b88d:1d93 with SMTP id c7-20020a0564021f8700b0043bb88d1d93mr11022479edc.314.1660490579018; Sun, 14 Aug 2022 08:22:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660490579; cv=none; d=google.com; s=arc-20160816; b=f3yrm1h+Bef0SjuvR/8bd9lDEar1IQvYHbL9HZRiBbZwYbYYVERcgdxOyaSngnauGJ e+NJOOKxDxs6V6MqqKjBuV9bcITX9UM/jWHPLJUcSUu8iQdjIRqunwaYu4UbQlaT7MYx LgBj+vKiVAnWf7sBJ9hMocrfKT22cqyKCwjReShctVbV7F2GBB7MlKNugZ7Ifq/dtiEh NgxYkYWH2ctaqYcJ+U7UCeoRLm+9htbaF43GKlwn247X2NYVjiNuowYoTiQ/d3uKkAev QnTGAI6Il62R65YUqRtIfM8NX5rVEd2W3hTwkNWz7UC28p7uuY+FSXuirK3vS1C2x33r bSZw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=QnPphj6OuQQPDf3oADN3E/c6LJIldYBr98a2ElTFfSw=; b=y5Ndo4fus/VqgCJQeulOemWhhcckDOyV35BHuFfdBYpUFCX798ge76TYtqZNpvqPJ2 K0ezrLOQYO9BaYfFuBcrMQ6zYHqVtNRtAweAzqAdDGF5sMEVewvIe2li5Lg0wQwP5CFl FuvW3+8tb1Fcd7KRUwTSZ+yEaJpvtKn1d6wA0Qp+od+i1xYXtRyPUybbtOXaT1LyKg1c 9xyCjOpP0lj1WiBw7yQsKaXEcS0e4qhqLiizgOmiNrw7jK9Sulgk9QGOA6UP7Iv6RGuA RlD101Az/dEprZUvbPB4jph8hOYBh7T0i7BIRwSe1gW0OPdLKwePCUh2r4LtWz7y5wjv ib1Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=sqeP+WC8; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id jx16-20020a170906ca5000b0073045eed224si5230206ejb.419.2022.08.14.08.22.33; Sun, 14 Aug 2022 08:22:59 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=sqeP+WC8; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229652AbiHNOpP (ORCPT + 99 others); Sun, 14 Aug 2022 10:45:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58880 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229558AbiHNOpM (ORCPT ); Sun, 14 Aug 2022 10:45:12 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 36B9D13D0D; Sun, 14 Aug 2022 07:45:12 -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 dfw.source.kernel.org (Postfix) with ESMTPS id CA30D60BCA; Sun, 14 Aug 2022 14:45:11 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9C3E6C433D7; Sun, 14 Aug 2022 14:45:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1660488311; bh=iMBFg6BfWJyRlJEWO3cnG3IzMydQoIwzayCIiqd/lL4=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=sqeP+WC8M3JPUEoMmWj9BuYa9NwUVS63OcZXLi7LrnZLJ/ZMHBPJSBSTzBMMFyQ8Q AWGUg0MjUaViHFgDo2SClIfVd4OgYIBEuE2LKawXPrbmReif6bx3SpGya7it7fPc4Z TgjBMDMQ0uy3vNs6iL5XizwfeEcsNAZ0+atGvUUE= Date: Sun, 14 Aug 2022 16:45:08 +0200 From: Greg KH To: Gautam Menghani Cc: sean@mess.org, mchehab@kernel.org, hdanton@sina.com, linux-kernel@vger.kernel.org, syzbot+0c3cb6dc05fbbdc3ad66@syzkaller.appspotmail.com, linux-kernel-mentees@lists.linuxfoundation.org, linux-media@vger.kernel.org Subject: Re: [PATCH] drivers/media/rc: Ensure usb_submit_urb() is not called if write is in progress Message-ID: References: <20220814142543.24910-1-gautammenghani201@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220814142543.24910-1-gautammenghani201@gmail.com> X-Spam-Status: No, score=-7.2 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, Aug 14, 2022 at 07:55:42PM +0530, Gautam Menghani wrote: > The warning "URB submitted while active" is reported if the function > send_packet() in imon.c is called if a write is already is in progress. > Add a check to return -EBUSY in case a write is already is in progress. > Also, mark tx.busy as false after transmission is completed. > > Fixes: 21677cfc562a ("V4L/DVB: ir-core: add imon driver") > Cc: hdanton@sina.com > Suggested-by: hdanton@sina.com > Link: https://syzkaller.appspot.com/bug?id=e378e6a51fbe6c5cc43e34f131cc9a315ef0337e > Reported-by: syzbot+0c3cb6dc05fbbdc3ad66@syzkaller.appspotmail.com > Signed-off-by: Gautam Menghani > --- > drivers/media/rc/imon.c | 3 +++ > 1 file changed, 3 insertions(+) > > diff --git a/drivers/media/rc/imon.c b/drivers/media/rc/imon.c > index 735b925da998..a5b997c2c7e2 100644 > --- a/drivers/media/rc/imon.c > +++ b/drivers/media/rc/imon.c > @@ -598,6 +598,8 @@ static int send_packet(struct imon_context *ictx) > int retval = 0; > struct usb_ctrlrequest *control_req = NULL; > > + if (ictx->tx.busy) > + return -EBUSY; What happens if we go busy right after this check? Where is the locking here to protect this? thanks, greg k-h