add an equivalent to glibc's PTR_MANGLE for jmp_buf (setjmp/longjmp) #12

Closed
thestinger opened this Issue Aug 19, 2015 · 3 comments

Comments

Projects
None yet
1 participant
@thestinger
Contributor

thestinger commented Aug 19, 2015

This wouldn't be very useful for the handler registration functions (atexit, at_quick_exit, pthread_atfork) because the pages they're stored in are read-only when a new handler isn't being registered. The potential for a race is tiny because these functions are called a very limited number of times during initialization phases (start-up, loading a library, calling a library for the first time).

It's the only thing that can be done to protect jmp_buf though, and sadly setjmp / longjmp are widely used...

@thestinger

This comment has been minimized.

Show comment Hide comment
@thestinger

thestinger Sep 15, 2015

Contributor

This is being implemented upstream. I nudged them in the right direction:

https://android-review.googlesource.com/#/c/170157/

Contributor

thestinger commented Sep 15, 2015

This is being implemented upstream. I nudged them in the right direction:

https://android-review.googlesource.com/#/c/170157/

@thestinger

This comment has been minimized.

Show comment Hide comment
@thestinger

thestinger Sep 27, 2015

Contributor

This is now implemented upstream and could just be backported. However, there were quite a few changes to the assembly code after Lollipop so it's going to be a bit painful.

Contributor

thestinger commented Sep 27, 2015

This is now implemented upstream and could just be backported. However, there were quite a few changes to the assembly code after Lollipop so it's going to be a bit painful.

@thestinger

This comment has been minimized.

Show comment Hide comment
@thestinger

thestinger Dec 12, 2015

Contributor

This is now backported.

Contributor

thestinger commented Dec 12, 2015

This is now backported.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment