Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp755202imu; Sat, 15 Dec 2018 06:42:09 -0800 (PST) X-Google-Smtp-Source: AFSGD/XvBaaxUWGkuarjmgBpwxWIoO+XzhAJNFodFnjC0nJTHj+vuYaAalxACyA+/TkB/xmq0nV8 X-Received: by 2002:a17:902:28e6:: with SMTP id f93mr6483962plb.239.1544884929176; Sat, 15 Dec 2018 06:42:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544884929; cv=none; d=google.com; s=arc-20160816; b=rqZBWbNLlg9fhNxXd7cQ/6W61sAXGTXbzsQuM2XZv3itMjrdZEVL/obZ+O/WSsryNR miZsWzACKkxN0Aqqbmq0M5sOLfEEN6pWh+WdUQ5iAEqqJS9tP5DDnYPfYZrbUkBIGgGY A4qe6s3NKkJIEIv48TfSNTMrwpWYLC9LifMv7kuY7Zni5LwompBg9vOBNWFjRafkfXEu JmuM8FF3HzFk09KJmsRLuXrTU5thQgQdg6HiGmuq9TtN4dtR7Y17+vLLniCwunhpA3en j0jAfhn7phitM8oeQr6M8lJsMBUk55OTD/bWv/Ey2RZPLN8AY/e1YkiExsK92iR5oYkf d6Xw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=uJfsKNaz6cJUpY7SuH4jPO302TH3/G1xAnJBHgkKu54=; b=djkHgQlb+9Qq1Bp4P7GjvTVRyd3mZlESfiBNuQ+Lf/YMBcc/QaiJxXtw8hb96wg+qx lqMIgaDUesticnNA4+h8ehD7I/tC3uVaR5BTr5hzuYeQGkZtXF3gGMQpnv+n1jDfmyYB p8U4ig7HRAYcDS+qKibBokTmjqOvieJihQGfwIrE+0Rdts0BJmcaLY5LguMb/zkYr+CG 20504VjzZlifKBV6CWgIrfDYZDvSG2J8M5Re+OUVY8rv7b/G7bRCBrWUhnGziQEZbmnI SMkp7vpuWymymrreChLJP+1TNcEID0NCDioRzc4Quk/Ou+g5GsT5EyikclIU/gIatfzJ Yd2g== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@uchuujin.de header.s=h header.b=Yk5piCHa; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 193si4532678pgc.220.2018.12.15.06.41.54; Sat, 15 Dec 2018 06:42:09 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@uchuujin.de header.s=h header.b=Yk5piCHa; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730495AbeLOOkx (ORCPT + 99 others); Sat, 15 Dec 2018 09:40:53 -0500 Received: from static.85-10-192-230.clients.your-server.de ([85.10.192.230]:48473 "EHLO mxout.uchuujin.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730145AbeLOOkv (ORCPT ); Sat, 15 Dec 2018 09:40:51 -0500 Received: by neutronstar.dyndns.org (Postfix, from userid 1000) id 598A91430BAF4; Sat, 15 Dec 2018 15:35:34 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=uchuujin.de; s=h; t=1544884534; bh=LIoCc86wGNbCgELiXdML6TEo8hELMxVteKpb++SJsQ0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Yk5piCHaE36xFzfwH+6cZtYWcAh3NJ5uRVaUXTC/y3nWKEXVBWPkvyg4lNdA9jjH6 4a8elP8xvC8lIVyI6zhYqzP4BQVNAn+3cqGnPK9mAdAdy5k+igAMuhciQtzE23rnhf 0VmcaHO16IvJKtDJ+1TIFY3ybtIM5PAwy7RQEJ+mx95X2kAHr+3naPN2pgDNOvUF7H fxcv8CCfBuY6p7jcBq7q1JXzDTdlXFeh7tfRaFX4xddeVSM27AlK2jceLrPj2a8Ujt QMI/sRt41Zs1Gpuh0DqfglJAwoxAcwADJfw60USnVbmPsyOOyU52HXWRPcuRSTySol z0qDtHtmBXHlg== From: Martin Hostettler To: Greg Kroah-Hartman , Jiri Slaby Cc: linux-kernel@vger.kernel.org, linux-api@vger.kernel.org, Nicolas Pitre , Adam Borowski , Egmont Koblinger , Martin Hostettler Subject: [PATCH 3/4] vt: ignore csi sequences with intermediate characters. Date: Sat, 15 Dec 2018 15:34:22 +0100 Message-Id: <20181215143423.4556-4-textshell@uchuujin.de> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20181215143423.4556-1-textshell@uchuujin.de> References: <20181215143423.4556-1-textshell@uchuujin.de> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Various csi sequences contain intermediate characters between the parameters and the final character. Introduce a additional state that cleanly ignores these sequences. This allows the vt to ignore these sequences used by more capable terminal implementations such as "request mode", etc. Signed-off-by: Martin Hostettler --- drivers/tty/vt/vt.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/drivers/tty/vt/vt.c b/drivers/tty/vt/vt.c index 448b4f6be7d1..24cd0e9c037b 100644 --- a/drivers/tty/vt/vt.c +++ b/drivers/tty/vt/vt.c @@ -2023,7 +2023,7 @@ static void restore_cur(struct vc_data *vc) } enum { ESnormal, ESesc, ESsquare, ESgetpars, ESfunckey, - EShash, ESsetG0, ESsetG1, ESpercent, ESignore, ESnonstd, + EShash, ESsetG0, ESsetG1, ESpercent, EScsiignore, ESnonstd, ESpalette, ESosc }; /* console_lock is held (except via vc_init()) */ @@ -2259,6 +2259,10 @@ static void do_con_trol(struct tty_struct *tty, struct vc_data *vc, int c) vc->vc_par[vc->vc_npar] += c - '0'; return; } + if (c >= 0x20 && c <= 0x2f) { + vc->vc_state = EScsiignore; + return; + } vc->vc_state = ESnormal; switch(c) { case 'h': @@ -2421,6 +2425,11 @@ static void do_con_trol(struct tty_struct *tty, struct vc_data *vc, int c) return; } return; + case EScsiignore: + if (c >= 20 && c <= 0x3f) + return; + vc->vc_state = ESnormal; + return; case ESpercent: vc->vc_state = ESnormal; switch (c) { -- 2.11.0