[PATCH v5 00/12] unwind_deferred: Implement sframe handling

Steven Rostedt posted 12 patches 1 year ago
There is a newer version of this series
MAINTAINERS                       |   1 +
arch/Kconfig                      |  23 ++
arch/x86/Kconfig                  |   1 +
arch/x86/include/asm/mmu.h        |   2 +-
arch/x86/include/asm/uaccess.h    |  39 ++-
fs/binfmt_elf.c                   |  49 +++-
include/linux/mm_types.h          |   3 +
include/linux/sframe.h            |  60 ++++
include/linux/unwind_user_types.h |   1 +
include/uapi/linux/elf.h          |   1 +
include/uapi/linux/prctl.h        |   5 +-
kernel/fork.c                     |  10 +
kernel/sys.c                      |   9 +
kernel/unwind/Makefile            |   1 +
kernel/unwind/sframe.c            | 596 ++++++++++++++++++++++++++++++++++++++
kernel/unwind/sframe.h            |  71 +++++
kernel/unwind/sframe_debug.h      |  99 +++++++
kernel/unwind/user.c              |  22 +-
mm/init-mm.c                      |   2 +
19 files changed, 977 insertions(+), 18 deletions(-)
create mode 100644 include/linux/sframe.h
create mode 100644 kernel/unwind/sframe.c
create mode 100644 kernel/unwind/sframe.h
create mode 100644 kernel/unwind/sframe_debug.h
[PATCH v5 00/12] unwind_deferred: Implement sframe handling
Posted by Steven Rostedt 1 year ago
I'm currently working on getting sframe support from the kernel.
Josh Poimboeuf did a lot of the hard work already, but he told me he doesn't
have time to continue it so I'm picking it up where he left off.

His last series of v4 is here:

  https://lore.kernel.org/all/cover.1737511963.git.jpoimboe@kernel.org/

It covers a lot of topics as he found issues with other aspects of
the kernel that needed to be fixed for sframes to work properly.

This adds the support for sframes to the deferred unwinder. It is based
on top of this series:

  https://lore.kernel.org/all/20250424192456.851953422@goodmis.org/

This series is the last of the work that Josh had done in v4.
Note, I did not address the comments that were made in the previous series.
I'm posting this so that others may have something to work from that is
based on the deferred unwinder code of the other series. This series is
specific for sframe decoding itself and can be worked on separately from the
other series.

Hopefully someone that understands the sframe specification better than
I do can continue this work. I'm only posting this so that there's
something others can start with.

Where there were discussions done on patches in v4, I left a Link:
tag in the change log so that it is easy to go back and see what was
discussed, as this series did not make an attempt to resolve those
discussions.

I'll be working on the other three series in trying to get them ready
for submission. Those series are:

 vdso: https://lore.kernel.org/all/20250422183439.895236512@goodmis.org/
 [ Which is a separate work that is not directly needed by the other serise ]

 perf: https://lore.kernel.org/all/20250424162529.686762589@goodmis.org/

 tracing: https://lore.kernel.org/all/20250424192456.851953422@goodmis.org/
 [ This is based on top of the perf series ]

Again, this series is based on the tracing series.

Hopefully someone can help me and work on this series ;-)

Cheers!

Josh Poimboeuf (12):
      unwind_user/sframe: Add support for reading .sframe headers
      unwind_user/sframe: Store sframe section data in per-mm maple tree
      x86/uaccess: Add unsafe_copy_from_user() implementation
      unwind_user/sframe: Add support for reading .sframe contents
      unwind_user/sframe: Detect .sframe sections in executables
      unwind_user/sframe: Add prctl() interface for registering .sframe sections
      unwind_user/sframe: Wire up unwind_user to sframe
      unwind_user/sframe/x86: Enable sframe unwinding on x86
      unwind_user/sframe: Remove .sframe section on detected corruption
      unwind_user/sframe: Show file name in debug output
      unwind_user/sframe: Enable debugging in uaccess regions
      unwind_user/sframe: Add .sframe validation option

----
 MAINTAINERS                       |   1 +
 arch/Kconfig                      |  23 ++
 arch/x86/Kconfig                  |   1 +
 arch/x86/include/asm/mmu.h        |   2 +-
 arch/x86/include/asm/uaccess.h    |  39 ++-
 fs/binfmt_elf.c                   |  49 +++-
 include/linux/mm_types.h          |   3 +
 include/linux/sframe.h            |  60 ++++
 include/linux/unwind_user_types.h |   1 +
 include/uapi/linux/elf.h          |   1 +
 include/uapi/linux/prctl.h        |   5 +-
 kernel/fork.c                     |  10 +
 kernel/sys.c                      |   9 +
 kernel/unwind/Makefile            |   1 +
 kernel/unwind/sframe.c            | 596 ++++++++++++++++++++++++++++++++++++++
 kernel/unwind/sframe.h            |  71 +++++
 kernel/unwind/sframe_debug.h      |  99 +++++++
 kernel/unwind/user.c              |  22 +-
 mm/init-mm.c                      |   2 +
 19 files changed, 977 insertions(+), 18 deletions(-)
 create mode 100644 include/linux/sframe.h
 create mode 100644 kernel/unwind/sframe.c
 create mode 100644 kernel/unwind/sframe.h
 create mode 100644 kernel/unwind/sframe_debug.h
Re: [PATCH v5 00/12] unwind_deferred: Implement sframe handling
Posted by Steven Rostedt 1 year ago
On Thu, 24 Apr 2025 16:15:11 -0400
Steven Rostedt <rostedt@goodmis.org> wrote:

> Hopefully someone can help me and work on this series ;-)

To make this easier, I applied all the series to one of my git branches and
pushed it to my personal repo:

  git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace.git

  branch: tip/sframe

-- Steve