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: <CAHp75Vcz0a87LSnb6Ubt5_bSF3wUcs21GbP119trXER5KBDxbQ@mail.gmail.com>
Date:   Fri, 29 May 2020 15:03:50 +0300
From:   Andy Shevchenko <andy.shevchenko@...il.com>
To:     Andreas Färber <afaerber@...e.de>
Cc:     Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
        Cristian Ciocaltea <cristian.ciocaltea@...il.com>,
        Manivannan Sadhasivam <manivannan.sadhasivam@...aro.org>,
        Jiri Slaby <jslaby@...e.com>,
        Andy Shevchenko <andriy.shevchenko@...ux.intel.com>,
        "open list:SERIAL DRIVERS" <linux-serial@...r.kernel.org>,
        linux-arm Mailing List <linux-arm-kernel@...ts.infradead.org>,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
        linux-actions@...ts.infradead.org
Subject: Re: [PATCH 1/1] tty: serial: owl: Initialize lock before registering port

On Fri, May 29, 2020 at 2:56 PM Andreas Färber <afaerber@...e.de> wrote:
>
> Am 29.05.20 um 13:34 schrieb Greg Kroah-Hartman:
> > On Fri, May 29, 2020 at 02:06:47PM +0300, Cristian Ciocaltea wrote:
> >> Running a lockdep-enabled kernel leads to the following splat when
> >> probing the owl-uart driver:

...

> >> Fixes: a3cb39d258ef ("serial: core: Allow detach and attach serial device for console")
> >> Signed-off-by: Cristian Ciocaltea <cristian.ciocaltea@...il.com>

> >> +    spin_lock_init(&owl_port->port.lock);
> >> +
> >>      ret = uart_add_one_port(&owl_uart_driver, &owl_port->port);
> >>      if (ret)
> >>              owl_uart_ports[pdev->id] = NULL;
> >
> > Ugh, another one :(
> >
> > Thanks for this, will queue this up now.
>
> Thanks. If this is the expected pattern now, I'll also have to update
> in-flight patches, such as Sunplus.

Expected is to register properly console via register_console() call.
If you do so, you also need to initialize spin lock before coming to
uart_add_one_port().
It seems drivers (ab)used that feature.

$ git grep -n -w register_console -- drivers/tty/serial/ | cut -f1 -d:
| sort -u | wc -l
    37
$ git grep -n _CONSOLE -- drivers/tty/serial/ | cut -f1 -d:  | sort -u | wc -l
    77

But as a quick fix this initialization is okay.

-- 
With Best Regards,
Andy Shevchenko

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ