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: <66df725d-be75-a0df-2118-a99c71be6c41@linux.intel.com>
Date:   Wed, 15 Jun 2022 13:29:41 +0300 (EEST)
From:   Ilpo Järvinen <ilpo.jarvinen@...ux.intel.com>
To:     Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
cc:     linux-serial <linux-serial@...r.kernel.org>,
        Greg KH <gregkh@...uxfoundation.org>,
        Jiri Slaby <jirislaby@...nel.org>,
        LKML <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH 2/3] serial: 8250_dw: Take port lock while accessing
 LSR

On Wed, 15 Jun 2022, Andy Shevchenko wrote:

> On Wed, Jun 15, 2022 at 12:06:50PM +0300, Ilpo Järvinen wrote:
> > Accessing LSR requires port lock because it mutates lsr_saved_flags
> > in serial_lsr_in().
> 
> I got this as patch 2/3, where are the 1/3 and 3/3?

That's probably because get_maintainer.pl didn't pick you up for the other 
patches and I didn't explicitly send them to you. Here they are:

https://lore.kernel.org/linux-serial/20220615090651.15340-1-ilpo.jarvinen@linux.intel.com/T/#t

> > @@ -266,7 +266,10 @@ static int dw8250_handle_irq(struct uart_port *p)
> >  
> >  	/* Manually stop the Rx DMA transfer when acting as flow controller */
> >  	if (quirks & DW_UART_QUIRK_IS_DMA_FC && up->dma && up->dma->rx_running && rx_timeout) {
> > +		spin_lock_irqsave(&p->lock, flags);
> >  		status = serial_lsr_in(up);
> > +		spin_unlock_irqrestore(&p->lock, flags);
> 
> This reminds me the question, why do we need to save flags here? Aren't we in
> IRQ context already? (Perhaps another patch might be issued.)

Currently serial8250_handle_irq() reads from LSR again. I guess it would 
be possible to read LSR only once and pass it as a parameter. It would 
require some rework though.

-- 
 i.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ