mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 2/3] thunderbolt: Make key root-only accessible
@ 2017-08-15  5:19 Bernat, Yehezkel
  2017-08-15  7:03 ` Mika Westerberg
  0 siblings, 1 reply; 2+ messages in thread
From: Bernat, Yehezkel @ 2017-08-15  5:19 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Andreas Noever, Michael Jamet, Mika Westerberg, Lukas Wunner,
	Andy Shevchenko, linux-kernel

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH 2/3] thunderbolt: Make key root-only accessible
  2017-08-15  5:19 [PATCH 2/3] thunderbolt: Make key root-only accessible Bernat, Yehezkel
@ 2017-08-15  7:03 ` Mika Westerberg
  0 siblings, 0 replies; 2+ messages in thread
From: Mika Westerberg @ 2017-08-15  7:03 UTC (permalink / raw)
  To: Bernat, Yehezkel
  Cc: Greg Kroah-Hartman, Andreas Noever, Michael Jamet, Lukas Wunner,
	Andy Shevchenko, linux-kernel

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>

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-08-15  7:03 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-08-15  5:19 [PATCH 2/3] thunderbolt: Make key root-only accessible Bernat, Yehezkel
2017-08-15  7:03 ` Mika Westerberg

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®