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

From: Greg KH
Date: Mon Dec 05 2016 - 11:50:25 EST


On Tue, Dec 06, 2016 at 12:58:45AM +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 create a new zram device, therefore hot_add attribute must have
> S_IRUSR mode, not S_IRUGO.
>
> Fixes: 6566d1a32bf72 ("zram: add dynamic device add/remove functionality")
> Reported-by: Steven Allen <steven@xxxxxxxxxxxxx>
> Cc: <stable@xxxxxxxxxxxxxxx> [4.2+]
> Signed-off-by: Sergey Senozhatsky <sergey.senozhatsky@xxxxxxxxx>

Acked-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>