Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp228534rwl; Tue, 4 Apr 2023 22:50:39 -0700 (PDT) X-Google-Smtp-Source: AKy350YSW9mWoZtpIumHY4mofWiTBVNrvXUjUyJ4m42QkTQ4hy+kwjnu2NGciRV109rEHw29LMq/ X-Received: by 2002:a05:6a20:b71d:b0:df:2140:3b87 with SMTP id fg29-20020a056a20b71d00b000df21403b87mr4172104pzb.32.1680673839019; Tue, 04 Apr 2023 22:50:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680673839; cv=none; d=google.com; s=arc-20160816; b=r8Z6T5K4Gw/qDCrjn3ATVfxtsIlSbKf22kNFnA6oUPYIf8xnpxj+hE/ishwG9H2yFg Drbg1MKqH64n2IghgGlVc11Ro0fFF+1S8oZfJ0QqdwmBV/vicMJTwMfQ6ulylrqOmSwC HxFvezlAS8LmOfrxHjVhzGXmNz6mwcSzyE1zACGJTzl+ydaosbhn7M+lARq829OHPMGz pCMxA+/JO8mVlWbiYUskVg1BYv/6EwIzs94bsD37XmOPVkyXAh6MO6isVwDWmG6C1BM0 BBN+LvTEZSTYHNvVZt4QZetAyOJcUtkJJNfB3+fww139OSRxu9WIuzHO/qkbzIYtEZVa z6zQ== 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=uJwl9+ZDqP0Gge7uLTPceewqkWgzi1mhsOlMd09/Rek=; b=Y3PpfEb4VHwvAb1Hdt1771HAr5hM3MXUBrILtD8kWUry8tAn04tyDKx8tsyXaBxFAO xSpirkQ/HnfZSSPSVgkPPvoxmQ6Q51l3DMrk7b7J2dQE4D7f0DDzDtf8m2IZyjJhhmsj VrJEf1qckFiaoPN+2IPCBz2HRvFth3n0/uYqp/TBlI5SgivrHkam7b0zLb3Zzzq4aN9N y0oFyY6xbgIAN3jngSyk/N/8ASPrsyfBaiuOjVmJJ0RZpOEhudx7/wR04X0DjMc1tb9y ffbwQ+4rfGYHL6/nC3iX+Bop+2YCudOxKmhVAHdZZRwIWMKHEyBQAtZ5db20e/qJfMAr DQeQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@siemens.com header.s=fm1 header.b=JXWjQW5q; 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=REJECT sp=REJECT 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 n4-20020a635904000000b005136987a02esi11678935pgb.728.2023.04.04.22.50.27; Tue, 04 Apr 2023 22:50:38 -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=@siemens.com header.s=fm1 header.b=JXWjQW5q; 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=REJECT sp=REJECT dis=NONE) header.from=siemens.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236966AbjDEFtF (ORCPT + 99 others); Wed, 5 Apr 2023 01:49:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41752 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236914AbjDEFsp (ORCPT ); Wed, 5 Apr 2023 01:48:45 -0400 Received: from mta-64-226.siemens.flowmailer.net (mta-64-226.siemens.flowmailer.net [185.136.64.226]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1A5FA4209 for ; Tue, 4 Apr 2023 22:48:44 -0700 (PDT) Received: by mta-64-226.siemens.flowmailer.net with ESMTPSA id 202304050548413b6f5576ae346ac24b for ; Wed, 05 Apr 2023 07:48:41 +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=uJwl9+ZDqP0Gge7uLTPceewqkWgzi1mhsOlMd09/Rek=; b=JXWjQW5q8OoaEBEhqWxkx7OVJ7Uguem4duDJb8hts9xh1cc6h93WGQ4UqYil6K0aCTayT9 3BFKIU+j93dhtYG+VlHMyb5eDS40h/C7D5GAponp1aBSXlrD1jPDD6zCYEA7wxY30bVlvDM4 1p5h2cWc+zQQnWHH8DjbO+/kLC+I4=; From: "D. Starke" To: linux-serial@vger.kernel.org, gregkh@linuxfoundation.org, jirislaby@kernel.org, ilpo.jarvinen@linux.intel.com Cc: linux-kernel@vger.kernel.org, Daniel Starke Subject: [PATCH 6/9] tty: n_gsm: increase malformed counter for malformed control frames Date: Wed, 5 Apr 2023 07:47:27 +0200 Message-Id: <20230405054730.3850-6-daniel.starke@siemens.com> In-Reply-To: <20230405054730.3850-1-daniel.starke@siemens.com> References: <20230405054730.3850-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=-0.2 required=5.0 tests=DKIMWL_WL_MED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS, SPF_PASS autolearn=unavailable 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 The malformed counter in gsm_mux is already increased in case of errors detected in gsm_queue() and gsm1_receive(). gsm_dlci_command() also detects a case for a malformed frame but does not increase the malformed counter yet. Fix this by also increasing the gsm_mux malformed counter in case of a malformed frame in gsm_dlci_command(). Signed-off-by: Daniel Starke --- drivers/tty/n_gsm.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/tty/n_gsm.c b/drivers/tty/n_gsm.c index 9f6669686c59..317aa67ed169 100644 --- a/drivers/tty/n_gsm.c +++ b/drivers/tty/n_gsm.c @@ -2454,8 +2454,10 @@ static void gsm_dlci_command(struct gsm_dlci *dlci, const u8 *data, int len) data += dlen; /* Malformed command? */ - if (clen > len) + if (clen > len) { + dlci->gsm->malformed++; return; + } if (command & 1) gsm_control_message(dlci->gsm, command, data, clen); -- 2.34.1