android_kernel_samsung_a7y1.../fs/proc
John Ogness 9a9147b8d3 fs/proc: Report eip/esp in /prod/PID/stat for coredumping
commit fd7d56270b526ca3ed0c224362e3c64a0f86687a upstream.

Commit 0a1eb2d474ed ("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: 0a1eb2d474ed ("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>
[ zhangyi: 68db0cf10678 does not merged, skip the task_stack.h for 4.4]
Signed-off-by: zhangyi (F) <yi.zhang@huawei.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-04-07 13:06:12 +02:00
..
array.c fs/proc: Report eip/esp in /prod/PID/stat for coredumping 2020-04-07 13:06:12 +02:00
base.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
cmdline.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
consoles.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
cpuinfo.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
devices.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
fd.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
fd.h A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
fslog.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
generic.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
inode.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
internal.h A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
interrupts.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
Kconfig A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
kcore.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
kmsg.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
loadavg.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
Makefile A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
meminfo.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
namespaces.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
nommu.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
page.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
proc_net.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
proc_sysctl.c fs/proc/proc_sysctl.c: Fix a NULL pointer dereference 2020-04-06 16:40:32 +02:00
proc_tty.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
root.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
self.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
softirqs.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
stat.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
task_mmu.c Revert "coredump: fix race condition between mmget_not_zero()/get_task_mm() and core dumping" 2020-04-06 22:47:46 +05:30
task_nommu.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
thread_self.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
uid.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
uptime.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
version.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
vmcore.c proc/vmcore: Fix i386 build error of missing copy_oldmem_page_encrypted() 2020-04-07 12:33:05 +02:00