[lkml]   [2015]   [Apr]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
Patch in this message
Subject[PATCH] proc: move the adding option Ngid to the end of proc/PID/status
Move debugging has been done and the following Kernel issue
was found with a number of applications.
Take a look at: (even though the comments are for Weibo.browser
they also pertain to other apps that use

In kernel(3.14) is a little different than before
it will generate /proc/PID/status in this way:
State: T (stopped)
Tgid: 8487
Ngid: 0 ---- add in kernel after (3.11 maybe)
Pid: 8487
PPid: 139
TracerPid: 0 ---------------------=> line 7

But on previous kernel(3.11), it normally like that:
State: S (sleeping)
Tgid: 2109
Pid: 2109
PPid: 231
TracerPid: 0 -----------------------=> line 6

WeiBo always assume the “TracePid” is in line 6 of the status.
And it will read “PPid: 139” instead of “TracePid: 0”,
which will made Weibo to kill the process because there is attached debugger.
This issue also met in other application.

As the Ngid is added later, so it should be added at the end of task_state.
It is better keeping compatible to avoid such issue.

Signed-off-by: Schallberger, Timothy M <>
Signed-off-by: Dongxing Zhang <>
Signed-off-by: Wang Xiaoming <>
fs/proc/array.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/fs/proc/array.c b/fs/proc/array.c
index fd02a9e..86dcd2b 100644
--- a/fs/proc/array.c
+++ b/fs/proc/array.c
@@ -163,15 +163,15 @@ static inline void task_state(struct seq_file *m, struct pid_namespace *ns,
- "Ngid:\t%d\n"
+ "Ngid:\t%d\n"
- tgid, ngid, pid_nr_ns(pid, ns), ppid, tpid,
+ tgid, pid_nr_ns(pid, ns), ppid, tpid,
from_kuid_munged(user_ns, cred->uid),
from_kuid_munged(user_ns, cred->euid),
from_kuid_munged(user_ns, cred->suid),
@@ -180,6 +180,7 @@ static inline void task_state(struct seq_file *m, struct pid_namespace *ns,
from_kgid_munged(user_ns, cred->egid),
from_kgid_munged(user_ns, cred->sgid),
from_kgid_munged(user_ns, cred->fsgid),
+ ngid,

group_info = cred->group_info;

 \ /
  Last update: 2015-04-17 05:01    [W:0.041 / U:3.744 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site