Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <8736ausby1.fsf_-_@x220.int.ebiederm.org>
Date: Fri, 28 Feb 2020 14:18:14 -0600
From: ebiederm@...ssion.com (Eric W. Biederman)
To: <linux-kernel@...r.kernel.org>
Cc: Al Viro <viro@...iv.linux.org.uk>,  Kernel Hardening
 <kernel-hardening@...ts.openwall.com>,  Linux API
 <linux-api@...r.kernel.org>,  Linux FS Devel
 <linux-fsdevel@...r.kernel.org>,  Linux Security Module
 <linux-security-module@...r.kernel.org>,  Akinobu Mita
 <akinobu.mita@...il.com>,  Alexey Dobriyan <adobriyan@...il.com>,  Andrew
 Morton <akpm@...ux-foundation.org>,  Andy Lutomirski <luto@...nel.org>,
  Daniel Micay <danielmicay@...il.com>,  Djalal Harouni <tixxdz@...il.com>,
  "Dmitry V . Levin" <ldv@...linux.org>,  Greg Kroah-Hartman
 <gregkh@...uxfoundation.org>,  Ingo Molnar <mingo@...nel.org>,  "J . Bruce
 Fields" <bfields@...ldses.org>,  Jeff Layton <jlayton@...chiereds.net>,
  Jonathan Corbet <corbet@....net>,  Kees Cook <keescook@...omium.org>,
  Oleg Nesterov <oleg@...hat.com>,  Alexey Gladkov
 <gladkov.alexey@...il.com>,  Linus Torvalds
 <torvalds@...ux-foundation.org>,  Jeff Dike <jdike@...toit.com>,  Richard
 Weinberger <richard@....at>,  Anton Ivanov
 <anton.ivanov@...bridgegreys.com>
Subject: [PATCH 1/3] uml: Don't consult current to find the proc_mnt in mconsole_proc


Inspection of the control flow reveals that mconsole_proc is either
called from mconsole_stop called from mc_work_proc or from
mc_work_proc directly.  The function mc_work_proc is dispatched to a
kernel thread with schedule_work.

All of the threads that run dispatched by schedule_work are in the
init pid namespace.

So make the code clearer and by using init_pid_ns instead of
task_active_pid_ns(current).

Cc: Jeff Dike <jdike@...toit.com>
Cc: Richard Weinberger <richard@....at>
Cc: Anton Ivanov <anton.ivanov@...bridgegreys.com>
Signed-off-by: "Eric W. Biederman" <ebiederm@...ssion.com>
---
 arch/um/drivers/mconsole_kern.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/um/drivers/mconsole_kern.c b/arch/um/drivers/mconsole_kern.c
index b80a1d616e4e..e8f5c81c2c6c 100644
--- a/arch/um/drivers/mconsole_kern.c
+++ b/arch/um/drivers/mconsole_kern.c
@@ -123,7 +123,7 @@ void mconsole_log(struct mc_request *req)
 
 void mconsole_proc(struct mc_request *req)
 {
-	struct vfsmount *mnt = task_active_pid_ns(current)->proc_mnt;
+	struct vfsmount *mnt = init_pid_ns.proc_mnt;
 	char *buf;
 	int len;
 	struct file *file;
-- 
2.25.0

Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.