lkml.org 
[lkml]   [2016]   [Dec]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCHv2] zram: restrict add/remove attributes to root only
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 device_id (or an
> > + * error code if it fails to create a new device).
> > + */
> > static struct class_attribute zram_control_class_attrs[] = {
> > - __ATTR_RO(hot_add),
> > - __ATTR_WO(hot_remove),
> > + __ATTR(hot_add, 0400, hot_add_show, NULL),
> > + __ATTR(hot_remove, 0200, NULL, hot_remove_store),
>
> You can leave hot_remove as __ATTR_WO(), right?

yes. I changed it deliberately.

> Please do so if at all possible.

ok.

-ss

\
 
 \ /
  Last update: 2016-12-05 16:59    [W:0.978 / U:0.008 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site