Message ID | 20191202083519.23138-7-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 c3e1732bcaa5..42e33ea50d1c 100644 --- a/fs/proc/array.c +++ b/fs/proc/array.c @@ -435,8 +435,11 @@ static int do_task_stat(struct seq_file *m, struct pid_namespace *ns, * safe because the task has stopped executing permanently. */ if (permitted && (task->flags & PF_DUMPCORE)) { - eip = KSTK_EIP(task); - esp = KSTK_ESP(task); + if (try_get_task_stack(task)) { + eip = KSTK_EIP(task); + esp = KSTK_ESP(task); + put_task_stack(task); + } } }