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]
Date:   Thu, 5 May 2022 22:56:05 +0200
From:   Greg KH <gregkh@...uxfoundation.org>
To:     Shubhrajyoti Datta <shubhrajyoti.datta@...inx.com>
Cc:     linux-serial@...r.kernel.org, michal.simek@...inx.com,
        jirislaby@...nel.org, git@...inx.com, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 7/7] serial: uartps: Prevent writes when the controller
 is disabled

On Fri, Apr 29, 2022 at 01:44:22PM +0530, Shubhrajyoti Datta wrote:
> Prevent writing to the fifo if the controller is disabled.
> 
> Signed-off-by: Shubhrajyoti Datta <shubhrajyoti.datta@...inx.com>
> ---
>  drivers/tty/serial/xilinx_uartps.c | 7 +++++++
>  1 file changed, 7 insertions(+)
> 
> diff --git a/drivers/tty/serial/xilinx_uartps.c b/drivers/tty/serial/xilinx_uartps.c
> index 81ba69c57716..f629c4ca940f 100644
> --- a/drivers/tty/serial/xilinx_uartps.c
> +++ b/drivers/tty/serial/xilinx_uartps.c
> @@ -1150,6 +1150,13 @@ static struct uart_driver cdns_uart_uart_driver;
>   */
>  static void cdns_uart_console_putchar(struct uart_port *port, unsigned char ch)
>  {
> +	unsigned int ctrl_reg;
> +
> +	ctrl_reg = readl(port->membase + CDNS_UART_CR);
> +	while (ctrl_reg & CDNS_UART_CR_TX_DIS) {
> +		ctrl_reg = readl(port->membase + CDNS_UART_CR);
> +		cpu_relax();

You are spinning for forever?  With no timeout possible?

That's not ok :(


> +	}
>  	while (readl(port->membase + CDNS_UART_SR) & CDNS_UART_SR_TXFULL)
>  		cpu_relax();

Ick, same here, you better hope your hardware works...

thanks,

greg k-h

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ