Skip to content

Commit caa99f2

Browse files
wmealingSomasundaram Krishnasamy
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 <[email protected]> Cc: stable <[email protected]> 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 <[email protected]> Acked-by: Minchan Kim <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]> Orabug: 31726827 CVE: CVE-2020-10781 (cherry picked from commit 5cd9ec70b9f6431fc3e60075c01bc00f08c5606b) Signed-off-by: Vijayendra Suman <[email protected]> Reviewed-by: John Donnelly <[email protected]> Signed-off-by: Somasundaram Krishnasamy <[email protected]>
1 parent 6ec17e4 commit caa99f2

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

drivers/block/zram/zram_drv.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1648,7 +1648,8 @@ static ssize_t hot_add_show(struct class *class,
16481648
return ret;
16491649
return scnprintf(buf, PAGE_SIZE, "%d\n", ret);
16501650
}
1651-
static CLASS_ATTR_RO(hot_add);
1651+
static struct class_attribute class_attr_hot_add =
1652+
__ATTR(hot_add, 0400, hot_add_show, NULL);
16521653

16531654
static ssize_t hot_remove_store(struct class *class,
16541655
struct class_attribute *attr,

0 commit comments

Comments
 (0)