This is the mail archive of the libc-ports@sources.redhat.com mailing list for the libc-ports project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] ARM: Add pointer guard support.


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]