Skip to content

Commit 8fd782b

Browse files
wmealinggregkh
authored andcommitted
Revert "zram: convert remaining CLASS_ATTR() to CLASS_ATTR_RO()"
commit 853eab6 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: f40609d ("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>
1 parent cd01af5 commit 8fd782b

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

‎drivers/block/zram/zram_drv.c‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2025,7 +2025,8 @@ static ssize_t hot_add_show(struct class *class,
20252025
return ret;
20262026
return scnprintf(buf, PAGE_SIZE, "%d\n", ret);
20272027
}
2028-
static CLASS_ATTR_RO(hot_add);
2028+
static struct class_attribute class_attr_hot_add =
2029+
__ATTR(hot_add, 0400, hot_add_show, NULL);
20292030

20302031
static ssize_t hot_remove_store(struct class *class,
20312032
struct class_attribute *attr,

0 commit comments

Comments
 (0)