public inbox for linux-fsdevel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] fix reading ESP during coredump
@ 2024-11-06  9:22 Nam Cao
  2024-11-06  9:22 ` [PATCH 1/2] fs/proc: do_task_stat: Fix ESP not readable " Nam Cao
  2024-11-06  9:22 ` [PATCH 2/2] selftests: coredump: Add stackdump test Nam Cao
  0 siblings, 2 replies; 10+ messages in thread
From: Nam Cao @ 2024-11-06  9:22 UTC (permalink / raw)
  To: Shuah Khan, Andrew Morton, Oleg Nesterov, Dylan Hatch,
	Eric W . Biederman, John Ogness, Kees Cook, linux-kernel,
	linux-fsdevel, linux-kselftest
  Cc: Nam Cao

Hi,

In /proc/PID/stat, there is the kstkesp field which is the stack pointer of
a thread. While the thread is active, this field reads zero. But during a
coredump, it should have a valid value.

However, at the moment, kstkesp is zero even during coredump.

The first commit fixes this problem, 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/coredump/Makefile     |   7 +
 tools/testing/selftests/coredump/README.rst   |  50 ++++++
 tools/testing/selftests/coredump/stackdump    |  14 ++
 .../selftests/coredump/stackdump_test.c       | 154 ++++++++++++++++++
 5 files changed, 243 insertions(+), 18 deletions(-)
 create mode 100644 tools/testing/selftests/coredump/Makefile
 create mode 100644 tools/testing/selftests/coredump/README.rst
 create mode 100755 tools/testing/selftests/coredump/stackdump
 create mode 100644 tools/testing/selftests/coredump/stackdump_test.c

-- 
2.39.5


^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2024-12-22 19:19 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox