diff options
author | Wade Mealing <wmealing@redhat.com> | 2020-06-17 13:49:47 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2020-07-22 09:22:27 +0200 |
commit | 5cd9ec70b9f6431fc3e60075c01bc00f08c5606b (patch) | |
tree | ec45bc6cd2f08e32fea7e7b98f20f004d12b48fe /drivers/block | |
parent | 5612e29ba167709da72d2fb1e111b0a66b884659 (diff) | |
download | linux-stable-5cd9ec70b9f6431fc3e60075c01bc00f08c5606b.tar.gz linux-stable-5cd9ec70b9f6431fc3e60075c01bc00f08c5606b.tar.bz2 linux-stable-5cd9ec70b9f6431fc3e60075c01bc00f08c5606b.zip |
Revert "zram: convert remaining CLASS_ATTR() to CLASS_ATTR_RO()"
commit 853eab68afc80f59f36bbdeb715e5c88c501e680 upstream.
Turns out that the permissions for 0400 really are what we want here,
otherwise any user can read from this file.
[fixed formatting, added changelog, and made attribute static - gregkh]
Reported-by: Wade Mealing <wmealing@redhat.com>
Cc: stable <stable@vger.kernel.org>
Fixes: f40609d1591f ("zram: convert remaining CLASS_ATTR() to CLASS_ATTR_RO()")
Link: https://bugzilla.redhat.com/show_bug.cgi?id=1847832
Reviewed-by: Steffen Maier <maier@linux.ibm.com>
Acked-by: Minchan Kim <minchan@kernel.org>
Link: https://lore.kernel.org/r/20200617114946.GA2131650@kroah.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/block')
-rw-r--r-- | drivers/block/zram/zram_drv.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/block/zram/zram_drv.c b/drivers/block/zram/zram_drv.c index 1b4e195c0d3c..0d906ca8d4f5 100644 --- a/drivers/block/zram/zram_drv.c +++ b/drivers/block/zram/zram_drv.c @@ -1648,7 +1648,8 @@ static ssize_t hot_add_show(struct class *class, return ret; return scnprintf(buf, PAGE_SIZE, "%d\n", ret); } -static CLASS_ATTR_RO(hot_add); +static struct class_attribute class_attr_hot_add = + __ATTR(hot_add, 0400, hot_add_show, NULL); static ssize_t hot_remove_store(struct class *class, struct class_attribute *attr, |