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:40:54 +0000 (08:40 +0000)
commit9a31016ea05be4c90ddf691f29aaf999e606e55e
treeb01747b82b5be5346d0d4a7f094fce6048c68c43
parent0f8fb6d5c2b77631c9b8d45417d2146e914ddb1b
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