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: <f4fe790b-8dcd-1002-f6cd-0fbf451d28e1@linux.intel.com>
Date: Tue, 6 May 2025 15:08:46 +0300 (EEST)
From: Ilpo Järvinen <ilpo.jarvinen@...ux.intel.com>
To: Yunhui Cui <cuiyunhui@...edance.com>
cc: arnd@...db.de, Andy Shevchenko <andriy.shevchenko@...ux.intel.com>, 
    benjamin.larsson@...exis.eu, 
    Greg Kroah-Hartman <gregkh@...uxfoundation.org>, 
    heikki.krogerus@...ux.intel.com, Jiri Slaby <jirislaby@...nel.org>, 
    jkeeping@...usicbrands.com, john.ogness@...utronix.de, 
    LKML <linux-kernel@...r.kernel.org>, 
    linux-serial <linux-serial@...r.kernel.org>, markus.mayer@...aro.org, 
    matt.porter@...aro.org, namcao@...utronix.de, paulmck@...nel.org, 
    pmladek@...e.com, schnelle@...ux.ibm.com, sunilvl@...tanamicro.com, 
    tim.kryger@...aro.org
Subject: Re: [PATCH v5 3/4] serial: 8250_dw: warning on entering dw8250_force_idle
 unlocked

Also, you should also improve the shortlog (in Subject) to something less 
vague, e.g.:

serial: 8250_dw: assert port->lock is held in dw8250_force_idle()

On Tue, 6 May 2025, Ilpo Järvinen wrote:
> On Tue, 6 May 2025, Yunhui Cui wrote:
> 
> > Read UART_RX and check UART_LSR_DR in critical section. Unsure if
> 
> Unsure if -> Ensure the
> 
> > caller of dw8250_force_idle() holds port->lock. Don't acquire it
> > directly to avoid deadlock. Use lockdep_assert_held_once for warning.
> 
> Add (), although the last two sentences don't seem that useful, IMO.
> 
> > 
> > Signed-off-by: Yunhui Cui <cuiyunhui@...edance.com>
> > ---
> >  drivers/tty/serial/8250/8250_dw.c | 8 ++++++++
> >  1 file changed, 8 insertions(+)
> > 
> > diff --git a/drivers/tty/serial/8250/8250_dw.c b/drivers/tty/serial/8250/8250_dw.c
> > index af24ec25d976..f41c4a9ed58b 100644
> > --- a/drivers/tty/serial/8250/8250_dw.c
> > +++ b/drivers/tty/serial/8250/8250_dw.c
> > @@ -13,6 +13,7 @@
> >  #include <linux/delay.h>
> >  #include <linux/device.h>
> >  #include <linux/io.h>
> > +#include <linux/lockdep.h>
> >  #include <linux/mod_devicetable.h>
> >  #include <linux/module.h>
> >  #include <linux/notifier.h>
> > @@ -112,6 +113,13 @@ static void dw8250_force_idle(struct uart_port *p)
> >  	struct uart_8250_port *up = up_to_u8250p(p);
> >  	unsigned int lsr;
> >  
> > +	/*
> > +	 * The serial_in(p, UART_RX) should be under port->lock, but we can't add
> > +	 * it to avoid AA deadlock as we're unsure if serial_out*(...UART_LCR)
> > +	 * is under port->lock.
> 
> I'm left to wonder who/what "we" is here? Could you change it something 
> more precise.
> 
> > +	 */
> > +	lockdep_assert_held_once(&p->lock);
> > +
> >  	serial8250_clear_and_reinit_fifos(up);
> >  
> >  	/*
> > 
> 
> 

-- 
 i.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ