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>] [day] [month] [year] [list]
Message-Id: <1294361035-22843-1-git-send-email-sjg@chromium.org>
Date:	Thu,  6 Jan 2011 16:43:55 -0800
From:	Simon Glass <sjg@...omium.org>
To:	linux-kernel@...r.kernel.org
Cc:	Simon Glass <sjg@...omium.org>
Subject: [PATCH] Initialize sysctl to 1 to fix /proc/sys/kernel/sysrq value

sysreq has previously (before commit 97f5f0cd) been initialized to 1,
thus enabling it on startup and making this value visible to user
space via /proc/sys/kernel/sysrq.

Commit 97f5f0cd split the __sysrq_enabled into two variables, one in
kernel/sysctl.c and the other in drivers/char/sysrq.c. The second is
initialised to 1 but the first is not, and I can find no mechanism in
the code to do so.

The upshot of this problem is that sysrq will read as 0 and appear to
be disabled as far as user space thinks, even though in fact it will
be enabled on boot. This problem goes away as soon as anyone writes
the sysrq file, and in particular when sysctl.conf contains the sysrq
line, so it may not be obvious.

This simple fix just initialises the variable on the sysctl.c side.

Change-Id: Iaeda23abf236e7791d71a384dc453b6a0138eaf5

Signed-off-by: Simon Glass <sjg@...omium.org>
---
 kernel/sysctl.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/kernel/sysctl.c b/kernel/sysctl.c
index 3a45c22..4b2f758 100644
--- a/kernel/sysctl.c
+++ b/kernel/sysctl.c
@@ -171,7 +171,8 @@ static int proc_taint(struct ctl_table *table, int write,
 #endif
 
 #ifdef CONFIG_MAGIC_SYSRQ
-static int __sysrq_enabled; /* Note: sysrq code ises it's own private copy */
+/* Note: sysrq code in drivers/char/sysrq.c uses its own private copy */
+static int __sysrq_enabled = 1;
 
 static int sysrq_sysctl_handler(ctl_table *table, int write,
 				void __user *buffer, size_t *lenp,
-- 
1.7.3.1

--
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