+ proc-report-eip-and-esp-for-all-threads-when-coredumping.patch added to -mm tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The patch titled
     Subject: proc: report eip and esp for all threads when coredumping
has been added to the -mm tree.  Its filename is
     proc-report-eip-and-esp-for-all-threads-when-coredumping.patch

This patch should soon appear at
    http://ozlabs.org/~akpm/mmots/broken-out/proc-report-eip-and-esp-for-all-threads-when-coredumping.patch
and later at
    http://ozlabs.org/~akpm/mmotm/broken-out/proc-report-eip-and-esp-for-all-threads-when-coredumping.patch

Before you just go and hit "reply", please:
   a) Consider who else should be cc'ed
   b) Prefer to cc a suitable mailing list as well
   c) Ideally: find the original patch on the mailing list and do a
      reply-to-all to that, adding suitable additional cc's

*** Remember to use Documentation/process/submit-checklist.rst when testing your code ***

The -mm tree is included into linux-next and is updated
there every 3-4 working days

------------------------------------------------------
From: Jan Luebbe <jlu@xxxxxxxxxxxxxx>
Subject: proc: report eip and esp for all threads when coredumping

0a1eb2d474ed ("fs/proc: Stop reporting eip and esp in /proc/PID/stat")
stopped reporting eip/esp and fd7d56270b52 ("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.  This commit checks
mm->core_state instead, as already done for /proc/<pid>/status in
task_core_dumping().  As we have a mm_struct available here anyway, this
seems to be a clean solution.

Link: http://lkml.kernel.org/r/20190522161614.628-1-jlu@xxxxxxxxxxxxxx
Fixes: fd7d56270b526ca3 ("fs/proc: Report eip/esp in /prod/PID/stat for coredumping")
Signed-off-by: Jan Luebbe <jlu@xxxxxxxxxxxxxx>
Cc: Alexey Dobriyan <adobriyan@xxxxxxxxx>
Cc: John Ogness <john.ogness@xxxxxxxxxxxxx>
Cc: Andy Lutomirski <luto@xxxxxxxxxx>
Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>
---

 fs/proc/array.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/fs/proc/array.c~proc-report-eip-and-esp-for-all-threads-when-coredumping
+++ a/fs/proc/array.c
@@ -462,7 +462,7 @@ static int do_task_stat(struct seq_file
 		 * a program is not able to use ptrace(2) in that case. It is
 		 * safe because the task has stopped executing permanently.
 		 */
-		if (permitted && (task->flags & PF_DUMPCORE)) {
+		if (permitted && (!!mm->core_state)) {
 			if (try_get_task_stack(task)) {
 				eip = KSTK_EIP(task);
 				esp = KSTK_ESP(task);
_

Patches currently in -mm which might be from jlu@xxxxxxxxxxxxxx are

proc-report-eip-and-esp-for-all-threads-when-coredumping.patch




[Index of Archives]     [Kernel Archive]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]

  Powered by Linux