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]
Date:   Wed, 9 Dec 2020 17:45:09 +0200
From:   Alexandru Ardelean <ardeleanalex@...il.com>
To:     Andy Shevchenko <andy.shevchenko@...il.com>
Cc:     Alexandru Ardelean <alexandru.ardelean@...log.com>,
        linux-iio <linux-iio@...r.kernel.org>,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
        Jonathan Cameron <jic23@...nel.org>,
        Lars-Peter Clausen <lars@...afoo.de>
Subject: Re: [PATCH v2] iio: core: register chardev only if needed

On Wed, Dec 9, 2020 at 5:37 PM Andy Shevchenko
<andy.shevchenko@...il.com> wrote:
>
> On Thu, Dec 3, 2020 at 11:55 AM Alexandru Ardelean
> <alexandru.ardelean@...log.com> wrote:
> >
> > We only need a chardev if we need to support buffers and/or events.
> >
> > With this change, a chardev will be created only if an IIO buffer is
> > attached OR an event_interface is configured.
> >
> > Otherwise, no chardev will be created, and the IIO device will get
> > registered with the 'device_add()' call.
> >
> > Quite a lot of IIO devices don't really need a chardev, so this is a minor
> > improvement to the IIO core, as the IIO device will take up (slightly)
> > fewer resources.
> >
> > In order to not create a chardev, we mostly just need to not initialize the
> > indio_dev->dev.devt field. If that is un-initialized, cdev_device_add()
>
> un-initialized -> uninitialized
>
> > behaves like device_add().
>
> Are you sure there is no user space application that doesn't rely on
> character device to be always present?

Nope.
I'm not sure.
I'm also not completely sure how Jonathan feels about this patch being
added now [so late].

Though, technically if the chardev was already there, without all the
control in place [to enable IIO buffers and other stuff through the
chardev] then it's technically just a "marker" file.
Which arguably is a lot to have (i.e. chardev that should be unusable).

If it is usable with no control in place for buffers or other stuff
(i.e. I missed something), then I also don't know.

So, this patch on it's own can still be interpreted as an RFC.
See:
https://lore.kernel.org/linux-iio/20201121180246.772ad299@archlinux/

>
> --
> With Best Regards,
> Andy Shevchenko

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ