Skip to content

fix reading ESP during coredump

Nam Cao linux-fsdevel linux-kselftest lkml stable 3 versions – Applied

Status from this message: Applied to the vfs-6.14.misc branch of the vfs/vfs.git tree.

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v3 Latest2 patches 1 replyApplied 2/2
  2. v22 patches 2 repliesSuperseded
  3. v12 patches 7 repliesSuperseded

Patches in v3 All 2 applied

#Subject and filesSizeRepliesApplied
1/2fs/proc: do_task_stat: Fix ESP not readable during coredumpfs/proc/array.c+1 -10 repliesApplied
2/2selftests: coredump: Add stackdump testtools/testing/selftests/coredump/Makefile tools/testing/selftests/coredump/README.rst tools/testing/selftests/coredump/stackdump +1 more+222 -00 repliesApplied

Reviews trailers per patch

All 2 patches have a Reviewed-by or Acked-by.

PatchOleg NesterovKees CookJohn Ogness
1/2A-b A-b
2/2R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 3 reviewers.

Read the v3 thread

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

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.

v2..v3 https://lore.kernel.org/lkml/[email protected]/
- Move stackdump file to local directory [Kees]
- Always cleanup the stackdump file after the test [Kees]
- Remove unused empty function

v1..v2 https://lore.kernel.org/lkml/[email protected]/
- 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                               |   2 +-
 tools/testing/selftests/coredump/Makefile     |   7 +
 tools/testing/selftests/coredump/README.rst   |  50 ++++++
 tools/testing/selftests/coredump/stackdump    |  14 ++
 .../selftests/coredump/stackdump_test.c       | 151 ++++++++++++++++++
 5 files changed, 223 insertions(+), 1 deletion(-)
 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
Signature · 1 line
2.39.5