From mboxrd@z Thu Jan 1 00:00:00 1970 From: Gao feng Subject: problem with /proc/sysrq-trigger Date: Fri, 13 Apr 2012 14:40:06 +0800 Message-ID: <4F87CA46.708@cn.fujitsu.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: containers-bounces-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org Errors-To: containers-bounces-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org To: containers-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org Cc: dlezcano-NmTC/0ZBporQT0dZR+AlfA@public.gmane.org, ebiederm-aS9lmoZGLiVWk0Htik3J/w@public.gmane.org List-Id: containers.vger.kernel.org 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;