linux-stable/fs/proc
John Ogness 730855b0f4 fs/proc/array.c: allow reporting eip/esp for all coredumping threads
commit cb8f381f16 upstream.

0a1eb2d474 ("fs/proc: Stop reporting eip and esp in /proc/PID/stat")
stopped reporting eip/esp and fd7d56270b ("fs/proc: Report eip/esp in
/prod/PID/stat for coredumping") reintroduced the feature to fix a
regression with userspace core dump handlers (such as minicoredumper).

Because PF_DUMPCORE is only set for the primary thread, this didn't fix
the original problem for secondary threads.  Allow reporting the eip/esp
for all threads by checking for PF_EXITING as well.  This is set for all
the other threads when they are killed.  coredump_wait() waits for all the
tasks to become inactive before proceeding to invoke a core dumper.

Link: http://lkml.kernel.org/r/87y32p7i7a.fsf@linutronix.de
Link: http://lkml.kernel.org/r/20190522161614.628-1-jlu@pengutronix.de
Fixes: fd7d56270b ("fs/proc: Report eip/esp in /prod/PID/stat for coredumping")
Signed-off-by: John Ogness <john.ogness@linutronix.de>
Reported-by: Jan Luebbe <jlu@pengutronix.de>
Tested-by: Jan Luebbe <jlu@pengutronix.de>
Cc: Alexey Dobriyan <adobriyan@gmail.com>
Cc: Andy Lutomirski <luto@kernel.org>
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-07-10 09:55:38 +02:00
..
array.c fs/proc/array.c: allow reporting eip/esp for all coredumping threads 2019-07-10 09:55:38 +02:00
base.c proc, oom: do not report alien mms when setting oom_score_adj 2019-02-27 10:06:58 +01:00
cmdline.c
consoles.c
cpuinfo.c
devices.c
fd.c proc: unsigned file descriptors 2016-09-27 18:47:38 -04:00
fd.h proc: unsigned file descriptors 2016-09-27 18:47:38 -04:00
generic.c proc: Fix unbalanced hard link numbers 2017-05-25 15:44:37 +02:00
inode.c proc/sysctl: prune stale dentries during unregistering 2018-08-15 18:14:43 +02:00
internal.h proc: Fix proc_sys_prune_dcache to hold a sb reference 2018-08-15 18:14:43 +02:00
interrupts.c
Kconfig fs, proc: add help for CONFIG_PROC_CHILDREN 2015-07-17 16:39:52 -07:00
kcore.c vfs/proc/kcore, x86/mm/kcore: Fix SMAP fault when dumping vsyscall user page 2018-05-30 07:50:26 +02:00
kmsg.c
loadavg.c
Makefile fs/proc: Add compiler check for -Wno-override-init to support gcc < 4.2 2016-08-03 12:45:23 -04:00
meminfo.c meminfo: break apart a very long seq_printf with #ifdefs 2016-10-07 18:46:30 -07:00
namespaces.c switch all procfs directories ->iterate_shared() 2016-05-02 19:49:30 -04:00
nommu.c
page.c mm: rename _count, field of the struct page, to _refcount 2016-05-19 19:12:14 -07:00
proc_net.c proc: make proc entries inherit ownership from parent 2016-08-14 21:07:20 -07:00
proc_sysctl.c fs/proc/proc_sysctl.c: Fix a NULL pointer dereference 2019-05-02 09:32:04 +02:00
proc_tty.c tty fix oops when rmmod 8250 2017-12-20 10:07:32 +01:00
root.c proc: Convert proc_mount to use mount_ns. 2016-06-23 15:41:54 -05:00
self.c fs: Replace CURRENT_TIME with current_time() for inode timestamps 2016-09-27 21:06:21 -04:00
softirqs.c
stat.c sched/cputime: Convert kcpustat to nsecs 2018-10-20 09:51:32 +02:00
task_mmu.c mm: larger stack guard gap, between vmas 2017-06-24 07:11:18 +02:00
task_nommu.c fs/proc: Stop trying to report thread stacks 2016-10-20 09:21:41 +02:00
thread_self.c fs: Replace CURRENT_TIME with current_time() for inode timestamps 2016-09-27 21:06:21 -04:00
uptime.c sched/cputime: Convert kcpustat to nsecs 2018-10-20 09:51:32 +02:00
version.c
vmcore.c crash_dump: Add vmcore_elf32_check_arch 2016-05-13 14:01:59 +02:00