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: <YbB29BaOWibImGf5@unreal>
Date:   Wed, 8 Dec 2021 11:12:20 +0200
From:   Leon Romanovsky <leon@...nel.org>
To:     Greg KH <gregkh@...uxfoundation.org>
Cc:     "David E. Box" <david.e.box@...ux.intel.com>, lee.jones@...aro.org,
        hdegoede@...hat.com, bhelgaas@...gle.com,
        andriy.shevchenko@...ux.intel.com, srinivas.pandruvada@...el.com,
        shuah@...nel.org, mgross@...ux.intel.com,
        linux-kernel@...r.kernel.org, platform-driver-x86@...r.kernel.org,
        linux-kselftest@...r.kernel.org, linux-pci@...r.kernel.org
Subject: Re: [V2 2/6] driver core: auxiliary bus: Add driver data helpers

On Wed, Dec 08, 2021 at 09:43:37AM +0100, Greg KH wrote:
> On Wed, Dec 08, 2021 at 10:32:13AM +0200, Leon Romanovsky wrote:
> > On Wed, Dec 08, 2021 at 08:07:39AM +0100, Greg KH wrote:
> > > On Wed, Dec 08, 2021 at 09:03:16AM +0200, Leon Romanovsky wrote:
> > > > On Tue, Dec 07, 2021 at 09:14:44AM -0800, David E. Box wrote:
> > > > > Adds get/set driver data helpers for auxiliary devices.
> > > > > 
> > > > > Signed-off-by: David E. Box <david.e.box@...ux.intel.com>
> > > > > Reviewed-by: Mark Gross <markgross@...nel.org>
> > > > > ---
> > > > > V2
> > > > >   - No changes
> > > > > 
> > > > >  include/linux/auxiliary_bus.h | 10 ++++++++++
> > > > >  1 file changed, 10 insertions(+)
> > > > 
> > > > I would really like to see an explanation why such obfuscation is really
> > > > needed. dev_*_drvdata() is a standard way to access driver data.
> > > 
> > > Lots of busses have this helper.  This is nothing new at all, and is
> > > nice to have.  Look at all of the calls to dev_get_drvdata() in
> > > include/linux/ for the examples.
> > 
> > I looked and this is why I asked. From the point of person who does
> > reviews and refactoring, such obfuscations are evil.
> 
> Then you must consider about 80 busses evil :)
> 
> Again, this is a very common helper pattern in the kernel, one that we
> have had for decades now.  It allows a driver writer to only worry about
> the bus apis for that specific bus, and not have to dive down into the
> driver core functions at all.  What is wrong with that?

What is wrong?

The idea that you have two APIs which do the same thing, one is
obfuscated version of another.

If you don't want from people to use driver core function and structures,
you shouldn't expose them in global headers.

Thanks

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ