Skip to content

Commit 54a8d93

Browse files
djbwgregkh
authored andcommitted
libnvdimm, namespace: make 'resource' attribute only readable by root
commit c1fb3542074fd0c4d901d778bd52455111e4eb6f upstream. For the same reason that /proc/iomem returns 0's for non-root readers and acpi tables are root-only, make the 'resource' attribute for namespace devices only readable by root. Otherwise we disclose physical address information. Fixes: bf9bccc ("libnvdimm: pmem label sets and namespace instantiation") Reported-by: Dave Hansen <dave.hansen@linux.intel.com> Signed-off-by: Dan Williams <dan.j.williams@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 4dae2f7 commit 54a8d93

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

drivers/nvdimm/namespace_devs.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1305,7 +1305,7 @@ static umode_t namespace_visible(struct kobject *kobj,
13051305
if (a == &dev_attr_resource.attr) {
13061306
if (is_namespace_blk(dev))
13071307
return 0;
1308-
return a->mode;
1308+
return 0400;
13091309
}
13101310

13111311
if (is_namespace_pmem(dev) || is_namespace_blk(dev)) {

0 commit comments

Comments
 (0)