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: <CABGWkvrBrTqWQPBWKuKzuwQzgvc-iuWJPXt2utb60MOfych09A@mail.gmail.com>
Date:   Tue, 26 Jul 2022 12:11:33 +0200
From:   Dario Binacchi <dario.binacchi@...rulasolutions.com>
To:     Marc Kleine-Budde <mkl@...gutronix.de>
Cc:     linux-kernel@...r.kernel.org, michael@...rulasolutions.com,
        Amarula patchwork <linux-amarula@...rulasolutions.com>,
        Jeroen Hofstee <jhofstee@...tronenergy.com>,
        Oliver Hartkopp <socketcan@...tkopp.net>,
        Max Staudt <max@...as.org>,
        "David S. Miller" <davem@...emloft.net>,
        Eric Dumazet <edumazet@...gle.com>,
        Jakub Kicinski <kuba@...nel.org>,
        Paolo Abeni <pabeni@...hat.com>,
        Wolfgang Grandegger <wg@...ndegger.com>,
        linux-can@...r.kernel.org, netdev@...r.kernel.org
Subject: Re: [PATCH v2 2/6] can: slcan: remove legacy infrastructure

Hello Marc,

On Mon, Jul 25, 2022 at 2:38 PM Marc Kleine-Budde <mkl@...gutronix.de> wrote:
>
> On 25.07.2022 08:54:15, Dario Binacchi wrote:
> > Taking inspiration from the drivers/net/can/can327.c driver and at the
> > suggestion of its author Max Staudt, I removed legacy stuff like
> > `SLCAN_MAGIC' and `slcan_devs' resulting in simplification of the code
> > and its maintainability.
> >
> > The use of slcan_devs is derived from a very old kernel, since slip.c
> > is about 30 years old, so today's kernel allows us to remove it.
> >
> > The .hangup() ldisc function, which only called the ldisc .close(), has
> > been removed since the ldisc layer calls .close() in a good place
> > anyway.
> >
> > The old slcanX name has been dropped in order to use the standard canX
> > interface naming. It has been assumed that this change does not break
> > the user space as the slcan driver provides an ioctl to resolve from tty
> > fd to netdev name.
>
> Is there a man page that documents this iotcl? Please add it and/or the
> IOCTL name.

I have not found documentation of the SIOCGIFNAME ioctl for the line discipline,
but only for netdev (i. e.
https://man7.org/linux/man-pages/man7/netdevice.7.html),

Thanks and regards,
Dario

>
> > The `maxdev' module parameter has also been removed.
> >
> > CC: Max Staudt <max@...as.org>
> > Signed-off-by: Dario Binacchi <dario.binacchi@...rulasolutions.com>
> >
> > ---
> >
> > Changes in v2:
>
> Nitpick:
> Changes since RFC: https://lore.kernel.org/all/20220716170007.2020037-1-dario.binacchi@amarulasolutions.com
>
> > - Update the commit description.
> > - Drop the old "slcan" name to use the standard canX interface naming.
> >
> >  drivers/net/can/slcan/slcan-core.c | 318 ++++++-----------------------
> >  1 file changed, 63 insertions(+), 255 deletions(-)
> >
> > diff --git a/drivers/net/can/slcan/slcan-core.c b/drivers/net/can/slcan/slcan-core.c
> > index c3dd7468a066..2c546f4a7981 100644
> > --- a/drivers/net/can/slcan/slcan-core.c
> > +++ b/drivers/net/can/slcan/slcan-core.c
>
> [...]
>
> > @@ -898,72 +799,49 @@ static int slcan_open(struct tty_struct *tty)
> >       if (!tty->ops->write)
> >               return -EOPNOTSUPP;
> >
> > -     /* RTnetlink lock is misused here to serialize concurrent
> > -      * opens of slcan channels. There are better ways, but it is
> > -      * the simplest one.
> > -      */
> > -     rtnl_lock();
> > +     dev = alloc_candev(sizeof(*sl), 1);
> > +     if (!dev)
> > +             return -ENFILE;
> >
> > -     /* Collect hanged up channels. */
> > -     slc_sync();
> > +     sl = netdev_priv(dev);
> >
> > -     sl = tty->disc_data;
> > +     /* Configure TTY interface */
> > +     tty->receive_room = 65536; /* We don't flow control */
> > +     sl->rcount   = 0;
> > +     sl->xleft    = 0;
>
> Nitpick: Please use 1 space in front of the =.
>
> regards,
> Marc
>
> --
> Pengutronix e.K.                 | Marc Kleine-Budde           |
> Embedded Linux                   | https://www.pengutronix.de  |
> Vertretung West/Dortmund         | Phone: +49-231-2826-924     |
> Amtsgericht Hildesheim, HRA 2686 | Fax:   +49-5121-206917-5555 |



-- 

Dario Binacchi

Embedded Linux Developer

dario.binacchi@...rulasolutions.com

__________________________________


Amarula Solutions SRL

Via Le Canevare 30, 31100 Treviso, Veneto, IT

T. +39 042 243 5310
info@...rulasolutions.com

www.amarulasolutions.com

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ