Re: [PATCH v2 0/2] Clean up x86_32 stackprotector

From: Sedat Dilek
Date: Sun Feb 14 2021 - 09:43:37 EST


On Sat, Feb 13, 2021 at 8:19 PM Andy Lutomirski <luto@xxxxxxxxxx> wrote:
>
> x86_32 stackprotector is a maintenance nightmare. Clean it up. This
> disables stackprotector on x86_32 on GCC 8.1 and on all clang
> versions. Some clang people are cc'd.
>
> Changes from v1:
> - Changelog fixes.
> - Comment fixes (mostly from Sean).
> - Fix the !SMP case.
>
> Andy Lutomirski (2):
> x86/stackprotector/32: Make the canary into a regular percpu variable
> x86/entry/32: Remove leftover macros after stackprotector cleanups
>

Happy Valentine's Day,

I have no rose or pralines for you, Andy :-).

First, I tried to apply your patchset on top of <tip.git#autolatest>
which has shown some conflicts.
AFAICS it conflicts with <tip.git#x86/entry> (or more precisely with
the recent "Merge branch 'x86/paravirt' into x86/entry").
Just wanna let you know.

I have tested this on Debian/testing AMD64 (x86 64bit) with LLVM/Clang
v12.0.0-rc1 and my custom patchset.
Means compile-tested and booted into bare metal and checked build-log
and dmesg-log for warnings.
So far nothing scary.

Feel free to give credits like a Tested-by if you like.
( Roses and pralines are welcome, too, hahaha :-). )

Icecold and sunshiny Greetings from North-West Germany,
- Sedat -

> arch/x86/Kconfig | 7 +-
> arch/x86/Makefile | 8 ++
> arch/x86/entry/entry_32.S | 95 +----------------------
> arch/x86/include/asm/processor.h | 15 +---
> arch/x86/include/asm/ptrace.h | 5 +-
> arch/x86/include/asm/segment.h | 30 ++-----
> arch/x86/include/asm/stackprotector.h | 79 ++++---------------
> arch/x86/include/asm/suspend_32.h | 6 +-
> arch/x86/kernel/asm-offsets_32.c | 5 --
> arch/x86/kernel/cpu/common.c | 5 +-
> arch/x86/kernel/doublefault_32.c | 4 +-
> arch/x86/kernel/head_32.S | 18 +----
> arch/x86/kernel/setup_percpu.c | 1 -
> arch/x86/kernel/tls.c | 8 +-
> arch/x86/kvm/svm/svm.c | 10 +--
> arch/x86/lib/insn-eval.c | 4 -
> arch/x86/platform/pvh/head.S | 14 ----
> arch/x86/power/cpu.c | 6 +-
> arch/x86/xen/enlighten_pv.c | 1 -
> scripts/gcc-x86_32-has-stack-protector.sh | 6 +-
> 20 files changed, 62 insertions(+), 265 deletions(-)
>
> --
> 2.29.2
>