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: <CY4PR07MB31764083B4606C00677853A5F0A00@CY4PR07MB3176.namprd07.prod.outlook.com>
Date:   Mon, 17 Jul 2017 21:36:58 +0000
From:   "Kershner, David A" <David.Kershner@...sys.com>
To:     Greg KH <greg@...ah.com>, Arvind Yadav <arvind.yadav.cs@...il.com>
CC:     "Sell, Timothy C" <Timothy.Sell@...sys.com>,
        "Thompson, Bryan E." <bryan.thompson@...sys.com>,
        "jon.frisch@...sys.com" <jon.frisch@...sys.com>,
        "Binder, David Anthony" <David.Binder@...sys.com>,
        *S-Par-Maintainer <SParMaintainer@...sys.com>,
        "devel@...verdev.osuosl.org" <devel@...verdev.osuosl.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: RE: [PATCH] staging: unisys: visorbus: constify attribute_group
 structures.

> -----Original Message-----
> From: Greg KH [mailto:greg@...ah.com]
> Sent: Monday, July 17, 2017 8:38 AM
> To: Arvind Yadav <arvind.yadav.cs@...il.com>
> Cc: Kershner, David A <David.Kershner@...sys.com>; Sell, Timothy C
> <Timothy.Sell@...sys.com>; Thompson, Bryan E.
> <bryan.thompson@...sys.com>; jon.frisch@...sys.com; Binder, David
> Anthony <David.Binder@...sys.com>; *S-Par-Maintainer
> <SParMaintainer@...sys.com>; devel@...verdev.osuosl.org; linux-
> kernel@...r.kernel.org
> Subject: Re: [PATCH] staging: unisys: visorbus: constify attribute_group
> structures.
> 
> On Mon, Jul 17, 2017 at 05:43:14PM +0530, Arvind Yadav wrote:
> > Hi Greg,
> >
> >
> > On Monday 17 July 2017 04:15 PM, Greg KH wrote:
> > > On Mon, Jul 17, 2017 at 02:55:37PM +0530, Arvind Yadav wrote:
> > > > attribute_groups are not supposed to change at runtime. All functions
> > > > working with attribute_groups provided by <linux/sysfs.h> work
> > > > with const attribute_group. So mark the non-const structs as const.
> > > >
> > > > Signed-off-by: Arvind Yadav <arvind.yadav.cs@...il.com>
> > > > ---
> > > >   drivers/staging/unisys/visorbus/visorbus_main.c | 4 ++--
> > > >   drivers/staging/unisys/visorbus/visorchipset.c  | 2 +-
> > > >   2 files changed, 3 insertions(+), 3 deletions(-)
> > > Why not just use the ATTRIBUTE_GROUPS() macro for these?  Or is there
> > > something that is preventing that?
> > Yes, we can use. if we are only initializing '.attrs'.
> > ATTRIBUTE_GROUPS() will not work if we will initialize other member of
> > attribute_group like 'bin_attrs', 'is_visible', and  'name'.
> 
> That means you should redo this patch :)
> 
> Also, your changelog text had a typo, it is "attribute_group", not
> "attribute_groups".
> 

Greg, are you recommending that we shouldn't be setting the attribute_group
.name field? What does it pick up if we don't specify it?

Also, for our attribute_groups in visorchipset, we are defining it with two
different attribute_group variables. Are you allowed to use two different
attribute_group variables in an attribute_groups, or is this frowned upon and
we should flatten it out to just one? An example that we used in the kernel was:

	static const struct attribute_group *l2_cache_pmu_attr_grps[] = {
		&l2_cache_pmu_format_group,
		&l2_cache_pmu_cpumask_group,
		NULL,
	};

Thanks,
David Kershner

> thanks,
> 
> greg k-h

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ