elf_set_personality()
Peter De Schrijver
pdeschrijver at nvidia.com
Mon Feb 27 07:36:12 EST 2012
Hi,
Commit ID 5e143436d04465c937c1a242808a99c46393af3e
(fix personality flag propagation across an exec) makes a child process
inherit a number of personality flags from its parent. This includes the
READ_IMPLIES_EXEC flag. Unfortunately this causes problems when debugging
android applications using gdbserver. It appears that gdbserver on android
has an executable stack. This causes the kernel to set the READ_IMPLIES_EXEC
flag on the gdbserver process. So the child android process will also get this
flag. As soon as the android tries to mmap a readonly android shmem segment
(using the ashmem driver), ashmem will return EPERM, because the segment has
been exposed as readonly without exec permissions and the kernel will modify
any readonly mmap request into read and execute.
Why does the READ_IMPLIES_EXEC flag need to be propagated? Would it be
acceptable to not propagate it to child processes?
Thanks,
Peter.
More information about the linux-arm-kernel
mailing list