Prev Next | OpenBSD and Rthreads | Slide #30 |
on OpenBSD, the GOT and/or PLT indirection tables for dynamic linking are read-only to block a class of attacks
when a (lazy) binding needs to be updated, ld.so uses mprotect() to make it writable, does the update, then protects it again
sigprocmask(SIG_BLOCK, &allsigs, &curset); spinlock_lock(&bind_lock); /* libpthread cb */ mprotect(addr, len, PROT_READ|PROT_WRITE); /* update the GOT entry */ mprotect(addr, len, PROT_READ); spinlock_unlock(&bind_lock); /* libpthread cb */ sigprocmask(SIG_SETMASK, &curset, NULL);
mprotect() involves TLB flushing in many cases
for short lived processes, most their syscalls may be sigprocmask() and mprotect(): 434 of 523 for w
EuroBSDCon 2012 | Copyright © 2012 Philip Guenther |