Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp3094106rwb; Mon, 15 Aug 2022 17:59:23 -0700 (PDT) X-Google-Smtp-Source: AA6agR7mLvrQGM5hnwApyCm8MF7imRnE9cHbZJqZ2GiN3mMU8cjCR7WVVpN1EptqrkZtVL37MKPz X-Received: by 2002:a05:6402:1f87:b0:43b:b88d:1d93 with SMTP id c7-20020a0564021f8700b0043bb88d1d93mr16465649edc.314.1660611563765; Mon, 15 Aug 2022 17:59:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660611563; cv=none; d=google.com; s=arc-20160816; b=k/ifzcA5D720kezIIuBvhHKaGIOANEBOWiBV8ThV+xYp6knx831D4cLeLeCRyFgi2l Rnkn2VxE/GDE06agpgr+ZNr0NRmiHb+fK4/jSv+sE2R0wGtrMQF+9PGTImcGvSP6ZHLl uCbMoou4KzrF9+BAoqwYD3uIAHFR8lz4z83aN9ar38pvxbaljk/XgMBQy9kLIleo9hTm Jicpb+QXVJQbVOulAoGF8ZMjtBAe0Tr1FzkaKVFHRmWtasOrxn0rz6e6hBLcGWefAUQi FvsPHZ/wMy1K0f6SWyVaodsxSnGX0y5iSmlnh0Okjr9s1oEK/iKQK6x0bSala9nSZ0fC 4WIA== 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=fh3FT0YQHPpMrwBzoe2e1Tsbpcqe+kYhK93pPBKQ5ps=; b=0bn8WZr5uJp9HzPOUTXHnJJ+p6s4mQZORjT9r2NajJWq98w0Sl9+77jTTi3lvdyqsn zI4chwt9u9D0P8oxfxLHwTykXCXfMzO8AtK6zbrDPyDvrwYMjlR0DneOlcguqcqi0joa uaNtyI2VAciyJNF8QnGEgU8CKN/f5WVEnvXs75aUfZoNaFVQV3ffrsc2AgjWsipugoh4 PW6azPLh08Mi7m8F2c/QTFws9Kn27SvOz0rMZzoPyqFRQ0RH7QVPflaC//SHXwUJy3Fg bZayWhQhjzElh7d6na2d13oMnWbHcoyJIO41nuNvJbuuJ9FUmwnUaNleNGN35uF3ZTN+ l80g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=wUJE3lzU; 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 m13-20020a056402430d00b0043bb9893d78si9886474edc.246.2022.08.15.17.58.53; Mon, 15 Aug 2022 17:59:23 -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=wUJE3lzU; 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 S245323AbiHPApG (ORCPT + 99 others); Mon, 15 Aug 2022 20:45:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56552 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241202AbiHPAmR (ORCPT ); Mon, 15 Aug 2022 20:42:17 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6BF381741BE; Mon, 15 Aug 2022 13:40:06 -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 dfw.source.kernel.org (Postfix) with ESMTPS id 5836F61224; Mon, 15 Aug 2022 20:40:05 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4D30CC4314C; Mon, 15 Aug 2022 20:40:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1660596004; bh=GdfkdpBvj9sVvCzK3S/OAsYWaO2ZIAXgSq0UY6mnc2c=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=wUJE3lzUg1C9J+gxSlsHxNAiHXlOwsfidrfY2LN/H7qP2nzOGQJyCYgCYVqC8D6kb qan1A716miCSYetcnZFphZI56UCL2z5BnH/Rjg1ah3lcon3KuyDH0LZp9u63LkWMgH tooCJPAm7IjQk0HmOWuUmBGVMnogYGgb3PcT5MnA= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Daniel Starke , Sasha Levin Subject: [PATCH 5.19 0944/1157] tty: n_gsm: fix DM command Date: Mon, 15 Aug 2022 20:05:00 +0200 Message-Id: <20220815180517.311889638@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220815180439.416659447@linuxfoundation.org> References: <20220815180439.416659447@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 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 [ Upstream commit 18a948c7d90995d127785e308fa7b701df4c499f ] 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.3.3 defines the DM response. There exists no DM command. However, the current implementation incorrectly sends DM as command in case of unexpected UIH frames in gsm_queue(). Correct this behavior by always sending DM as response. Fixes: e1eaea46bb40 ("tty: n_gsm line discipline") Signed-off-by: Daniel Starke Link: https://lore.kernel.org/r/20220707113223.3685-2-daniel.starke@siemens.com Signed-off-by: Greg Kroah-Hartman Signed-off-by: Sasha Levin --- 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 1a70e7ae90cc..90060018928f 100644 --- a/drivers/tty/n_gsm.c +++ b/drivers/tty/n_gsm.c @@ -2207,7 +2207,7 @@ static void gsm_queue(struct gsm_mux *gsm) case UIH: case UIH|PF: if (dlci == NULL || dlci->state != DLCI_OPEN) { - gsm_command(gsm, address, DM|PF); + gsm_response(gsm, address, DM|PF); return; } dlci->data(dlci, gsm->buf, gsm->len); -- 2.35.1