This is the mail archive of the
libc-ports@sources.redhat.com
mailing list for the libc-ports project.
Re: [PATCH] ARM: Add pointer guard support.
- From: "Carlos O'Donell" <carlos at redhat dot com>
- To: Will Newton <will dot newton at linaro dot org>
- Cc: libc-ports at sourceware dot org, patches at linaro dot org
- Date: Thu, 26 Sep 2013 11:02:40 -0400
- Subject: Re: [PATCH] ARM: Add pointer guard support.
- Authentication-results: sourceware.org; auth=none
- References: <5242A79D dot 1030709 at linaro dot org>
On 09/25/2013 05:06 AM, Will Newton wrote:
>
> Add support for pointer mangling in glibc internal structures in C
> and assembler code.
>
> Tested on armv7 with hard and soft thread pointers.
>
> ports/ChangeLog.arm:
>
> 2013-09-24 Will Newton <will.newton@linaro.org>
>
> * sysdeps/arm/__longjmp.S (__longjmp): Demangle fp, sp
> and lr when restoring register values.
> * sysdeps/arm/include/bits/setjmp.h (JMP_BUF_REGLIST): Remove
> sp and lr from list and replace fp with a4.
> * sysdeps/arm/jmpbuf-unwind.h (_jmpbuf_sp): New function.
> (_JMPBUF_UNWINDS_ADJ): Call _jmpbuf_sp.
> * sysdeps/arm/nptl/tcb-offsets.sym: Add POINTER_GUARD.
> * sysdeps/arm/nptl/tls.h (tcbhead_t): Remove private and add
> pointer_guard. (THREAD_GET_POINTER_GUARD): New macro.
> (THREAD_SET_POINTER_GUARD): New macro.
> (THREAD_COPY_POINTER_GUARD): New macro.
> * sysdeps/arm/setjmp.S (__sigsetjmp): Mangle fp, sp and lr
> before storing register values.
> * sysdeps/unix/sysv/linux/arm/sysdep.h (PTR_MANGLE): New macro.
> (PTR_DEMANGLE): Likewise. (PTR_MANGLE2): Likewise.
> (PTR_DEMANGLE2): Likewise.
As of the fix for CVE-2013-4788 (bug 15754) there is now a
regression test that ensures the pointer guard varies with
each process and is indeed somewhat variable.
You will need to provide your own stackguard-macros.h file
with the appropriate macros including POINTER_CHK_GUARD
to allow tst-ptrguard1 and tst-ptrguard1-static to pass.
If these tests don't pass then you've got something wrong.
Cheers,
Carlos.