From: Thomas Gleixner <tglx@linutronix.de>
To: Nam Cao <namcao@linutronix.de>, Shuah Khan <shuah@kernel.org>,
Andrew Morton <akpm@linux-foundation.org>,
Oleg Nesterov <oleg@redhat.com>,
Dylan Hatch <dylanbhatch@google.com>,
"Eric W . Biederman" <ebiederm@xmission.com>,
John Ogness <john.ogness@linutronix.de>,
Kees Cook <kees@kernel.org>,
linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org,
linux-kselftest@vger.kernel.org,
Christian Brauner <brauner@kernel.org>
Cc: Nam Cao <namcao@linutronix.de>, stable@vger.kernel.org
Subject: Re: [PATCH 1/2] fs/proc: do_task_stat: Fix ESP not readable during coredump
Date: Tue, 17 Dec 2024 13:50:54 +0100 [thread overview]
Message-ID: <87pllq79sh.ffs@tglx> (raw)
In-Reply-To: <11e1777296b7d06085c9fd341bafc4b9d82e6e4e.1730883229.git.namcao@linutronix.de>
On Wed, Nov 06 2024 at 10:22, Nam Cao wrote:
> Commit 0a1eb2d474ed ("fs/proc: Stop reporting eip and esp in
> /proc/PID/stat") disabled stack pointer reading, because it is generally
> dangerous to do so.
>
> Commit fd7d56270b52 ("fs/proc: Report eip/esp in /prod/PID/stat for
> coredumping") made an exception for coredumping thread, because for this
> case it is safe.
>
> The exception was later extended to all threads in a coredumping process by
> commit cb8f381f1613 ("fs/proc/array.c: allow reporting eip/esp for all
> coredumping threads").
>
> The above two commits determine if a task is core dumping by checking the
> PF_EXITING and PF_DUMPCORE flags.
>
> However, commit 92307383082d ("coredump: Don't perform any cleanups before
> dumping core") moved coredump to happen earlier and before PF_EXITING is
> set. Thus, the check of the PF_EXITING flag no longer works.
>
> Instead, use task->signal->core_state to determine if coredump is
> happening. This pointer is set at the beginning of coredump and is cleared
> once coredump is done. Thus, while this pointer is not NULL, it is safe to
> read ESP.
>
> Fixes: 92307383082d ("coredump: Don't perform any cleanups before dumping core")
Can we please make progress with that? It's a user space visible change
which causes a regression in core dumper tools.
Thanks,
tglx
next prev parent reply other threads:[~2024-12-17 12:50 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-11-06 9:22 [PATCH 0/2] fix reading ESP during coredump Nam Cao
2024-11-06 9:22 ` [PATCH 1/2] fs/proc: do_task_stat: Fix ESP not readable " Nam Cao
2024-11-06 14:30 ` John Ogness
2024-12-17 12:50 ` Thomas Gleixner [this message]
2024-12-17 14:59 ` Oleg Nesterov
2024-12-17 15:09 ` Oleg Nesterov
2024-12-20 14:53 ` Nam Cao
2024-12-22 19:18 ` Oleg Nesterov
2024-11-06 9:22 ` [PATCH 2/2] selftests: coredump: Add stackdump test Nam Cao
2024-11-06 14:32 ` John Ogness
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87pllq79sh.ffs@tglx \
--to=tglx@linutronix.de \
--cc=akpm@linux-foundation.org \
--cc=brauner@kernel.org \
--cc=dylanbhatch@google.com \
--cc=ebiederm@xmission.com \
--cc=john.ogness@linutronix.de \
--cc=kees@kernel.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=namcao@linutronix.de \
--cc=oleg@redhat.com \
--cc=shuah@kernel.org \
--cc=stable@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.