dirtycow/dirtycow.github.io

Error compiling exploit

Closed this issue · 3 comments

ageis commented

gcc 5.3.0, musl libc 1.1.14

dirtyc0w.c:95:3: error: invalid use of undefined type 'struct stat'
   map=mmap(NULL,st.st_size,PROT_READ,MAP_PRIVATE,f,0);
   ^
ageis commented

And with gcc 6.2.1:

dirtyc0w.c: At top level:
dirtyc0w.c:27:13: error: storage size of 'st' isn't known
 struct stat st;
xmxwx commented

man stat can help ;-)

ageis commented

Resolved via

#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>

I'm not a C person ;)