Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753277AbdIRJK1 (ORCPT ); Mon, 18 Sep 2017 05:10:27 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:54472 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753238AbdIRJK0 (ORCPT ); Mon, 18 Sep 2017 05:10:26 -0400 From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Yehezkel Bernat , Mika Westerberg Subject: [PATCH 4.13 15/52] thunderbolt: Make key root-only accessible Date: Mon, 18 Sep 2017 11:09:43 +0200 Message-Id: <20170918090906.308249895@linuxfoundation.org> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20170918090904.072766209@linuxfoundation.org> References: <20170918090904.072766209@linuxfoundation.org> User-Agent: quilt/0.65 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 960 Lines: 31 4.13-stable review patch. If anyone has any objections, please let me know. ------------------ From: Bernat, Yehezkel commit 0956e41169222822d3557871fcd1d32e4fa7e934 upstream. 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 --- drivers/thunderbolt/switch.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/thunderbolt/switch.c +++ b/drivers/thunderbolt/switch.c @@ -826,7 +826,7 @@ static ssize_t key_store(struct device * 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)