Skip to content

RFC x86: Proposed fixes for stackvalidate warnings

Josh Poimboeuf lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 RFC Latest21 patches 47 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/21stackvalidate: Process ignores earlier and add more ignore checksscripts/stackvalidate/stackvalidate.c+56 -210 replies
2/21stackvalidate: Add C version of STACKVALIDATE_IGNORE_INSNarch/x86/include/asm/stackvalidate.h+9 -03 replies
3/21x86/asm: Add C versions of FRAME and ENDFRAME macrosarch/x86/include/asm/frame.h+18 -20 replies
4/21x86/hweight: Add stack frame dependency for __arch_hweight*()arch/x86/include/asm/arch_hweight.h+4 -211 replies
5/21x86/xen: Add stack frame dependency to hypercall inline asm callsarch/x86/include/asm/xen/hypercall.h+3 -20 replies
6/21x86/paravirt: Add stack frame dependency to PVOP inline asm callsarch/x86/include/asm/paravirt_types.h+10 -80 replies
7/21x86/paravirt: Fix frame pointer usage in PV_CALLEE_SAVE_REGS_THUNKarch/x86/include/asm/paravirt.h+7 -20 replies
8/21x86/paravirt: Align paravirt thunk functions at 16-byte boundariesarch/x86/include/asm/paravirt.h+1 -00 replies
9/21x86/amd: Set ELF function type for vide()arch/x86/kernel/cpu/amd.c+4 -10 replies
10/21x86/reboot: Add ljmp instructions to stackvalidate whitelistarch/x86/kernel/reboot.c+5 -20 replies
11/21x86/xen: Add xen_cpuid() and xen_setup_gdt() to stackvalidate whitelistsarch/x86/xen/enlighten.c+3 -10 replies
12/21sched: Add __schedule() to stackvalidate whitelistkernel/sched/core.c+2 -05 replies
13/21x86/asm/crypto: Fix frame pointer usage in aesni-intel_asm.Sarch/x86/crypto/aesni-intel_asm.S+19 -026 replies
14/21x86/asm/crypto: Move .Lbswap_mask data to .rodata sectionarch/x86/crypto/aesni-intel_asm.S+2 -00 replies
15/21x86/asm/crypto: Move jump_table to .rodata sectionarch/x86/crypto/crc32c-pcl-intel-asm_64.S+4 -40 replies
16/21x86/asm/crypto: Fix frame pointer usage in clmul_ghash_mul/update()arch/x86/crypto/ghash-clmulni-intel_asm.S+5 -00 replies
17/21x86/asm/entry: Fix frame pointer usage in thunk functionsarch/x86/entry/thunk_64.S+4 -00 replies
18/21x86/asm/acpi: Fix frame pointer usage in do_suspend_lowlevel()arch/x86/kernel/acpi/wakeup_64.S+3 -00 replies
19/21x86/asm: Fix frame pointer usage in rwsem functionsarch/x86/lib/rwsem.S+10 -10 replies
20/21x86/asm/efi: Fix frame pointer usage in efi_call()arch/x86/platform/efi/efi_stub_64.S+3 -00 replies
21/21x86/asm/power: Fix frame pointer usage in hibernate_asm_64.Sarch/x86/power/hibernate_asm_64.S+7 -00 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [RFC PATCH 00/21] x86: Proposed fixes for stackvalidate warnings

These patches fix many of the warnings reported by stackvalidate. They're based on top of the "Compile-time stack validation" v7 patch set [1].

They've been compile-tested and boot tested in a VM, but I haven't attempted any meaningful testing for most of them. This should give an idea of what kinds of changes I think are needed.

[1] https://lkml.kernel.org/r/[email protected]

Josh Poimboeuf (21):
stackvalidate: Process ignores earlier and add more ignore checks
stackvalidate: Add C version of STACKVALIDATE_IGNORE_INSN x86/asm: Add C versions of FRAME and ENDFRAME macros x86/hweight: Add stack frame dependency for __arch_hweight*() x86/xen: Add stack frame dependency to hypercall inline asm calls x86/paravirt: Add stack frame dependency to PVOP inline asm calls x86/paravirt: Fix frame pointer usage in PV_CALLEE_SAVE_REGS_THUNK x86/paravirt: Align paravirt thunk functions at 16-byte boundaries x86/amd: Set ELF function type for vide()
x86/reboot: Add ljmp instructions to stackvalidate whitelist x86/xen: Add xen_cpuid() and xen_setup_gdt() to stackvalidate
whitelists
sched: Add __schedule() to stackvalidate whitelist x86/asm/crypto: Fix frame pointer usage in aesni-intel_asm.S x86/asm/crypto: Move .Lbswap_mask data to .rodata section x86/asm/crypto: Move jump_table to .rodata section x86/asm/crypto: Fix frame pointer usage in clmul_ghash_mul/update() x86/asm/entry: Fix frame pointer usage in thunk functions x86/asm/acpi: Fix frame pointer usage in do_suspend_lowlevel() x86/asm: Fix frame pointer usage in rwsem functions x86/asm/efi: Fix frame pointer usage in efi_call() x86/asm/power: Fix frame pointer usage in hibernate_asm_64.S

 arch/x86/crypto/aesni-intel_asm.S         | 21 +++++++++
 arch/x86/crypto/crc32c-pcl-intel-asm_64.S |  8 ++--
 arch/x86/crypto/ghash-clmulni-intel_asm.S |  5 ++
 arch/x86/entry/thunk_64.S                 |  4 ++
 arch/x86/include/asm/arch_hweight.h       |  6 ++-
 arch/x86/include/asm/frame.h              | 20 +++++++-
 arch/x86/include/asm/paravirt.h           | 10 +++-
 arch/x86/include/asm/paravirt_types.h     | 18 ++++----
 arch/x86/include/asm/stackvalidate.h      |  9 ++++
 arch/x86/include/asm/xen/hypercall.h      |  5 +-
 arch/x86/kernel/acpi/wakeup_64.S          |  3 ++
 arch/x86/kernel/cpu/amd.c                 |  5 +-
 arch/x86/kernel/reboot.c                  |  7 ++-
 arch/x86/lib/rwsem.S                      | 11 ++++-
 arch/x86/platform/efi/efi_stub_64.S       |  3 ++
 arch/x86/power/hibernate_asm_64.S         |  7 +++
 arch/x86/xen/enlighten.c                  |  4 +-
 kernel/sched/core.c                       |  2 +
 scripts/stackvalidate/stackvalidate.c     | 77 ++++++++++++++++++++++---------
 19 files changed, 179 insertions(+), 46 deletions(-)
Signature · 1 line
2.1.0