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
| ||
|
Message-ID: <alpine.LSU.2.21.1712121308440.21907@pobox.suse.cz> Date: Tue, 12 Dec 2017 13:12:37 +0100 (CET) From: Miroslav Benes <mbenes@...e.cz> To: Torsten Duwe <duwe@....de> cc: Michael Ellerman <mpe@...erman.id.au>, Jiri Kosina <jkosina@...e.cz>, Balbir Singh <bsingharora@...il.com>, linux-kernel@...r.kernel.org, linuxppc-dev@...ts.ozlabs.org, live-patching@...r.kernel.org Subject: Re: [PATCH] On ppc64le we HAVE_RELIABLE_STACKTRACE On Tue, 12 Dec 2017, Torsten Duwe wrote: > Hi all, > > The "Power Architecture 64-Bit ELF V2 ABI" says in section 2.3.2.3: > > [...] There are several rules that must be adhered to in order to ensure > reliable and consistent call chain backtracing: > > * Before a function calls any other function, it shall establish its > own stack frame, whose size shall be a multiple of 16 bytes. > > – In instances where a function’s prologue creates a stack frame, the > back-chain word of the stack frame shall be updated atomically with > the value of the stack pointer (r1) when a back chain is implemented. > (This must be supported as default by all ELF V2 ABI-compliant > environments.) > [...] > – The function shall save the link register that contains its return > address in the LR save doubleword of its caller’s stack frame before > calling another function. > > To me this sounds like the equivalent of HAVE_RELIABLE_STACKTRACE. > This patch may be unneccessarily limited to ppc64le, but OTOH the only > user of this flag so far is livepatching, which is only implemented on > PPCs with 64-LE, a.k.a. ELF ABI v2. > > Signed-off-by: Torsten Duwe <duwe@...e.de> > > --- > diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig > index c51e6ce42e7a..3e3a6ab2e089 100644 > --- a/arch/powerpc/Kconfig > +++ b/arch/powerpc/Kconfig > @@ -218,6 +218,7 @@ config PPC > select HAVE_PERF_USER_STACK_DUMP > select HAVE_RCU_TABLE_FREE if SMP > select HAVE_REGS_AND_STACK_ACCESS_API > + select HAVE_RELIABLE_STACKTRACE if PPC64 && CPU_LITTLE_ENDIAN > select HAVE_SYSCALL_TRACEPOINTS > select HAVE_VIRT_CPU_ACCOUNTING > select HAVE_IRQ_TIME_ACCOUNTING I think that this is not enough. You need to also implement save_stack_trace_tsk_reliable() for powerpc defined as __weak in kernel/stacktrace.c. See arch/x86/kernel/stacktrace.c for reference, but I think it would be much much simpler here given the changelog description. Thanks, Miroslav
Powered by blists - more mailing lists