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: <CAHp75VecnJSv9P4ZXf5g4Yi7rYySRN=73KwZ_OBFUyFtaSq00w@mail.gmail.com>
Date:   Tue, 12 Jul 2022 15:25:57 +0200
From:   Andy Shevchenko <andy.shevchenko@...il.com>
To:     Vamshi Gajjela <vamshigajjela@...gle.com>
Cc:     Andy Shevchenko <andriy.shevchenko@...ux.intel.com>,
        Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
        Jiri Slaby <jirislaby@...nel.org>,
        Miquel Raynal <miquel.raynal@...tlin.com>,
        Phil Edworthy <phil.edworthy@...esas.com>,
        Emil Renner Berthing <kernel@...il.dk>,
        Heikki Krogerus <heikki.krogerus@...ux.intel.com>,
        Johan Hovold <johan@...nel.org>,
        "open list:SERIAL DRIVERS" <linux-serial@...r.kernel.org>,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] serial: 8250_dw: Avoid pslverr on reading empty receiver fifo

On Tue, Jul 12, 2022 at 3:16 PM Vamshi Gajjela <vamshigajjela@...gle.com> wrote:
>
> From: VAMSHI GAJJELA <vamshigajjela@...gle.com>
>
> With PSLVERR_RESP_EN parameter set to 1, device generates an error

the device

> response when an attempt to read empty RBR with FIFO enabled.

an empty

> This happens when LCR writes are ignored when UART is busy.
> dw8250_check_lcr() in retries to updateLCR, invokes dw8250_force_idle()
> to clear and reset fifo and eventually reads UART_RX causing pslverr.

fifo --> FIFO
pslverr --> the error

> Avoid this by not reading RBR/UART_RX when no data is available.

...

> +       unsigned int lsr;
>         struct uart_8250_port *up = up_to_u8250p(p);

Can we keep it ordered according to the reversed xmas tree?

...

> +       /*
> +        * With PSLVERR_RESP_EN parameter set to 1, device generates pslverr

the device
pslverr --> an

> +        * error response when an attempt to read empty RBR with FIFO enabled

Missed period.

> +        */
> +       lsr = p->serial_in(p, UART_LSR);

The only caller of this function already has the lsr value, why you
can't (re)use it?

> +       if ((up->fcr & UART_FCR_ENABLE_FIFO) && !(lsr & UART_LSR_DR))
> +               return;

-- 
With Best Regards,
Andy Shevchenko

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ