[PATCH 0/6] Fix unwinding through sigreturn trampolines

Ard Biesheuvel ardb at kernel.org
Tue Jun 23 05:46:44 EDT 2020


On Tue, 23 Jun 2020 at 10:54, Will Deacon <will at kernel.org> wrote:
>
> Hi all,
>
> This series fixes unwinding through our 64-bit sigreturn trampoline (by
> effectively removing the incomplete CFI support enabled during the merge
> window) and the 32-bit sigreturn trampoline in the compat vDSO (by removing
> it in favour of the sigpage). This forces the unwinder to fallback on the
> heuristics it was using previously without any reported issues.
>
> The downside is that this series undoes the LLVM unwinder support added
> during the merge window, in favour of not regressing libgcc. Although Ard
> and I tried very hard to make this all work with CFI, it became obvious
> that it's not 5.8 material, particularly as testing this stuff is extremely
> difficult and appears to be fragile on other architectures too. For example,
> trying to unwind out of a SIGCANCEL handler triggered from within a leaf
> function with pthread cleanup handlers stacked further up in the callchain
> doesn't appear to work at all when compiling with -fexceptions, and works
> partially (invoking a subset of the handlers...) if you reduce the
> optimisation level.
>
> The compat vDSO changes are a result of me auditing our 32-bit sigreturn,
> realising the compat vDSO trampoline is broken and then deciding that we
> may as well just use the sigpage unconditionally, like arch/arm/ does.
>
> Thanks to Ard for wasting a significant chunk of his weekend on this mess.
>
> Patches 1-4 are targetting 5.8, the remaining two are cosmetic.
>
> Will
>
> Cc: Vincenzo Frascino <vincenzo.frascino at arm.com>
> Cc: Tamas Zsoldos <tamas.zsoldos at arm.com>
> Cc: Szabolcs Nagy <szabolcs.nagy at arm.com>
> Cc: Catalin Marinas <catalin.marinas at arm.com>
> Cc: Daniel Kiss <daniel.kiss at arm.com>
> Cc: Dave Martin <dave.martin at arm.com>
> Cc: Ard Biesheuvel <ardb at kernel.org>
> Cc: <kernel-team at android.com>
>
> --->8
>
> Will Deacon (6):
>   arm64: vdso: Disable dwarf unwinding through the sigreturn trampoline
>   arm64: compat: Allow 32-bit vdso and sigpage to co-exist
>   arm64: compat: Always use sigpage for sigreturn trampoline
>   arm64: compat: Remove 32-bit sigreturn code from the vDSO
>   arm64: vdso32: Remove a bunch of #ifdef CONFIG_COMPAT_VDSO guards
>   arm64: vdso: Fix unusual formatting in *setup_additional_pages()
>

For the series,

Reviewed-by: Ard Biesheuvel <ardb at kernel.org>

Once this is queued up, I will send out my proposed fixes to go on top
for the CFI directives in the 64-bit sigreturn trampoline, and we can
start the discussion on how to fix this properly for v5.9.




>  arch/arm64/include/asm/mmu.h         |  3 +
>  arch/arm64/kernel/Makefile           |  2 -
>  arch/arm64/kernel/signal32.c         | 27 +-------
>  arch/arm64/kernel/vdso.c             | 98 +++++++++++-----------------
>  arch/arm64/kernel/vdso/Makefile      |  2 +-
>  arch/arm64/kernel/vdso/sigreturn.S   | 54 +++++++++------
>  arch/arm64/kernel/vdso32/Makefile    |  1 -
>  arch/arm64/kernel/vdso32/sigreturn.S | 58 ----------------
>  arch/arm64/kernel/vdso32/vdso.lds.S  | 12 ----
>  9 files changed, 77 insertions(+), 180 deletions(-)
>  delete mode 100644 arch/arm64/kernel/vdso32/sigreturn.S
>
> --
> 2.27.0.111.gc72c7da667-goog
>



More information about the linux-arm-kernel mailing list