WSL2-Linux-Kernel/fs/proc
John Ogness fd7d56270b fs/proc: Report eip/esp in /prod/PID/stat for coredumping
Commit 0a1eb2d474 ("fs/proc: Stop reporting eip and esp in
/proc/PID/stat") stopped reporting eip/esp because it is
racy and dangerous for executing tasks. The comment adds:

    As far as I know, there are no use programs that make any
    material use of these fields, so just get rid of them.

However, existing userspace core-dump-handler applications (for
example, minicoredumper) are using these fields since they
provide an excellent cross-platform interface to these valuable
pointers. So that commit introduced a user space visible
regression.

Partially revert the change and make the readout possible for
tasks with the proper permissions and only if the target task
has the PF_DUMPCORE flag set.

Fixes: 0a1eb2d474 ("fs/proc: Stop reporting eip and esp in> /proc/PID/stat")
Reported-by: Marco Felsch <marco.felsch@preh.de>
Signed-off-by: John Ogness <john.ogness@linutronix.de>
Reviewed-by: Andy Lutomirski <luto@kernel.org>
Cc: Tycho Andersen <tycho.andersen@canonical.com>
Cc: Kees Cook <keescook@chromium.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Brian Gerst <brgerst@gmail.com>
Cc: stable@vger.kernel.org
Cc: Tetsuo Handa <penguin-kernel@i-love.sakura.ne.jp>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Cc: Linux API <linux-api@vger.kernel.org>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Link: http://lkml.kernel.org/r/87poatfwg6.fsf@linutronix.de
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
2017-09-15 23:31:16 +02:00
..
Kconfig
Makefile
array.c fs/proc: Report eip/esp in /prod/PID/stat for coredumping 2017-09-15 23:31:16 +02:00
base.c mm: treewide: remove GFP_TEMPORARY allocation flag 2017-09-13 18:53:16 -07:00
cmdline.c
consoles.c
cpuinfo.c
devices.c block: order /proc/devices by major number 2017-07-17 15:42:20 +02:00
fd.c
fd.h
generic.c procfs: use faster rb_first_cached() 2017-09-08 18:26:49 -07:00
inode.c
internal.h procfs: use faster rb_first_cached() 2017-09-08 18:26:49 -07:00
interrupts.c
kcore.c
kmsg.c
loadavg.c
meminfo.c mm: rename global_page_state to global_zone_page_state 2017-09-06 17:27:29 -07:00
namespaces.c
nommu.c
page.c
proc_net.c procfs: use faster rb_first_cached() 2017-09-08 18:26:49 -07:00
proc_sysctl.c Merge branch 'akpm' (patches from Andrew) 2017-07-13 12:38:49 -07:00
proc_tty.c
root.c procfs: use faster rb_first_cached() 2017-09-08 18:26:49 -07:00
self.c
softirqs.c
stat.c
task_mmu.c mm: treewide: remove GFP_TEMPORARY allocation flag 2017-09-13 18:53:16 -07:00
task_nommu.c procfs: remove unused variable 2017-09-13 18:53:15 -07:00
thread_self.c
uptime.c
version.c
vmcore.c