lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date:	Thu, 30 May 2013 21:54:01 +0530
From:	Vinod Koul <vinod.koul@...el.com>
To:	linux-kernel@...r.kernel.org
Cc:	broonie@...nel.org, Vinod Koul <vinod.koul@...el.com>
Subject: [PATCH 1/2] regmap: give users _choice_ to allow write access to debugfs

is very handy is debug kernels and should _never_ be turned On in production
mode

Signed-off-by: Vinod Koul <vinod.koul@...el.com>
---
 drivers/base/regmap/Kconfig          |    9 +++++++++
 drivers/base/regmap/regmap-debugfs.c |    3 +--
 2 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/drivers/base/regmap/Kconfig b/drivers/base/regmap/Kconfig
index f0d3054..928d6e3 100644
--- a/drivers/base/regmap/Kconfig
+++ b/drivers/base/regmap/Kconfig
@@ -20,3 +20,12 @@ config REGMAP_MMIO
 
 config REGMAP_IRQ
 	bool
+
+
+config REGMAP_ALLOW_WRITE_DEBUGFS
+	bool "Regmap write access to usermode"
+	default n
+	help
+	   WARNING: This allows usermode to write to hardware registers. Writing
+	   to stuff like PMICs is _never_ advised due to obvious side effects, use
+	   at very extreme caution. Is helpful for debugging
diff --git a/drivers/base/regmap/regmap-debugfs.c b/drivers/base/regmap/regmap-debugfs.c
index 23b701f..7989052 100644
--- a/drivers/base/regmap/regmap-debugfs.c
+++ b/drivers/base/regmap/regmap-debugfs.c
@@ -248,8 +248,7 @@ static ssize_t regmap_map_read_file(struct file *file, char __user *user_buf,
 				   count, ppos);
 }
 
-#undef REGMAP_ALLOW_WRITE_DEBUGFS
-#ifdef REGMAP_ALLOW_WRITE_DEBUGFS
+#ifdef CONFIG_REGMAP_ALLOW_WRITE_DEBUGFS
 /*
  * This can be dangerous especially when we have clients such as
  * PMICs, therefore don't provide any real compile time configuration option
-- 
1.7.0.4

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ