Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1423908AbbFEOhP (ORCPT ); Fri, 5 Jun 2015 10:37:15 -0400 Received: from opensource.wolfsonmicro.com ([80.75.67.52]:55230 "EHLO opensource.wolfsonmicro.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1030244AbbFEOgz (ORCPT ); Fri, 5 Jun 2015 10:36:55 -0400 From: Richard Fitzgerald To: gregkh@linuxfoundation.org, broonie@kernel.org Cc: linux-kernel@vger.kernel.org, patches@opensource.wolfsonmicro.com Subject: [PATCH 2/2] regmap: Fix permissions on debugfs cache controls Date: Fri, 5 Jun 2015 15:34:46 +0100 Message-Id: <1433514886-11884-3-git-send-email-rf@opensource.wolfsonmicro.com> X-Mailer: git-send-email 1.7.2.5 In-Reply-To: <1433514886-11884-1-git-send-email-rf@opensource.wolfsonmicro.com> References: <1433514886-11884-1-git-send-email-rf@opensource.wolfsonmicro.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1575 Lines: 41 The cache_only and cache_bypass debugfs entries are expected to be writable by user-side but are set to read-only permissions. This is only working accidentally because debugfs doesn't currently honour the read-only bit. Signed-off-by: Richard Fitzgerald --- drivers/base/regmap/regmap-debugfs.c | 12 ++++++------ 1 files changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/base/regmap/regmap-debugfs.c b/drivers/base/regmap/regmap-debugfs.c index 5799a0b..a48579e 100644 --- a/drivers/base/regmap/regmap-debugfs.c +++ b/drivers/base/regmap/regmap-debugfs.c @@ -530,12 +530,12 @@ void regmap_debugfs_init(struct regmap *map, const char *name) } if (map->cache_type) { - debugfs_create_bool("cache_only", 0400, map->debugfs, - &map->cache_only); - debugfs_create_bool("cache_dirty", 0400, map->debugfs, - &map->cache_dirty); - debugfs_create_bool("cache_bypass", 0400, map->debugfs, - &map->cache_bypass); + debugfs_create_bool("cache_only", S_IRUGO | S_IWUSR, + map->debugfs, &map->cache_only); + debugfs_create_bool("cache_dirty", S_IRUGO, + map->debugfs, &map->cache_dirty); + debugfs_create_bool("cache_bypass", S_IRUGO | S_IWUSR, + map->debugfs, &map->cache_bypass); } next = rb_first(&map->range_tree); -- 1.7.2.5 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/