[PATCH v3 2/2] selftests: coredump: Add stackdump test

2025-01-02 Thread Nam Cao
Add a test which checks that the kstkesp field in /proc/pid/stat can be read for all threads of a coredumping process. For full details including the motivation for this test and how it works, see the README file added by this commit. Reviewed-by: John Ogness Signed-off-by: Nam Cao --- tools

[PATCH v3 1/2] fs/proc: do_task_stat: Fix ESP not readable during coredump

2025-01-02 Thread Nam Cao
threads. Checking of PF_EXITING was added for coredumping, so it probably can now be removed. But it doesn't hurt to keep. Fixes: 92307383082d ("coredump: Don't perform any cleanups before dumping core") Cc: sta...@vger.kernel.org Cc: Eric W. Biederman Acked-by: Oleg Nesterov Ack

[PATCH v3 0/2] fix reading ESP during coredump

2025-01-02 Thread Nam Cao
empty function v1..v2 https://lore.kernel.org/lkml/cover.1730883229.git.nam...@linutronix.de/ - Change the fix patch to use PF_POSTCOREDUMP [Oleg] Nam Cao (2): fs/proc: do_task_stat: Fix ESP not readable during coredump selftests: coredump: Add stackdump test fs/proc/array.c

[PATCH v2 2/2] selftests: coredump: Add stackdump test

2024-12-30 Thread Nam Cao
Add a test which checks that the kstkesp field in /proc/pid/stat can be read for all threads of a coredumping process. For full details including the motivation for this test and how it works, see the README file added by this commit. Reviewed-by: John Ogness Signed-off-by: Nam Cao --- tools

[PATCH v2 0/2] fix reading ESP during coredump

2024-12-30 Thread Nam Cao
, and the second commit adds a selftest to detect if this problem appears again in the future. v2: - Change the fix patch to use PF_POSTCOREDUMP [Oleg] Link to v1: https://lore.kernel.org/lkml/cover.1730883229.git.nam...@linutronix.de/ Nam Cao (2): fs/proc: do_task_stat: Fix ESP not readable

[PATCH v2 1/2] fs/proc: do_task_stat: Fix ESP not readable during coredump

2024-12-30 Thread Nam Cao
threads. Checking of PF_EXITING was added for coredumping, so it probably can now be removed. But it doesn't hurt to keep. Fixes: 92307383082d ("coredump: Don't perform any cleanups before dumping core") Cc: sta...@vger.kernel.org Cc: Eric W. Biederman Acked-by: Oleg Nesterov S

Re: [PATCH 1/2] fs/proc: do_task_stat: Fix ESP not readable during coredump

2024-12-20 Thread Nam Cao
Hi Oleg, On Tue, Dec 17, 2024 at 04:09:14PM +0100, Oleg Nesterov wrote: > On 12/17, Oleg Nesterov wrote: > > > > On 11/06, Nam Cao wrote: > > > > > > @@ -534,6 +517,23 @@ static int do_task_stat(struct seq_file *m, struct > > > pid_namespace *ns, &

[PATCH 2/2] selftests: coredump: Add stackdump test

2024-11-06 Thread Nam Cao
Add a test which checks that the kstkesp field in /proc/pid/stat can be read for all threads of a coredumping process. For full details including the motivation for this test and how it works, see the README file added by this commit. Signed-off-by: Nam Cao --- tools/testing/selftests/coredump

[PATCH 1/2] fs/proc: do_task_stat: Fix ESP not readable during coredump

2024-11-06 Thread Nam Cao
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") Signed-off-

[PATCH 0/2] fix reading ESP during coredump

2024-11-06 Thread Nam Cao
, and the second commit adds a selftest to detect if this problem appears again in the future. Nam Cao (2): fs/proc: do_task_stat: Fix ESP not readable during coredump selftests: coredump: Add stackdump test fs/proc/array.c | 36 ++-- tools/testing/selftests