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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAHp75Vf8fOpyp0R+D5w0gYeVTAUOa+Qnb=16bT9LnpjyUk-JSg@mail.gmail.com>
Date:   Wed, 13 Jul 2022 14:51:25 +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>,
        Manu Gautam <manugautam@...gle.com>
Subject: Re: [PATCH v2] serial: 8250_dw: Avoid pslverr on reading empty
 receiver fifo

On Wed, Jul 13, 2022 at 2:43 PM Vamshi Gajjela <vamshigajjela@...gle.com> wrote:
>
> From: VAMSHI GAJJELA <vamshigajjela@...gle.com>
>
> With PSLVERR_RESP_EN parameter set to 1, the device generates an error
> response when an attempt to read an empty RBR with FIFO enabled.
>
> This happens when LCR writes are ignored when UART is busy.
> dw8250_check_lcr() in retries to update LCR, invokes dw8250_force_idle()
> to clear and reset FIFO and eventually reads UART_RX causing the error.
>
> Avoid this by not reading RBR/UART_RX when no data is available.

Thanks for an update!
My comments below.

...

> +       /*
> +        * With PSLVERR_RESP_EN parameter set to 1, the device generates an
> +        * error response when an attempt to read empty RBR with FIFO enabled.

an empty

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

I have just noticed that you do it independently on FIFO enablement.

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

I would recommend to move it inside the conditional

  if (fcr & FIFO) {
    lsr = ...
    if (!(lsr &))
      return;
  }

-- 
With Best Regards,
Andy Shevchenko

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ