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: <YPgcgahQ458ndT1j@hovoldconsulting.com>
Date:   Wed, 21 Jul 2021 15:09:21 +0200
From:   Johan Hovold <johan@...nel.org>
To:     Dongliang Mu <mudongliangabcd@...il.com>
Cc:     Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
        Jiri Slaby <jirislaby@...nel.org>, stable@...r.kernel.org,
        Greg Kroah-Hartman <gregkh@...e.de>,
        linux-kernel <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v2] tty: nozomi: tty_unregister_device ->
 tty_port_unregister_device

On Wed, Jul 21, 2021 at 08:53:47PM +0800, Dongliang Mu wrote:
> On Wed, Jul 21, 2021 at 8:01 PM Johan Hovold <johan@...nel.org> wrote:
> >
> > On Wed, Jul 21, 2021 at 07:33:04PM +0800, Dongliang Mu wrote:
> > > The pairwise api invocation of tty_port_register_device should be
> > > tty_port_unregister_device, other than tty_unregister_device.
> >
> > Are you sure about that? Please explain why you think this to be the
> > case and why this change is needed.
> 
> I am sure about this.

I'm afraid you are mistaken. There is a bit of inconsistency in the API,
but it is *not* a requirement to use the port helper for deregistration
here.

> 1. From the implementation,
>     tty_port_register_device -> tty_port_register_device_attr ->
> tty_port_link_device; tty_register_device_attr
>     tty_register_device -> tty_register_device_attr
> 
>     tty_port_unregister_device -> serdev_tty_port_unregister;
> tty_unregister_device
>     tty_unregister_device

>     As to the functionability, tty_port_register_device pairs with
> tty_port_unregister_device; meanwhile, the same to tty_register_device
> and tty_unregister_device.

Again, this is not an explanation. Why do think it is needed? What could
possibly go wrong if you don't change the code like you propose?

> 2. From the function naming style,
> 
>     tty_port_register_device - tty_port_unregister_device;
> tty_register_device - tty_unregister_device

Yes, the naming suggests you should be using the port helper and it is
ok to do so, but again, it is not a requirement (unless you're using the
serdev variant).

> > > Fixes: a6afd9f3e819 ("tty: move a number of tty drivers from drivers/char/ to drivers/tty/")
> >
> > Please try a little harder, that's clearly not the commit that changed
> > to the port registration helper.
> >
> > > Cc: stable@...r.kernel.org
> >
> > Why do you think this is stable material? (hint: it is not)
> 
> From the documentation, this label could make the patch automatically
> go to stable tree. And stable tree is also using the incorrect api.

No, it is not using an "incorrect api". There is nothing wrong with
current code. And it certainly does not need to be changed in stable.

Johan

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ