Re: [PATCH 2/3] sysfs: Only accept read/write permissions for file attributes

2015-01-20 Thread Greg Kroah-Hartman
On Tue, Jan 20, 2015 at 09:13:12AM -0800, Guenter Roeck wrote: > On Tue, Jan 20, 2015 at 10:44:01AM -0500, Vivien Didelot wrote: > > Hi Guenter, > > > [ ... ] > > > > > Anyway, my goal was to keep things simple. Taking some bits from the > > > default > > > and others from the return value of

Re: [PATCH 2/3] sysfs: Only accept read/write permissions for file attributes

2015-01-20 Thread Guenter Roeck
On Tue, Jan 20, 2015 at 10:44:01AM -0500, Vivien Didelot wrote: > Hi Guenter, > [ ... ] > > > Anyway, my goal was to keep things simple. Taking some bits from the default > > and others from the return value of the is_visible function isn't simple, > > even more so since your code would require

Re: [PATCH 2/3] sysfs: Only accept read/write permissions for file attributes

2015-01-20 Thread Vivien Didelot
Hi Guenter, >>> @@ -55,6 +55,12 @@ static int create_files(struct kernfs_node *parent, >>> struct kobject *kobj, >>> if (!mode) >>> continue; >>> } >>> + >>> +WARN(mode &

Re: [PATCH 2/3] sysfs: Only accept read/write permissions for file attributes

2015-01-20 Thread Vivien Didelot
Hi Guenter, @@ -55,6 +55,12 @@ static int create_files(struct kernfs_node *parent, struct kobject *kobj, if (!mode) continue; } + +WARN(mode ~(S_IRUGO | S_IWUGO |

Re: [PATCH 2/3] sysfs: Only accept read/write permissions for file attributes

2015-01-20 Thread Guenter Roeck
On Tue, Jan 20, 2015 at 10:44:01AM -0500, Vivien Didelot wrote: Hi Guenter, [ ... ] Anyway, my goal was to keep things simple. Taking some bits from the default and others from the return value of the is_visible function isn't simple, even more so since your code would require the

Re: [PATCH 2/3] sysfs: Only accept read/write permissions for file attributes

2015-01-20 Thread Greg Kroah-Hartman
On Tue, Jan 20, 2015 at 09:13:12AM -0800, Guenter Roeck wrote: On Tue, Jan 20, 2015 at 10:44:01AM -0500, Vivien Didelot wrote: Hi Guenter, [ ... ] Anyway, my goal was to keep things simple. Taking some bits from the default and others from the return value of the is_visible

Re: [PATCH 2/3] sysfs: Only accept read/write permissions for file attributes

2015-01-19 Thread Guenter Roeck
On 01/19/2015 04:07 PM, Vivien Didelot wrote: Hi Guenter, For sysfs file attributes, only read and write permisssions make sense. Minor typo, there's an extra 's' to permissions. Mask provided attribute permissions accordingly and send a warning to the console if invalid permission bits

Re: [PATCH 2/3] sysfs: Only accept read/write permissions for file attributes

2015-01-19 Thread Vivien Didelot
Hi Guenter, > For sysfs file attributes, only read and write permisssions make sense. Minor typo, there's an extra 's' to permissions. > Mask provided attribute permissions accordingly and send a warning > to the console if invalid permission bits are set. > > Cc: Vivien Didelot >

Re: [PATCH 2/3] sysfs: Only accept read/write permissions for file attributes

2015-01-19 Thread Vivien Didelot
Hi Guenter, For sysfs file attributes, only read and write permisssions make sense. Minor typo, there's an extra 's' to permissions. Mask provided attribute permissions accordingly and send a warning to the console if invalid permission bits are set. Cc: Vivien Didelot

Re: [PATCH 2/3] sysfs: Only accept read/write permissions for file attributes

2015-01-19 Thread Guenter Roeck
On 01/19/2015 04:07 PM, Vivien Didelot wrote: Hi Guenter, For sysfs file attributes, only read and write permisssions make sense. Minor typo, there's an extra 's' to permissions. Mask provided attribute permissions accordingly and send a warning to the console if invalid permission bits