Received: by 2002:a05:6a10:7420:0:0:0:0 with SMTP id hk32csp360921pxb; Thu, 17 Feb 2022 05:52:28 -0800 (PST) X-Google-Smtp-Source: ABdhPJx85NnTNSSkooefbEus5MnzX7aMyiOVyDQAlB2e7K4c7gA8UjEPyPflpiYikP07gdWWkkSb X-Received: by 2002:a63:6982:0:b0:373:494a:22ae with SMTP id e124-20020a636982000000b00373494a22aemr2529524pgc.624.1645105947853; Thu, 17 Feb 2022 05:52:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1645105947; cv=none; d=google.com; s=arc-20160816; b=ySCjqwq4uyivw+fzoTTi45d2j14MxTgG2kA3OC18V3yTVIeIKoRfQAv9arM5TJj1cY lwxtQpoYcZDHmff177sWitN07IDmWcOway57DncRkm6iwl9/XOJVWfccVvBK8estxuIF heDzNefLoExkqQVIrClCAMD5k4qnNPXRj0UcLJyZpVFHiqtipMu04ZPNt0NwQPbgmU8t K34+91iWf8XxafNaDnsyH9nfz6Rc3FNgAaAFjfqPVnQijuepMySBIlWeAGPZsGeqVxgy g33/yeK58uJwJBn8p9/1x7g9CrKg//NjLWskBdlytl1RLdlShSo2/uCcY8fCqXbSCw0v 901g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:feedback-id:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=EBXVVXzuqxQZpJ7v89UZdV7W1f/O/+KXI4n9OYKaozE=; b=Pbmq3v4a0c33Ot2/perESG/i2tETuIja9KYS4QIbZmdcB4Kk/RM26Sw6lRRN2iOHIZ GP7yRtUzI5IBUkc7SPIU0xWcX+uvL4XPKLuwj77H/ZlOegPxsZlOuM+4BLb4LXgy5WRH cVpxZ4ymLm3YrxepwKF/0CT3LHd7hl9pkCleKXNiOr34kNQFnkOwvIhKIwX2w/wAyc2d D9vw3adSMYdJIV7CXp0XMXbAPfeXCoKIEp+gxSOtXBKsVF58RiAGsMLaIWQZECGBqgA/ SRWcFKDuIU8ToGtxjjY7sxtieDlzVewROqOVNg9N8I4D3DEm+1Y7zFCKXUbCWBkFW3zU bc8A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@siemens.com header.s=fm1 header.b=Gvc0xaBa; 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=siemens.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id u185si8111617pgd.16.2022.02.17.05.52.11; Thu, 17 Feb 2022 05:52:27 -0800 (PST) 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=@siemens.com header.s=fm1 header.b=Gvc0xaBa; 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=siemens.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237147AbiBQIHZ (ORCPT + 99 others); Thu, 17 Feb 2022 03:07:25 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:45356 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236654AbiBQIHR (ORCPT ); Thu, 17 Feb 2022 03:07:17 -0500 X-Greylist: delayed 63 seconds by postgrey-1.37 at lindbergh.monkeyblade.net; Thu, 17 Feb 2022 00:07:03 PST Received: from mta-65-225.siemens.flowmailer.net (mta-65-225.siemens.flowmailer.net [185.136.65.225]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AC58E27F284 for ; Thu, 17 Feb 2022 00:07:03 -0800 (PST) Received: by mta-65-225.siemens.flowmailer.net with ESMTPSA id 202202170805581c68e5c7bcb121dc76 for ; Thu, 17 Feb 2022 09:05:58 +0100 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; s=fm1; d=siemens.com; i=daniel.starke@siemens.com; h=Date:From:Subject:To:Message-ID:MIME-Version:Content-Type:Content-Transfer-Encoding:Cc:References:In-Reply-To; bh=EBXVVXzuqxQZpJ7v89UZdV7W1f/O/+KXI4n9OYKaozE=; b=Gvc0xaBa8FpmkroLJNMovvXkAUeiHmCYQDYbp8W33fqx4D4pYK1uyjV8f8Wuo7DaUWMN0u 6DgcRh0Qp7Y8PxJPOOYEPb+6ZFLQISgXMV8RGRpB8HV5imlRrELZTJ/h+ykDUHDLBbWOmamK jpAIEPzaYf6SFB684Mv24Ed4nnUOo=; From: daniel.starke@siemens.com To: linux-serial@vger.kernel.org, gregkh@linuxfoundation.org, jirislaby@kernel.org Cc: linux-kernel@vger.kernel.org, Daniel Starke Subject: [PATCH 1/1] tty: n_gsm: fix proper link termination after failed open Date: Thu, 17 Feb 2022 00:05:51 -0800 Message-Id: <20220217080555.5387-3-daniel.starke@siemens.com> In-Reply-To: <20220217080555.5387-1-daniel.starke@siemens.com> References: <20220217080555.5387-1-daniel.starke@siemens.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Flowmailer-Platform: Siemens Feedback-ID: 519:519-7517:519-21489:flowmailer X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H5,RCVD_IN_MSPIKE_WL,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 Trying to open a DLCI by sending a SABM frame may fail with a timeout. The link is closed on the initiator side without informing the responder about this event. The responder assumes the link is open after sending a UA frame to answer the SABM frame. The link gets stuck in a half open state. This patch fixes this by initiating the proper link termination procedure after link setup timeout instead of silently closing it down. Fixes: e1eaea46bb40 ("tty: n_gsm line discipline") Cc: stable@vger.kernel.org Signed-off-by: Daniel Starke --- drivers/tty/n_gsm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/tty/n_gsm.c b/drivers/tty/n_gsm.c index 0b1808e3a912..52224a3494a0 100644 --- a/drivers/tty/n_gsm.c +++ b/drivers/tty/n_gsm.c @@ -1514,7 +1514,7 @@ static void gsm_dlci_t1(struct timer_list *t) dlci->mode = DLCI_MODE_ADM; gsm_dlci_open(dlci); } else { - gsm_dlci_close(dlci); + gsm_dlci_begin_close(dlci); /* prevent half open link */ } break; -- 2.25.1