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: <CAMuHMdU4_==x7efMMOmxm3L4vZeWGeeWNo2bQ8Pv1wWx7246gQ@mail.gmail.com>
Date: Wed, 6 Dec 2023 09:27:36 +0100
From: Geert Uytterhoeven <geert@...ux-m68k.org>
To: "Jiri Slaby (SUSE)" <jirislaby@...nel.org>
Cc: gregkh@...uxfoundation.org, linux-serial@...r.kernel.org, 
	linux-kernel@...r.kernel.org, Karsten Keil <isdn@...ux-pingi.de>, 
	Ulf Hansson <ulf.hansson@...aro.org>, Marcel Holtmann <marcel@...tmann.org>, 
	Johan Hedberg <johan.hedberg@...il.com>, Luiz Augusto von Dentz <luiz.dentz@...il.com>, netdev@...r.kernel.org, 
	linux-mmc@...r.kernel.org, linux-bluetooth@...r.kernel.org, 
	linux-m68k <linux-m68k@...ts.linux-m68k.org>
Subject: Re: [PATCH 04/27] tty: make tty_operations::send_xchar accept u8 char

CC linux-m68k

On Wed, Dec 6, 2023 at 8:37 AM Jiri Slaby (SUSE) <jirislaby@...nel.org> wrote:
> tty_operations::send_xchar is one of the last users of 'char' type for
> characters in the tty layer. Convert it to u8 now.
>
> Signed-off-by: Jiri Slaby (SUSE) <jirislaby@...nel.org>

>  drivers/tty/amiserial.c          | 2 +-

Reviewed-by: Geert Uytterhoeven <geert@...ux-m68k.org>

> --- a/drivers/tty/amiserial.c
> +++ b/drivers/tty/amiserial.c
> @@ -811,7 +811,7 @@ static void rs_flush_buffer(struct tty_struct *tty)
>   * This function is used to send a high-priority XON/XOFF character to
>   * the device
>   */
> -static void rs_send_xchar(struct tty_struct *tty, char ch)
> +static void rs_send_xchar(struct tty_struct *tty, u8 ch)
>  {
>         struct serial_state *info = tty->driver_data;
>          unsigned long flags;

Looks like this might fix an actual (harmless?) bug, if anyone evers
configures a VSTOP or VSTART character with bit 7 set?

    info->x_char = ch; // x_char is int, hence sign-extended

transmit_chars() does:

    amiga_custom.serdat = info->x_char | 0x100;

which will inadvertently have all high bits sets, including the bit
9, which is only used if PARENB is enabled.  But as it looks like
PARENB handling is broken in amiseral anyway, this doesn't matter
much...

include/linux/tty.h:#define STOP_CHAR(tty) ((tty)->termios.c_cc[VSTOP])
include/linux/tty.h:#define START_CHAR(tty) ((tty)->termios.c_cc[VSTART])

Gr{oetje,eeting}s,

                        Geert

-- 
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@...ux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ