All of lore.kernel.org
 help / color / mirror / Atom feed
* problem with /proc/sysrq-trigger
@ 2012-04-13  6:40 Gao feng
       [not found] ` <4F87CA46.708-BthXqXjhjHXQFUHtdCDX3A@public.gmane.org>
  0 siblings, 1 reply; 3+ messages in thread
From: Gao feng @ 2012-04-13  6:40 UTC (permalink / raw)
  To: containers-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA
  Cc: dlezcano-NmTC/0ZBporQT0dZR+AlfA, ebiederm-aS9lmoZGLiVWk0Htik3J/w

Hi all

when I using the container, I found the /proc/sysrq-trigger is not isolated with the host.
when exec echo c > /proc/sysrq-trigger in the container,
the host will crash too.

I don't know if it's correct.
And if it's incorrect,can I fix this by just like this?

diff --git a/drivers/tty/sysrq.c b/drivers/tty/sysrq.c
index 05728894..da4d812 100644
--- a/drivers/tty/sysrq.c
+++ b/drivers/tty/sysrq.c
@@ -865,6 +865,10 @@ EXPORT_SYMBOL(unregister_sysrq_key);
 static ssize_t write_sysrq_trigger(struct file *file, const char __user *buf,
                                   size_t count, loff_t *ppos)
 {
+       if (current->nsproxy != &init_nsproxy)
+               return -EFAULT;

        if (count) {
                char c;

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

end of thread, other threads:[~2012-04-17  0:39 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-04-13  6:40 problem with /proc/sysrq-trigger Gao feng
     [not found] ` <4F87CA46.708-BthXqXjhjHXQFUHtdCDX3A@public.gmane.org>
2012-04-13 13:27   ` Serge Hallyn
2012-04-17  0:39     ` Gao feng

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.