Received: by 2002:a05:6a10:6d10:0:0:0:0 with SMTP id gq16csp987475pxb; Fri, 15 Apr 2022 17:30:51 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzY+3CVOp/dwScXbx+1SnxMhg7kZwqeQnVMro4nZNVaVT5RIjr5GxWPS6s/szmBqXvhx1fb X-Received: by 2002:a17:902:9b95:b0:151:533b:9197 with SMTP id y21-20020a1709029b9500b00151533b9197mr1532538plp.66.1650069050540; Fri, 15 Apr 2022 17:30:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1650069050; cv=none; d=google.com; s=arc-20160816; b=aC5DuA3rfi18WPUPOMPpILdMJ8k8hFU+ashhc+EmpTHkPW0zy0hx6KZtn9mma9B+JE tbVCxtMmDIncUATVKPNWNVv8R/Y5T4F5O/kUqjxp4PMzOC8g3DgtZia9zzCoM7ihfIGb UMlQcTgc7COVyYatnIJmkiMLjPhEwpyLF1FpsWKc/XxTs33cvQ9Pd7FphYdj41Uhdv3k 2ne+FrOMgkHK6s1B+cK8tYJjuYAXT8AYsqLu1jaQYnXsyTPYa9wIho/s7Srz+u7ShUWk bivqTBOYHGMAH0l9KGE80c8qmpd1C4uC7QvM4TNZdHoNf1+wo4MV1Md15YmnjbXtDygY bEgQ== 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=f8uJbWHJFFD5H0nRQNzeyT23Inb68+j9oWEKy5+IUAY=; b=Gk9Sa4mSm78OAHHeCQaad73qv0XsOsMxoX+CxZjQQqiOsB3s7anqZph/C/twCXq+KK 0yG/hSdfFUErnf4mAZpf1u6TkmVnaiS/Kjc5TxXTv9M35ZCWw1L9pIjP8RcTJBJp0gbw sitJUBU0GOQtfBrZXt4aFPl9uIehhcsu4ItIrcV6L4nszOYo8tCz3uCPA8m08DII+45G +Nc73kZeodlA6qrTIowd8pz6CKYDUSrXz4E0LnAnxg1nKcKPWoYiV4N0bxkhtPVsUccz Va5h5yI03DqcPC1T0/4viSrM4iGaet9XZWVVCNY6G7oIncRemzuWpegGmquppsXnhjjm FYBQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@siemens.com header.s=fm1 header.b=I7mzNPmz; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 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 lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id e6-20020a63f546000000b003816043eee0si2834347pgk.213.2022.04.15.17.30.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Apr 2022 17:30:50 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@siemens.com header.s=fm1 header.b=I7mzNPmz; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=siemens.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id A9F8A1FCED; Fri, 15 Apr 2022 17:28:03 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242053AbiDNJrg (ORCPT + 99 others); Thu, 14 Apr 2022 05:47:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40910 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241937AbiDNJqZ (ORCPT ); Thu, 14 Apr 2022 05:46:25 -0400 X-Greylist: delayed 62 seconds by postgrey-1.37 at lindbergh.monkeyblade.net; Thu, 14 Apr 2022 02:43:59 PDT Received: from mta-64-225.siemens.flowmailer.net (mta-64-225.siemens.flowmailer.net [185.136.64.225]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A817A710E5 for ; Thu, 14 Apr 2022 02:43:59 -0700 (PDT) Received: by mta-64-225.siemens.flowmailer.net with ESMTPSA id 20220414094251ea916a4daebbd414ec for ; Thu, 14 Apr 2022 11:42:56 +0200 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=f8uJbWHJFFD5H0nRQNzeyT23Inb68+j9oWEKy5+IUAY=; b=I7mzNPmzozsry4MOVnZMkFyf/U1JZ+6d22EcGOGGD4o8THOXWnESldSxfpZFOj65/fPmG7 g4Vo/dhpiTsyWZmEqDBahJpHfawG4L8SfICfbgC0CmHmpAM2RApmqrduULSlxQO5PIthYGKD /ojEZdEyMuYitAbJEhQG8AzwSCLao=; From: "D. Starke" To: linux-serial@vger.kernel.org, gregkh@linuxfoundation.org, jirislaby@kernel.org Cc: linux-kernel@vger.kernel.org, Daniel Starke Subject: [PATCH 16/20] tty: n_gsm: fix invalid command/response bit check for UI/UIH frames Date: Thu, 14 Apr 2022 02:42:21 -0700 Message-Id: <20220414094225.4527-16-daniel.starke@siemens.com> In-Reply-To: <20220414094225.4527-1-daniel.starke@siemens.com> References: <20220414094225.4527-1-daniel.starke@siemens.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Flowmailer-Platform: Siemens Feedback-ID: 519:519-314044:519-21489:flowmailer X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no 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 n_gsm is based on the 3GPP 07.010 and its newer version is the 3GPP 27.010. See https://portal.3gpp.org/desktopmodules/Specifications/SpecificationDetails.aspx?specificationId=1516 The changes from 07.010 to 27.010 are non-functional. Therefore, I refer to the newer 27.010 here. Chapter 5.4.3.1 states the CR bit in UI and UIH frames shall always be set 1 by the initiator and 0 by the responder. Currently, gsm_queue() has a pre-processor gated (excluded) check which treats all frames that conform to the standard as malformed frames. Remove this optional code to avoid confusion and possible breaking changes in case that someone includes it. Fixes: e1eaea46bb40 ("tty: n_gsm line discipline") Cc: stable@vger.kernel.org Signed-off-by: Daniel Starke --- drivers/tty/n_gsm.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/drivers/tty/n_gsm.c b/drivers/tty/n_gsm.c index e9a7d9483c1f..f4ec48c0d6d7 100644 --- a/drivers/tty/n_gsm.c +++ b/drivers/tty/n_gsm.c @@ -1896,10 +1896,6 @@ static void gsm_queue(struct gsm_mux *gsm) case UI|PF: case UIH: case UIH|PF: -#if 0 - if (cr) - goto invalid; -#endif if (dlci == NULL || dlci->state != DLCI_OPEN) { gsm_command(gsm, address, DM|PF); return; -- 2.25.1