libnvdimm, pfn: make 'resource' attribute only readable by root
authorDan Williams <dan.j.williams@intel.com>
Tue, 26 Sep 2017 20:07:06 +0000 (13:07 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 30 Nov 2017 08:39:07 +0000 (08:39 +0000)
commit2224973f18dcbb7b2f01fc20a40e28b7faf73140
tree3caa1768315beeb76eb1382371edd9b1b75ba466
parent8a42130ee8ae2c37f3f6ef0e3a556f907c8c82a9
libnvdimm, pfn: make 'resource' attribute only readable by root

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

Fixes: f6ed58c70d14 ("libnvdimm, pfn: 'resource'-address and 'size'...")
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/pfn_devs.c