Received: by 2002:a05:7412:a9a2:b0:e2:908c:2ebd with SMTP id o34csp274049rdh; Thu, 26 Oct 2023 01:34:52 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFjkbhW75m8Jgu5QL8ZeucctPs/BY/JiaHtlLQxJp/obQTgIQWAce1Ko9M1N/0DGMgX7gVY X-Received: by 2002:a25:5543:0:b0:da0:4ba8:35fe with SMTP id j64-20020a255543000000b00da04ba835femr6566919ybb.60.1698309291936; Thu, 26 Oct 2023 01:34:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698309291; cv=none; d=google.com; s=arc-20160816; b=skFxoJrMvzRKnIBSCl28D8oP0j9a7WBWFf+n0auOOlpzwS6RRzh8zFpx9BLXOiuc92 Ekfrtt3uwA35a9I6zZhSrY3q+urzTXQuqk/qA4/3eQ4VV8RbHbYdXyFlr/SDyrL/RKr7 HFcqH5vWwCUYL5OQ5D36gcLVP3peUsZwwradUdk1pCh4qflqZeCI1fC/h7tmMCeqakNF MwRScxLhOhN//XQ6eRTbpFfPItTKQnZfxCFkdfEmNpkUHa/od5YVkEBJmS/pAyv81Emk QWFvMc8Pdoxa2oEe/KPKszHPcCShdFt/KHiK3S7ee6TSTDYD1OQmrmHMz8//prqv7g6n 7xNw== 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=Nu5KVF/97fN+TofBTkwp6qLtLd2lz5z36qAHALsheuI=; fh=O3CiaO8dzyJph/Yrz/ekDO0xgM+6figpV76YOp50JjE=; b=nU6In8+hWb657zEQLq7PsCU53ASV0EDoDfMLHlhjiyXLBO+J8BoQWf8GtkkwHtNMjd HGSeDNKo1+vWFboyZ2xrPpZ3WEOk71nI1Vopq4p1+JW2L2on52Sb9Y3xty8mz48SOpda GGb3hhRG9EgFcDxhPIj1NeWmC7nAl4hW6uaryxOadJmQLNsXMhBK7m/6XwklHCfYX1vT gj4uB2w3DaXKnfL+deE+jEj0zO9fhpK+kpFzU3PSQk9tRdvVeAnQSbfSiaeF4B7muWhJ FadhiYmrwOupTbTNUlM4sQOGAa5iEdpEFUq+9SetBExHhAvwPMW7FasaprkR2U9bhEnw vYKw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=LKAkahQk; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 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 snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id b74-20020a25cb4d000000b00d9adcc59471si14885409ybg.33.2023.10.26.01.34.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Oct 2023 01:34:51 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=LKAkahQk; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id B7D68820E503; Thu, 26 Oct 2023 01:34:50 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344496AbjJZIes (ORCPT + 99 others); Thu, 26 Oct 2023 04:34:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53338 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229642AbjJZIer (ORCPT ); Thu, 26 Oct 2023 04:34:47 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8E11D10E; Thu, 26 Oct 2023 01:34:45 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9786BC433C7; Thu, 26 Oct 2023 08:34:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1698309285; bh=FV3diMI1a5dHegpEaNtjUtGyFkoRaorH2cPnA/vaaNo=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=LKAkahQkqyu8qLGqCGffaR09FeiP3zZ6tzK5ilDK7/k3fKEe1Z7pxwRqNSVOmLNJo i1sjyKGrumCfVflrMHU+qWSLEqmA+9hNz4ZDmhTyjO0ZQdWdyXu1TWAVVOKu2lXRpr vCKGM2Zqggn89EfCpfCZBbzxzd5pWfTDvkR1phMc= Date: Thu, 26 Oct 2023 10:34:40 +0200 From: Greg KH To: "D. Starke" Cc: linux-serial@vger.kernel.org, jirislaby@kernel.org, ilpo.jarvinen@linux.intel.com, linux-kernel@vger.kernel.org Subject: Re: [PATCH 1/2] tty: n_gsm: fix race condition in status line change on dead connections Message-ID: <2023102615-psychic-manger-5c48@gregkh> References: <20231026055844.3127-1-daniel.starke@siemens.com> <2023102629-onward-bust-d049@gregkh> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <2023102629-onward-bust-d049@gregkh> X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED 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 X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Thu, 26 Oct 2023 01:34:50 -0700 (PDT) On Thu, Oct 26, 2023 at 10:27:37AM +0200, Greg KH wrote: > On Thu, Oct 26, 2023 at 07:58:43AM +0200, D. Starke wrote: > > From: Daniel Starke > > > > gsm_cleanup_mux() cleans up the gsm by closing all DLCIs, stopping all > > timers, removing the virtual tty devices and clearing the data queues. > > This procedure, however, may cause subsequent changes of the virtual modem > > status lines of a DLCI. More data is being added the outgoing data queue > > and the deleted kick timer is restarted to handle this. At this point many > > resources have already been removed by the cleanup procedure. Thus, a > > kernel panic occurs. > > > > Fix this by proving in gsm_modem_update() that the cleanup procedure has > > not been started and the mux is still alive. > > > > Note that writing to a virtual tty is already protected by checks against > > the DLCI specific connection state. > > > > Fixes: c568f7086c6e ("tty: n_gsm: fix missing timer to handle stalled links") > > Signed-off-by: Daniel Starke > > --- > > drivers/tty/n_gsm.c | 2 ++ > > 1 file changed, 2 insertions(+) > > > > diff --git a/drivers/tty/n_gsm.c b/drivers/tty/n_gsm.c > > index 1f3aba607cd5..0ee7531c9201 100644 > > --- a/drivers/tty/n_gsm.c > > +++ b/drivers/tty/n_gsm.c > > @@ -4108,6 +4108,8 @@ static int gsm_modem_upd_via_msc(struct gsm_dlci *dlci, u8 brk) > > > > static int gsm_modem_update(struct gsm_dlci *dlci, u8 brk) > > { > > + if (dlci->gsm->dead) > > + return -EL2HLT; > > if (dlci->adaption == 2) { > > /* Send convergence layer type 2 empty data frame. */ > > gsm_modem_upd_via_data(dlci, brk); > > -- > > 2.34.1 > > > > Hi, > > This is the friendly patch-bot of Greg Kroah-Hartman. You have sent him > a patch that has triggered this response. He used to manually respond > to these common problems, but in order to save his sanity (he kept > writing the same thing over and over, yet to different people), I was > created. Hopefully you will not take offence and will fix the problem > in your patch and resubmit it so that it can be accepted into the Linux > kernel tree. > > You are receiving this message because of the following common error(s) > as indicated below: > > - You have marked a patch with a "Fixes:" tag for a commit that is in an > older released kernel, yet you do not have a cc: stable line in the > signed-off-by area at all, which means that the patch will not be > applied to any older kernel releases. To properly fix this, please > follow the documented rules in the > Documentation/process/stable-kernel-rules.rst file for how to resolve > this. > > If you wish to discuss this problem further, or you have questions about > how to resolve this issue, please feel free to respond to this email and > Greg will reply once he has dug out from the pending patches received > from other developers. > Note, I'll take this now, and add the tag by hand, just try to remember it for the future. thanks, greg k-h