lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <f6190d39-6afe-4106-911e-00e93a7e0640@kernel.org>
Date:   Thu, 14 Dec 2023 13:10:07 +0100
From:   Jiri Slaby <jirislaby@...nel.org>
To:     Martin Hostettler <textshell@...uujin.de>,
        Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Cc:     linux-kernel@...r.kernel.org, linux-api@...r.kernel.org,
        Nicolas Pitre <nicolas.pitre@...aro.org>,
        Adam Borowski <kilobyte@...band.pl>,
        Egmont Koblinger <egmont@...il.com>
Subject: Re: [PATCH 3/4] vt: ignore csi sequences with intermediate
 characters.

On 15. 12. 18, 15:34, Martin Hostettler wrote:
> 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 <textshell@...uujin.de>
> ---
>   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)

Staring at the current code, I am confused as I cannot find out why 
"20". Was this supposed to be 0x20 (the same as above -- 0x20 is SPACE 
and that _is_ sensible)? Or why was this arbitrary 20 chosen?

thanks,
-- 
js
suse labs

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ