OSDN Git Service

make vdso function pointers read-only at runtime
authorDaniel Micay <danielmicay@gmail.com>
Fri, 17 Jul 2015 16:13:27 +0000 (12:13 -0400)
committerElliott Hughes <enh@google.com>
Fri, 17 Jul 2015 18:11:42 +0000 (11:11 -0700)
commitdf1a3c6d21702e3e96cfcddadee4a50bfac82110
tree4655b0e1a8b097c9761b070727e78a992cd8824f
parent60bc90909a49121789bf86f5d14f63967e8000e0
make vdso function pointers read-only at runtime

Global, writable function pointers are low-hanging fruit for hijacking
control flow with an overflow from a global buffer or an arbitrary write
vulnerability. This moves the function pointer table into a dedicated
page and makes it read-only at runtime, similar to RELRO.

This increases the memory usage of the library by just under one page.
This could be avoided by having the linker load the vdso by replacing
weak symbols. It's not significant within the Zygote spawning model
though because it's read-only after early init.

Change-Id: Id7a49c96c1b15c2e1926528304b3c54a81e78caf
libc/bionic/vdso.cpp