From: Gao feng <gaofeng-BthXqXjhjHXQFUHtdCDX3A@public.gmane.org>
To: containers-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org
Cc: dlezcano-NmTC/0ZBporQT0dZR+AlfA@public.gmane.org,
ebiederm-aS9lmoZGLiVWk0Htik3J/w@public.gmane.org
Subject: problem with /proc/sysrq-trigger
Date: Fri, 13 Apr 2012 14:40:06 +0800 [thread overview]
Message-ID: <4F87CA46.708@cn.fujitsu.com> (raw)
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;
next reply other threads:[~2012-04-13 6:40 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-04-13 6:40 Gao feng [this message]
[not found] ` <4F87CA46.708-BthXqXjhjHXQFUHtdCDX3A@public.gmane.org>
2012-04-13 13:27 ` problem with /proc/sysrq-trigger Serge Hallyn
2012-04-17 0:39 ` Gao feng
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4F87CA46.708@cn.fujitsu.com \
--to=gaofeng-bthxqxjhjhxqfuhtdcdx3a@public.gmane.org \
--cc=containers-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org \
--cc=dlezcano-NmTC/0ZBporQT0dZR+AlfA@public.gmane.org \
--cc=ebiederm-aS9lmoZGLiVWk0Htik3J/w@public.gmane.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox