[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <87pllq79sh.ffs@tglx>
Date: Tue, 17 Dec 2024 13:50:54 +0100
From: Thomas Gleixner <tglx@...utronix.de>
To: Nam Cao <namcao@...utronix.de>, Shuah Khan <shuah@...nel.org>, Andrew
Morton <akpm@...ux-foundation.org>, Oleg Nesterov <oleg@...hat.com>, Dylan
Hatch <dylanbhatch@...gle.com>, "Eric W . Biederman"
<ebiederm@...ssion.com>, John Ogness <john.ogness@...utronix.de>, Kees
Cook <kees@...nel.org>, linux-kernel@...r.kernel.org,
linux-fsdevel@...r.kernel.org, linux-kselftest@...r.kernel.org, Christian
Brauner <brauner@...nel.org>
Cc: Nam Cao <namcao@...utronix.de>, stable@...r.kernel.org
Subject: Re: [PATCH 1/2] fs/proc: do_task_stat: Fix ESP not readable during
coredump
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
Powered by blists - more mailing lists