libnvdimm, region : make 'resource' attribute only readable by root
authorDan Williams <dan.j.williams@intel.com>
Tue, 26 Sep 2017 18:17:52 +0000 (11:17 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 30 Nov 2017 08:40:54 +0000 (08:40 +0000)
commitd6667298d1d0d47de619b23078ceb83ec2c09d46
treef00edaa4f8e7c47141648f607fec8e0c58f99834
parent913ff23bac73a9a8825942c957b6252ab3f8f198
libnvdimm, region : make 'resource' attribute only readable by root

commit b8ff981f88df03c72a4de2f6eaa9ce447a10ac03 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 region
devices only readable by root. Otherwise we disclose physical address
information.

Fixes: 802f4be6feee ("libnvdimm: Add 'resource' sysfs attribute to regions")
Cc: Dave Jiang <dave.jiang@intel.com>
Cc: Johannes Thumshirn <jthumshirn@suse.de>
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>
drivers/nvdimm/region_devs.c