From: Bernat, Yehezkel Date: Tue, 15 Aug 2017 05:19:12 +0000 (+0300) Subject: thunderbolt: Make key root-only accessible X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=0956e41169222822d3557871fcd1d32e4fa7e934;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git thunderbolt: Make key root-only accessible 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 Acked-by: Mika Westerberg Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/thunderbolt/switch.c b/drivers/thunderbolt/switch.c index 69fde0b30eda..8510abcee5d2 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)