Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1740269
| Path | csiph.com!aioe.org!bofh.it!news.nic.it!robomod |
|---|---|
| From | Dan Williams <dan.j.williams@intel.com> |
| Newsgroups | linux.kernel |
| Subject | [PATCH 1/3] libnvdimm, region : make 'resource' attribute only readable by root |
| Date | Wed, 27 Sep 2017 01:10:01 +0200 |
| Message-ID | <uu79f-2IR-5@gated-at.bofh.it> (permalink) |
| References | <uu79f-2IR-7@gated-at.bofh.it> |
| X-Extloop1 | 1 |
| X-Ironport-Av | E=Sophos;i="5.42,441,1500966000"; d="scan'208";a="139811777" |
| User-Agent | StGit/0.17.1-9-g687f |
| MIME-Version | 1.0 |
| Content-Type | text/plain; charset="utf-8" |
| Content-Transfer-Encoding | 7bit |
| Sender | robomod@news.nic.it |
| List-ID | <linux-kernel.vger.kernel.org> |
| X-Mailing-List | linux-kernel@vger.kernel.org |
| Approved | robomod@news.nic.it |
| Lines | 34 |
| Organization | linux.* mail to news gateway |
| X-Original-Cc | Dave Hansen <dave.hansen@linux.intel.com>, Dave Jiang <dave.jiang@intel.com>, linux-kernel@vger.kernel.org, stable@vger.kernel.org, Johannes Thumshirn <jthumshirn@suse.de> |
| X-Original-Date | Tue, 26 Sep 2017 15:57:15 -0700 |
| X-Original-Message-ID | <150646663509.6588.1400157739735618779.stgit@dwillia2-desk3.amr.corp.intel.com> |
| X-Original-References | <150646662980.6588.6123788075203842948.stgit@dwillia2-desk3.amr.corp.intel.com> |
| X-Original-Sender | linux-kernel-owner@vger.kernel.org |
| Xref | csiph.com linux.kernel:1740269 |
Show key headers only | View raw
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: <stable@vger.kernel.org>
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>
---
drivers/nvdimm/region_devs.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/drivers/nvdimm/region_devs.c b/drivers/nvdimm/region_devs.c
index 829d760f651c..abaf38c61220 100644
--- a/drivers/nvdimm/region_devs.c
+++ b/drivers/nvdimm/region_devs.c
@@ -562,8 +562,12 @@ static umode_t region_visible(struct kobject *kobj, struct attribute *a, int n)
if (!is_nd_pmem(dev) && a == &dev_attr_badblocks.attr)
return 0;
- if (!is_nd_pmem(dev) && a == &dev_attr_resource.attr)
- return 0;
+ if (a == &dev_attr_resource.attr) {
+ if (is_nd_pmem(dev))
+ return 0400;
+ else
+ return 0;
+ }
if (a == &dev_attr_deep_flush.attr) {
int has_flush = nvdimm_has_flush(nd_region);
Back to linux.kernel | Previous | Next | Find similar | Unroll thread
[PATCH 1/3] libnvdimm, region : make 'resource' attribute only readable by root Dan Williams <dan.j.williams@intel.com> - 2017-09-27 01:10 +0200
csiph-web