Intenté compilar el POC para Dirty COW en OSX (< em> Descargo de responsabilidad: no es un programador de C ). Aquí está el error:
dirtycow.c: In function ‘procselfmemThread’:
dirtycow.c:64:5: warning: implicit declaration of function ‘lseek’ [-Wimplicit-function-declaration]
lseek(f,map,SEEK_SET);
^~~~~
dirtycow.c:65:8: warning: implicit declaration of function ‘write’ [-Wimplicit-function-declaration]
c+=write(f,str,strlen(str));
^~~~~
dirtycow.c: In function ‘main’:
dirtycow.c:82:3: warning: implicit declaration of function ‘fstat’ [-Wimplicit-function-declaration]
fstat(f,&st);
^~~~~
dirtycow.c:95:3: error: invalid use of undefined type ‘struct stat’
map=mmap(NULL,st.st_size,PROT_READ,MAP_PRIVATE,f,0);
^~~
dirtycow.c: At top level:
dirtycow.c:27:13: error: storage size of ‘st’ isn’t known
struct stat st;
La pregunta es, ¿tengo la sintaxis incorrecta para C en OSX o es que OSX no es vulnerable a esta vulnerabilidad?