Skip to content

Commit af1abab

Browse files
committed
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 <[email protected]> Cc: Richard Weinberger <[email protected]> Cc: Anton Ivanov <[email protected]> Signed-off-by: "Eric W. Biederman" <[email protected]>
1 parent a13ae69 commit af1abab

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

arch/um/drivers/mconsole_kern.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ void mconsole_log(struct mc_request *req)
123123

124124
void mconsole_proc(struct mc_request *req)
125125
{
126-
struct vfsmount *mnt = task_active_pid_ns(current)->proc_mnt;
126+
struct vfsmount *mnt = init_pid_ns.proc_mnt;
127127
char *buf;
128128
int len;
129129
struct file *file;

0 commit comments

Comments
 (0)