Received: by 2002:a05:6a10:7420:0:0:0:0 with SMTP id hk32csp1111087pxb; Fri, 18 Feb 2022 00:34:00 -0800 (PST) X-Google-Smtp-Source: ABdhPJxIce/5MAt7ArAsGhaAk5Po8jBOk0rDfR8WFGaghsniqkfytRt8U3tL0ZA4MxDCw/nngT8m X-Received: by 2002:a17:90b:3808:b0:1b6:76f:af50 with SMTP id mq8-20020a17090b380800b001b6076faf50mr11455953pjb.129.1645173240514; Fri, 18 Feb 2022 00:34:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1645173240; cv=none; d=google.com; s=arc-20160816; b=t4+69NAlfO18bj4D2jHXbfV6Iuy18xUqcjTSzlpRoTmcrnAZJytkXgls6KIJP/cNJi LpGOUldzArP6dGyBiEgeWkRrOxgk38nzap24A/DB3n0nVX9euQM39c8KOS9/0R+/7WAv mVlMUtJliF/cNsrTOznquzsEqLYAlrLnfem/Bla59kEzdogU1T6hJh3+NS+E8e4H0b8s ilXENtA0bQyZaxI2eRGTaGibOsnwP54XWW2eLuVhN+o3sZsMQkXx0JXOa151LzBkqtIr GIrqH3qQyiBqa4OPLymUwX7FTyNLnO3IHl2p1V07ZIfD6eabzbvdYtMPHGhNR/W+Qs73 qYqg== 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=ALHbKgO50a2iKx42FjKspanSZxRnXf9kk0thqs4dQOD9It6XdGG/nJCjsdbSqn92/l wxwVK90ee/11CV3jil0fT+qBio7qGQiTFh2R9VlkMz1Eo3vy5qD5v2qoCnieJYoc0x8I fSsn5gpU+ZtBc4M5T7/ovI/VkNn+o7SmprwHzak0CNR3uF/bLnXH+lys/qadsJw82FHN egWo7kRXvdqopqT8dDcHAWZ5RJeNRtgSkGrEHbTgqX3QZgM30Be+tjpp1mPlZFHnWvVS l4ATTTYEJZ0NMDuRiKDWXlBNmcA03L0y367EuSEsVScH40AwmvMBGUzgElSRswDkl4YJ Y6fQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@siemens.com header.s=fm1 header.b=eX9Xm9P7; 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 n20si1778359pfa.160.2022.02.18.00.33.46; Fri, 18 Feb 2022 00:34:00 -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=eX9Xm9P7; 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 S232098AbiBRHdD (ORCPT + 99 others); Fri, 18 Feb 2022 02:33:03 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:39318 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231599AbiBRHct (ORCPT ); Fri, 18 Feb 2022 02:32:49 -0500 X-Greylist: delayed 64 seconds by postgrey-1.37 at lindbergh.monkeyblade.net; Thu, 17 Feb 2022 23:32:33 PST Received: from mta-64-228.siemens.flowmailer.net (mta-64-228.siemens.flowmailer.net [185.136.64.228]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D1E3D291F95 for ; Thu, 17 Feb 2022 23:32:33 -0800 (PST) Received: by mta-64-228.siemens.flowmailer.net with ESMTPSA id 202202180731276cbb713a540644d188 for ; Fri, 18 Feb 2022 08:31:27 +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=eX9Xm9P7vjJCE2roMer44/L2/Azjd4/a22KhwDrLONyLD1Ln8GVkkzf+9A/mab16Q1yzIC eQv4aBZUIrzi4iBW81JLcn71RX0ALV1cr4jeR5cm54GGx6jyAWsVU18TFG75vA1bq2CtcPU6 pP69fzGbsL8dhalxTelUAmZ3VcFKE=; 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 3/7] tty: n_gsm: fix proper link termination after failed open Date: Thu, 17 Feb 2022 23:31:19 -0800 Message-Id: <20220218073123.2121-3-daniel.starke@siemens.com> In-Reply-To: <20220218073123.2121-1-daniel.starke@siemens.com> References: <20220218073123.2121-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