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:	Sat,  6 Feb 2016 02:08:08 -0500
From:	green@...uxhacker.ru
To:	"Rafael J. Wysocki" <rjw@...ysocki.net>,
	Len Brown <lenb@...nel.org>, Thomas Renninger <trenn@...e.de>
Cc:	linux-acpi@...r.kernel.org, linux-kernel@...r.kernel.org,
	Oleg Drokin <green@...uxhacker.ru>
Subject: [PATCH] acpi/ec: Deny write access unless requested by module param

From: Oleg Drokin <green@...uxhacker.ru>

In debugfs it's not enough to just set file mode to read-only to
deny write access to a file, instead just don't provide
the write method unless write access is really requested.

Signed-off-by: Oleg Drokin <green@...uxhacker.ru>
---
I assume allowing run-time changes via /sys/module is preferrable,
opposed to forced module unload and reload to change this option,
but I can submit another patch to only depend on the module parameter
too, please let me know.

 drivers/acpi/ec_sys.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/acpi/ec_sys.c b/drivers/acpi/ec_sys.c
index bea8e42..6c7dd7a 100644
--- a/drivers/acpi/ec_sys.c
+++ b/drivers/acpi/ec_sys.c
@@ -73,6 +73,9 @@ static ssize_t acpi_ec_write_io(struct file *f, const char __user *buf,
 	loff_t init_off = *off;
 	int err = 0;
 
+	if (!write_support)
+		return -EINVAL;
+
 	if (*off >= EC_SPACE_SIZE)
 		return 0;
 	if (*off + count >= EC_SPACE_SIZE) {
-- 
2.1.0

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ