Message ID | 20191202083519.23138-5-yi.zhang@huawei.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | fs/proc: Stop reporting eip and esp in | expand |
diff --git a/fs/proc/array.c b/fs/proc/array.c index 60cbaa821164..618c83f1866d 100644 --- a/fs/proc/array.c +++ b/fs/proc/array.c @@ -425,10 +425,11 @@ static int do_task_stat(struct seq_file *m, struct pid_namespace *ns, mm = get_task_mm(task); if (mm) { vsize = task_vsize(mm); - if (permitted) { - eip = KSTK_EIP(task); - esp = KSTK_ESP(task); - } + /* + * esp and eip are intentionally zeroed out. There is no + * non-racy way to read them without freezing the task. + * Programs that need reliable values can use ptrace(2). + */ } get_task_comm(tcomm, task);