lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20260206193642.1580787-1-jremus@linux.ibm.com>
Date: Fri,  6 Feb 2026 20:36:36 +0100
From: Jens Remus <jremus@...ux.ibm.com>
To: linux-kernel@...r.kernel.org, linux-trace-kernel@...r.kernel.org,
        bpf@...r.kernel.org, x86@...nel.org, linux-mm@...ck.org,
        Steven Rostedt <rostedt@...nel.org>
Cc: Jens Remus <jremus@...ux.ibm.com>, Josh Poimboeuf <jpoimboe@...nel.org>,
        Masami Hiramatsu <mhiramat@...nel.org>,
        Mathieu Desnoyers <mathieu.desnoyers@...icios.com>,
        Peter Zijlstra <peterz@...radead.org>, Ingo Molnar <mingo@...nel.org>,
        Jiri Olsa <jolsa@...nel.org>,
        Arnaldo Carvalho de Melo <acme@...nel.org>,
        Namhyung Kim <namhyung@...nel.org>,
        Thomas Gleixner <tglx@...utronix.de>,
        Andrii Nakryiko <andrii@...nel.org>,
        Indu Bhagat <indu.bhagat@...cle.com>,
        "Jose E. Marchesi" <jemarch@....org>,
        Beau Belgrave <beaub@...ux.microsoft.com>,
        Linus Torvalds <torvalds@...ux-foundation.org>,
        Andrew Morton <akpm@...ux-foundation.org>,
        Florian Weimer <fweimer@...hat.com>, Kees Cook <kees@...nel.org>,
        "Carlos O'Donell" <codonell@...hat.com>, Sam James <sam@...too.org>,
        Dylan Hatch <dylanbhatch@...gle.com>, Borislav Petkov <bp@...en8.de>,
        Dave Hansen <dave.hansen@...ux.intel.com>,
        David Hildenbrand <david@...nel.org>, "H. Peter Anvin" <hpa@...or.com>,
        "Liam R. Howlett" <Liam.Howlett@...cle.com>,
        Lorenzo Stoakes <lorenzo.stoakes@...cle.com>,
        Michal Hocko <mhocko@...e.com>, Mike Rapoport <rppt@...nel.org>,
        Suren Baghdasaryan <surenb@...gle.com>,
        Vlastimil Babka <vbabka@...e.cz>, Heiko Carstens <hca@...ux.ibm.com>,
        Vasily Gorbik <gor@...ux.ibm.com>
Subject: [PATCH v8 0/6] x86/vdso: VDSO updates and fixes for sframes

This enables generation of SFrame V3 stack trace information for VDSO on
x86-64.  It's a continuation of Josh's and Steve's work:

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

This series focuses only on the VDSO code. They are helpful fixes
and updates that doesn't rely on sframes (although the last patch
is sframe related).

This series applies on top of tip:x86/entry:

  git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git  x86/entry

Like the unwind user sframe series [1] it depends on the upcoming
binutils 2.46 release to be used to build the VDSO with SFrame V3
stack trace information (using the assembler option --gsframe-3).

[1]: [PATCH v13 00/18] unwind_deferred: Implement sframe handling,
    https://lore.kernel.org/all/20260127150554.2760964-1-jremus@linux.ibm.com/

Changes in v8 (see individual patch notes):
- Discard .sframe for x32 and x86-32 VDSOs. (Josh/Indu)
- Define CFI_SIGNAL_FRAME for !BUILD_VDSO.
- Drop .cfi_sections .sframe in dwarf2.h in favor of the explicitly
  specified more specific assembler option --gsframe-3.
- Incorporate missing changes and review feedback from Steven's v6
  (I erroneously based my v6 on Steven's v5):
  - Reword patch 3 commit subject to Steven's v6 one.
  - Remove SYM_F_ALIGN in __vdso_sgx_enter_enclave(). (Josh)

Changes in v7 (see individual patch notes):
- Rebase on H. Peter Anvin's vDSO changes on tip:x86/entry. (Peter)
- Simplify adding assembler option -Wa,--gsframe-3.  Add for vdso64
  only.
- Align to .eh_frame and mark .sframe as KEEP in vDSO linker script.
  Note that GNU linker 2.46 will mark .sframe as KEEP in its default
  linker script as well.

Changes in v6:
- SFrame V3 support (SFrame V2 is not supported).
- Prevent GNU_SFRAME program table entry to empty .sframe section.
- Integrate v5 review feedback. (Josh)


I verified as follows on x86-64 using a binutils 2.46 pre-release build
that only the x86-64 VDSO has an .sframe section and GNU_SFRAME program
table entry:

$ make defconfig
*** Default configuration is based on 'x86_64_defconfig'
$ make arch/x86/entry/vdso/
  OBJCOPY arch/x86/entry/vdso/vdso64/vdso64.so
  VDSO2C  arch/x86/entry/vdso/vdso64/vdso64-image.c
  VDSO    arch/x86/entry/vdso/vdso32/vdso32.so.dbg
  OBJCOPY arch/x86/entry/vdso/vdso32/vdso32.so
$ readelf -WSl arch/x86/entry/vdso/vdso*/vdso*.so | egrep "File:|GNU_SFRAME"
File: arch/x86/entry/vdso/vdso32/vdso32.so
File: arch/x86/entry/vdso/vdso64/vdso64.so
  [13] .sframe           GNU_SFRAME      00000000000007e0 0007e0 00012b 00   A  0   0  8
  GNU_SFRAME     0x0007e0 0x00000000000007e0 0x00000000000007e0 0x00012b 0x00012b R   0x8

$ make defconfig
*** Default configuration is based on 'x86_64_defconfig'
$ ./scripts/config --enable X86_X32_ABI
$ make arch/x86/entry/vdso/
  VDSO    arch/x86/entry/vdso/vdso64/vdso64.so.dbg
  OBJCOPY arch/x86/entry/vdso/vdso64/vdso64.so
  VDSO    arch/x86/entry/vdso/vdso64/vdsox32.so.dbg
  OBJCOPY arch/x86/entry/vdso/vdso64/vdsox32.so
  VDSO    arch/x86/entry/vdso/vdso32/vdso32.so.dbg
  OBJCOPY arch/x86/entry/vdso/vdso32/vdso32.so
$ readelf -WSl arch/x86/entry/vdso/vdso*/vdso*.so | egrep "File:|GNU_SFRAME"
File: arch/x86/entry/vdso/vdso32/vdso32.so
File: arch/x86/entry/vdso/vdso64/vdso64.so
  [13] .sframe           GNU_SFRAME      00000000000007e0 0007e0 00012b 00   A  0   0  8
  GNU_SFRAME     0x0007e0 0x00000000000007e0 0x00000000000007e0 0x00012b 0x00012b R   0x8
File: arch/x86/entry/vdso/vdso64/vdsox32.so

$ make ARCH=i386 defconfig
*** Default configuration is based on 'i386_defconfig'
$ make ARCH=i386 arch/x86/entry/vdso/
  VDSO    arch/x86/entry/vdso/vdso32/vdso32.so.dbg
  OBJCOPY arch/x86/entry/vdso/vdso32/vdso32.so
$ readelf -WSl arch/x86/entry/vdso/vdso*/*.so | egrep "File:|GNU_SFRAME"

Regards,
Jens


Josh Poimboeuf (6):
  x86/vdso: Fix DWARF generation for getrandom()
  x86/asm: Avoid emitting DWARF CFI for non-VDSO
  x86/asm: Use CFI_* macros in SYM_FUNC_* macros so they can be added to
    VDSO
  x86/vdso: Use SYM_FUNC_{START,END} in __kernel_vsyscall()
  x86/vdso: Use CFI macros in __vdso_sgx_enter_enclave()
  x86/vdso: Enable sframe generation in VDSO

 arch/Kconfig                                  |  7 +++
 arch/x86/entry/vdso/common/vdso-layout.lds.S  | 17 +++++-
 arch/x86/entry/vdso/vdso32/system_call.S      | 10 +---
 arch/x86/entry/vdso/vdso64/Makefile           |  1 +
 arch/x86/entry/vdso/vdso64/vdso64.lds.S       |  4 ++
 .../x86/entry/vdso/vdso64/vgetrandom-chacha.S |  3 +-
 arch/x86/entry/vdso/vdso64/vsgx.S             | 18 +++----
 arch/x86/include/asm/dwarf2.h                 | 52 +++++++++++++------
 arch/x86/include/asm/linkage.h                | 33 +++++++++---
 arch/x86/include/asm/vdso.h                   |  1 -
 10 files changed, 100 insertions(+), 46 deletions(-)

-- 
2.51.0


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ