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] [day] [month] [year] [list]
Message-ID: <4BBE5EF0.5000801@infradead.org>
Date:	Thu, 08 Apr 2010 19:55:44 -0300
From:	Mauro Carvalho Chehab <mchehab@...radead.org>
To:	Wolfram Sang <w.sang@...gutronix.de>
CC:	linux-kernel@...r.kernel.org,
	"Eric W. Biederman" <ebiederm@...ssion.com>,
	Greg KH <gregkh@...e.de>,
	Andrew Morton <akpm@...ux-foundation.org>,
	Benjamin Herrenschmidt <benh@...nel.crashing.org>,
	Grant Likely <grant.likely@...retlab.ca>,
	Michal Simek <monstr@...str.eu>,
	Johannes Berg <johannes@...solutions.net>,
	Mike Isely <isely@...ox.com>,
	Sujith Thomas <sujith.thomas@...el.com>,
	Matthew Garrett <mjg@...hat.com>,
	Len Brown <len.brown@...el.com>,
	Lin Ming <ming.m.lin@...el.com>,
	Bob Moore <robert.moore@...el.com>,
	Krzysztof Helt <krzysztof.h1@...pl>,
	Anatolij Gustschin <agust@...x.de>,
	Kai Jiang <b18973@...escale.com>,
	Kumar Gala <galak@...nel.crashing.org>,
	linuxppc-dev@...abs.org, linux-media@...r.kernel.org,
	platform-driver-x86@...r.kernel.org
Subject: Re: [PATCH 2/2] device_attributes: add sysfs_attr_init() for dynamic
 attributes

Wolfram Sang wrote:
> Made necessary by 6992f5334995af474c2b58d010d08bc597f0f2fe. Prevents further
> "key xxx not in .data" bug-reports. Although some attributes could probably be
> converted to static ones, this is left for people having hardware to test.
> 
> Found by this semantic patch:
> 
> @ init @
> type T;
> identifier A;
> @@
> 
>         T {
>                 ...
>                 struct device_attribute A;
>                 ...
>         };
> 
> @ main extends init @
> expression E;
> statement S;
> identifier err;
> T *name;
> @@
> 
>         ... when != sysfs_attr_init(&name->A.attr);
> (
> +       sysfs_attr_init(&name->A.attr);
>         if (device_create_file(E, &name->A))
>                 S
> |
> +       sysfs_attr_init(&name->A.attr);
>         err = device_create_file(E, &name->A);
> )
> 
> While reviewing, I put the initialization to apropriate places.
> 
> Signed-off-by: Wolfram Sang <w.sang@...gutronix.de>
> Cc: Eric W. Biederman <ebiederm@...ssion.com>
> Cc: Greg KH <gregkh@...e.de>
> Cc: Andrew Morton <akpm@...ux-foundation.org>
> ---
>  drivers/macintosh/windfarm_core.c           |    1 +
>  drivers/media/video/pvrusb2/pvrusb2-sysfs.c |    8 ++++++++

I suspect that several (if not all) occurrences at pvrusb2 could be replaced by
static attributes, but let Mike Isely have the final word on that, as the driver
maintainer. From my side, I'm ok with either options.

Cheers,
Mauro
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ