mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] sysrq: Allow access to sensitive keys to be restricted by default
@ 2013-09-30  1:31 Ben Hutchings
  2013-09-30  1:40 ` Dave Jones
  0 siblings, 1 reply; 3+ messages in thread
From: Ben Hutchings @ 2013-09-30  1:31 UTC (permalink / raw)
  To: Greg Kroah-Hartman, Jiri Slaby; +Cc: Bastian Blank, LKML

From: Bastian Blank <waldi@debian.org>

Add a Kconfig variable to set the initial value of the Magic SysRq mask
(sysctl: kernel.sysrq).

Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
---
This has been in Debian for a while, but should probably be signed-off
by Bastian as well.

Debian sets this to 0x01b6, which excludes.

          8 - enable debugging dumps of processes etc.
         64 - enable signalling of processes (term, kill, oom-kill)

Ben.

--- a/include/linux/sysrq.h
+++ b/include/linux/sysrq.h
@@ -18,7 +18,7 @@
 #include <linux/types.h>
 
 /* Enable/disable SYSRQ support by default (0==no, 1==yes). */
-#define SYSRQ_DEFAULT_ENABLE	1
+#define SYSRQ_DEFAULT_ENABLE	CONFIG_MAGIC_SYSRQ_DEFAULT_MASK
 
 /* Possible values of bitmask for enabling sysrq functions */
 /* 0x0001 is reserved for enable everything */
--- a/lib/Kconfig.debug
+++ b/lib/Kconfig.debug
@@ -312,6 +312,14 @@ config MAGIC_SYSRQ
 	  keys are documented in <file:Documentation/sysrq.txt>. Don't say Y
 	  unless you really know what this hack does.
 
+config MAGIC_SYSRQ_DEFAULT_MASK
+	hex "Default mask for Magic SysRq keys on the console"
+	depends on MAGIC_SYSRQ
+	default 1
+	help
+	  Specifies the default mask for the allowed SysRq keys.  This can be
+	  used to disable several sensitive keys by default.
+
 config DEBUG_KERNEL
 	bool "Kernel debugging"
 	help

-- 
Ben Hutchings
Life is like a sewer:
what you get out of it depends on what you put into it.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] sysrq: Allow access to sensitive keys to be restricted by default
  2013-09-30  1:31 [PATCH] sysrq: Allow access to sensitive keys to be restricted by default Ben Hutchings
@ 2013-09-30  1:40 ` Dave Jones
  2013-09-30  1:53   ` Greg Kroah-Hartman
  0 siblings, 1 reply; 3+ messages in thread
From: Dave Jones @ 2013-09-30  1:40 UTC (permalink / raw)
  To: Ben Hutchings; +Cc: Greg Kroah-Hartman, Jiri Slaby, Bastian Blank, LKML

On Mon, Sep 30, 2013 at 02:31:08AM +0100, Ben Hutchings wrote:
 > From: Bastian Blank <waldi@debian.org>
 > 
 > Add a Kconfig variable to set the initial value of the Magic SysRq mask
 > (sysctl: kernel.sysrq).
 > 
 > Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
 > ---
 > This has been in Debian for a while, but should probably be signed-off
 > by Bastian as well.
 > 
 > Debian sets this to 0x01b6, which excludes.
 > 
 >           8 - enable debugging dumps of processes etc.
 >          64 - enable signalling of processes (term, kill, oom-kill)
 > ...
 >  
 > +config MAGIC_SYSRQ_DEFAULT_MASK
 > +	hex "Default mask for Magic SysRq keys on the console"
 > +	depends on MAGIC_SYSRQ
 > +	default 1
 > +	help
 > +	  Specifies the default mask for the allowed SysRq keys.  This can be
 > +	  used to disable several sensitive keys by default.

Might be nice to have the mask values duplicated here to save having to
go grepping through code ?

	Dave


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] sysrq: Allow access to sensitive keys to be restricted by default
  2013-09-30  1:40 ` Dave Jones
@ 2013-09-30  1:53   ` Greg Kroah-Hartman
  0 siblings, 0 replies; 3+ messages in thread
From: Greg Kroah-Hartman @ 2013-09-30  1:53 UTC (permalink / raw)
  To: Dave Jones, Ben Hutchings, Jiri Slaby, Bastian Blank, LKML

On Sun, Sep 29, 2013 at 09:40:09PM -0400, Dave Jones wrote:
> On Mon, Sep 30, 2013 at 02:31:08AM +0100, Ben Hutchings wrote:
>  > From: Bastian Blank <waldi@debian.org>
>  > 
>  > Add a Kconfig variable to set the initial value of the Magic SysRq mask
>  > (sysctl: kernel.sysrq).
>  > 
>  > Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
>  > ---
>  > This has been in Debian for a while, but should probably be signed-off
>  > by Bastian as well.
>  > 
>  > Debian sets this to 0x01b6, which excludes.
>  > 
>  >           8 - enable debugging dumps of processes etc.
>  >          64 - enable signalling of processes (term, kill, oom-kill)
>  > ...
>  >  
>  > +config MAGIC_SYSRQ_DEFAULT_MASK
>  > +	hex "Default mask for Magic SysRq keys on the console"
>  > +	depends on MAGIC_SYSRQ
>  > +	default 1
>  > +	help
>  > +	  Specifies the default mask for the allowed SysRq keys.  This can be
>  > +	  used to disable several sensitive keys by default.
> 
> Might be nice to have the mask values duplicated here to save having to
> go grepping through code ?

Yeah, a hit would be good.  Like what '1' does as default would be a
nice start :)

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2013-09-30  1:53 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-09-30  1:31 [PATCH] sysrq: Allow access to sensitive keys to be restricted by default Ben Hutchings
2013-09-30  1:40 ` Dave Jones
2013-09-30  1:53   ` Greg Kroah-Hartman

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®