Re: [PATCHv2] zram: restrict add/remove attributes to root only

2016-12-05 Thread Sergey Senozhatsky
On (12/05/16 13:57), Greg KH wrote: > > +/* > > + * NOTE: hot_add attribute is not the usual read-only sysfs > > + * attribute. In a sence that reading from this file does alter > > + * the state of your system -- it creates a new un-initialized > > + * zram device and returns back this device's de

Re: [PATCHv2] zram: restrict add/remove attributes to root only

2016-12-05 Thread Greg KH
On Sun, Dec 04, 2016 at 09:44:13PM +0900, Sergey Senozhatsky wrote: > zram hot_add sysfs attribute is a very 'special' attribute - reading > from it creates a new uninitialized zram device. This file, by a mistake, > can be read by a 'normal' user at the moment, while only root must be > able to cr

[PATCHv2] zram: restrict add/remove attributes to root only

2016-12-04 Thread Sergey Senozhatsky
zram hot_add sysfs attribute is a very 'special' attribute - reading from it creates a new uninitialized zram device. This file, by a mistake, can be read by a 'normal' user at the moment, while only root must be able to create a new zram device, therefore hot_add attribute must have S_IRUSR mode,