hyln9 / VIKIROOT

CVE-2016-5195 (Dirty COW) PoC for Android 6.0.1 Marshmallow
GNU General Public License v3.0
266 stars 96 forks source link

Stops wrong process due to libc bug #3

Closed RenaKunisaki closed 7 years ago

RenaKunisaki commented 7 years ago

As described in the Bugs section here, some versions of libc have a bug where getpid() in a clone()d thread will return the parent PID rather than the child. (That page says CLONE_VM prevents it, but guess what, it happened anyway!)

Really lazy fix is:

#include <sys/syscall.h>
#define getpid() syscall(SYS_getpid)

After that, the reverse shell works.

hyln9 commented 7 years ago

Fixed in https://github.com/hyln9/VIKIROOT/commit/27cf5b6d90ec51f6ae32db200a3d3ec0790659ca.

Actually I forget to deal with this problem. Now we can build VIKIROOT with bionic.

Thanks for your effort! I've added you to the credits part.