Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1711835 > unrolled thread

[PATCH 2/3] thunderbolt: Make key root-only accessible

Started by"Bernat, Yehezkel" <yehezkel.bernat@intel.com>
First post2017-08-15 07:20 +0200
Last post2017-08-15 09:10 +0200
Articles 2 — 2 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH 2/3] thunderbolt: Make key root-only accessible "Bernat, Yehezkel" <yehezkel.bernat@intel.com> - 2017-08-15 07:20 +0200
    Re: [PATCH 2/3] thunderbolt: Make key root-only accessible Mika Westerberg <mika.westerberg@linux.intel.com> - 2017-08-15 09:10 +0200

#1711835 — [PATCH 2/3] thunderbolt: Make key root-only accessible

From"Bernat, Yehezkel" <yehezkel.bernat@intel.com>
Date2017-08-15 07:20 +0200
Subject[PATCH 2/3] thunderbolt: Make key root-only accessible
Message-ID<ueCqJ-5xr-1@gated-at.bofh.it>
Non-root user may read the key back after root wrote it there.
This removes read access to everyone but root.

Signed-off-by: Yehezkel Bernat <yehezkel.bernat@intel.com>
---
 drivers/thunderbolt/switch.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/thunderbolt/switch.c b/drivers/thunderbolt/switch.c
index 69fde0b..8510abc 100644
--- a/drivers/thunderbolt/switch.c
+++ b/drivers/thunderbolt/switch.c
@@ -826,7 +826,7 @@ static ssize_t key_store(struct device *dev, struct device_attribute *attr,
 	mutex_unlock(&switch_lock);
 	return ret;
 }
-static DEVICE_ATTR_RW(key);
+static DEVICE_ATTR(key, 0600, key_show, key_store);
 
 static ssize_t nvm_authenticate_show(struct device *dev,
 	struct device_attribute *attr, char *buf)
-- 
2.7.4

[toc] | [next] | [standalone]


#1711915

FromMika Westerberg <mika.westerberg@linux.intel.com>
Date2017-08-15 09:10 +0200
Message-ID<ueE9c-6EU-23@gated-at.bofh.it>
In reply to#1711835
On Tue, Aug 15, 2017 at 08:19:12AM +0300, Bernat, Yehezkel wrote:
> Non-root user may read the key back after root wrote it there.
> This removes read access to everyone but root.
> 
> Signed-off-by: Yehezkel Bernat <yehezkel.bernat@intel.com>

Acked-by: Mika Westerberg <mika.westerberg@linux.intel.com>

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web