[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20161205155728.GA5014@tigerII.localdomain>
Date: Tue, 6 Dec 2016 00:57:28 +0900
From: Sergey Senozhatsky <sergey.senozhatsky@...il.com>
To: Greg KH <gregkh@...uxfoundation.org>
Cc: Sergey Senozhatsky <sergey.senozhatsky@...il.com>,
Andrew Morton <akpm@...ux-foundation.org>,
Minchan Kim <minchan@...nel.org>,
Steven Allen <steven@...balien.com>,
linux-kernel@...r.kernel.org, stable@...r.kernel.org,
Sergey Senozhatsky <sergey.senozhatsky.work@...il.com>
Subject: Re: [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
Powered by blists - more mailing lists