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:   Thu, 14 Sep 2017 00:43:33 +0300
From:   Dan Carpenter <dan.carpenter@...cle.com>
To:     Greg KH <gregkh@...uxfoundation.org>
Cc:     Lars-Peter Clausen <lars@...afoo.de>, devel@...verdev.osuosl.org,
        daniel.baluta@...il.com, Himanshi Jain <himshijain.hj@...il.com>,
        Michael.Hennerich@...log.com, linux-iio@...r.kernel.org,
        linux-kernel@...r.kernel.org, nick.desaulniers@...il.com,
        outreachy-kernel@...glegroups.com, pmeerw@...erw.net,
        knaack.h@....de, Jonathan Cameron <jic23@...nel.org>
Subject: Re: [PATCH v2 1/2] include: linux: sysfs: Add __ATTR_NAMED macro

On Wed, Sep 13, 2017 at 02:29:52PM -0700, Greg KH wrote:
> On Wed, Sep 13, 2017 at 09:23:31PM +0200, Lars-Peter Clausen wrote:
> > On 09/13/2017 08:58 PM, Greg KH wrote:
> > > On Wed, Sep 13, 2017 at 06:03:10PM +0100, Jonathan Cameron wrote:
> > >> On Wed, 13 Sep 2017 14:14:07 +0530
> > >> Himanshi Jain <himshijain.hj@...il.com> wrote:
> > >>
> > >>> Add __ATTR_NAMED macro similar to __ATTR but taking name as a
> > >>> string instead of implicit conversion of argument to string using
> > >>> the macro _stringify(_name).
> > >>>
> > >>> Signed-off-by: Himanshi Jain <himshijain.hj@...il.com>
> > >>> ---
> > >>>  include/linux/sysfs.h | 7 +++++++
> > >>>  1 file changed, 7 insertions(+)
> > >>>
> > >>> diff --git a/include/linux/sysfs.h b/include/linux/sysfs.h
> > >>> index aa02c32..20321cf 100644
> > >>> --- a/include/linux/sysfs.h
> > >>> +++ b/include/linux/sysfs.h
> > >>> @@ -104,6 +104,13 @@ struct attribute_group {
> > >>>  	.store	= _store,						\
> > >>>  }
> > >>>  
> > >>> +#define __ATTR_NAMED(_name, _mode, _show, _store) {			\
> > >>
> > >> I'm not sure about the naming here.  The normal __ATTR macro is also
> > >> 'named'.  Maybe something as awful as
> > >>
> > >> __ATTR_STRING_NAME ? 
> > >>
> > >> Greg what do you think?
> > > 
> > > ick ick ick.
> > > 
> > >> This is all to allow us to have names with operators in them without
> > >> checkpatch complaining about them... A worthwhile aim just to stop
> > >> more people wasting time trying to 'fix' those cases by adding spaces.
> > > 
> > > Yeah, but this really seems "heavy" for just a crazy sysfs name in a
> > > macro.  Adding a whole new "core" define for that is a hard sell...
> > > 
> > > I also want to get rid of the "generic" __ATTR type macros, and force
> > > people to use the proper _RW and friends instead.  I don't want to add
> > > another new one that people will start to use that I later have to
> > > change...
> > > 
> > > So no, I don't like this, how about just changing your macros instead?
> > > No one else has this problem :)
> > 
> > Nobody else realized they have this problem yet. E.g. there are a few users
> > of __ATTR in block/genhd.c that have the same issue and are likely to
> > generate the same false positives from static checkers.
> 
> Then fix the broken static checkers :)

He was exagerating a bit to call it a "static checker" warning...
It's just checkpatch.pl complaining about adding spaces around the -
operator.  The sysfs file has a hyphen in the middle.

regards,
dan carpenter


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ