Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp2140940iob; Thu, 5 May 2022 17:01:25 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxcQ0t4DfV75cn7GUvpDJ75aGGBL3cT5aTq/ZvOLEGPUDje+GuqtyOk4I87Byy7R/ICu3J5 X-Received: by 2002:a17:907:1623:b0:6df:c9da:a6a8 with SMTP id hb35-20020a170907162300b006dfc9daa6a8mr583146ejc.303.1651795284958; Thu, 05 May 2022 17:01:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1651795284; cv=none; d=google.com; s=arc-20160816; b=HUMPRvhV4TETCpnNRZAXn7NiHPTcVKVJ0Gg0R1KnMEqOJVCxJIKJtI0i9Th6i9VAG/ inyEPFjKLklokf3xYbtqWvorWIEcneQucfX38lRzlUW8H1wVygoblsoWmUfBjX+L8tZ/ tmCgrsnuVKJRvooBu+nFK/GPXToSkGYCoN8zP1WRDenEqpLGXbc4eFBeONm3sgfmiyYV Fawz0aIXQwu20GemG84IvaEa9KT7xc7Y0/Pvo1j1RH3ZoyFZdA2T4mWyZTx0JKmmdq2w VGEwOCswAeVxx9VUShgrngdYkeBP3e3Wx8WHk99kOAhWGxmNv/TCIjRmRBV7nD9jHlrA RNQQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=X1MoTa6hh8l5FNCL473BsTnzMY0UDEHLHNLPsYGKr5E=; b=HqOX3xcGt4uZw9rf8Wg1hbISvWK8Q2ppUOVN4Qr5l/LkcRxDzZc/O1mvVy86Tajb44 AYpYk7DBXU+YroB+OYQ8w4PM5cqSToDDeXKem+pvy0zlgyr3wxztgAOs4Af6o4c3bdMe oAccJrpiPrP/7mMraNwWGWdbggaMj4vzDndf/6XRgvJq0l2ZizLhaFR9zgHwqUqUQg6S Ze8lTibCQ9C1OhnB7HzxmCydhkLaMjO/OkJLTpApxjbzpRuR2RFtZKusFVAx9IQlxr17 rkGIxRgEHgqHIDSdcPADP56wRZ5y5H2x5K7XSw8cc58hkK54q3DzGq+mdKJZbph1qvpy HjSA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=eGJOJGwQ; 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 dr16-20020a170907721000b006f3c1c439f3si4074145ejc.595.2022.05.05.17.01.00; Thu, 05 May 2022 17:01:24 -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=eGJOJGwQ; 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 S1355528AbiEDRK0 (ORCPT + 99 others); Wed, 4 May 2022 13:10:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35638 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1355617AbiEDRAS (ORCPT ); Wed, 4 May 2022 13:00:18 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BFFA24BB83; Wed, 4 May 2022 09:51:56 -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 6349FB827AB; Wed, 4 May 2022 16:51:56 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0D6E2C385AF; Wed, 4 May 2022 16:51:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1651683115; bh=ajlyHJlXLFrefqDuXU+8CxL6cuBrNIB29dSZeCj6OZs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=eGJOJGwQP/yVY0YGYMeuj7BYKX7ef47nKhKMEpxX4F7fnx8En8DRoUFpf3Im7aYIF tyX/Hr0mEelRCV95nelyWM7J75nFFUgYv8sOvPvch7Fp2Q/w2nxM6N8s/H06tRfKvn VMJ5eEBIOTUKwsKT0DHaxdJLWdV8Av8/pUNzDSqQ= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Daniel Starke Subject: [PATCH 5.10 119/129] tty: n_gsm: fix malformed counter for out of frame data Date: Wed, 4 May 2022 18:45:11 +0200 Message-Id: <20220504153030.815398172@linuxfoundation.org> X-Mailer: git-send-email 2.36.0 In-Reply-To: <20220504153021.299025455@linuxfoundation.org> References: <20220504153021.299025455@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.7 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 From: Daniel Starke commit a24b4b2f660b7ddf3f484b37600bba382cb28a9d upstream. The gsm_mux field 'malformed' represents the number of malformed frames received. However, gsm1_receive() also increases this counter for any out of frame byte. Fix this by ignoring out of frame data for the malformed counter. Fixes: e1eaea46bb40 ("tty: n_gsm line discipline") Cc: stable@vger.kernel.org Signed-off-by: Daniel Starke Link: https://lore.kernel.org/r/20220414094225.4527-7-daniel.starke@siemens.com Signed-off-by: Greg Kroah-Hartman --- drivers/tty/n_gsm.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) --- a/drivers/tty/n_gsm.c +++ b/drivers/tty/n_gsm.c @@ -1968,7 +1968,8 @@ static void gsm1_receive(struct gsm_mux } /* Any partial frame was a runt so go back to start */ if (gsm->state != GSM_START) { - gsm->malformed++; + if (gsm->state != GSM_SEARCH) + gsm->malformed++; gsm->state = GSM_START; } /* A SOF in GSM_START means we are still reading idling or