AlexisAhmed/CVE-2022-0847-DirtyPipe-Exploits

Compile error

sreeumd opened this issue · 3 comments

exploit-1.c: In function 'prepare_pipe':
exploit-1.c:49:41: error: 'F_GETPIPE_SZ' undeclared (first use in this function)
const unsigned pipe_size = fcntl(p[1], F_GETPIPE_SZ);
^~~~~~~~~~~~
exploit-1.c:49:41: note: each undeclared identifier is reported only once for each function it appears in
exploit-1.c: In function 'main':
exploit-1.c:96:2: error: unknown type name 'loff_t'; did you mean 'lloff_t'?
loff_t offset = 4; // after the "root"
^~~~~~
lloff_t
exploit-1.c:106:8: error: unknown type name 'loff_t'
const loff_t next_page = (offset | (PAGE_SIZE - 1)) + 1;
^~~~~~
exploit-1.c:107:8: error: unknown type name 'loff_t'
const loff_t end_offset = offset + (loff_t)data_size;
^~~~~~
exploit-1.c:107:38: error: 'loff_t' undeclared (first use in this function); did you mean 'lloff_t'?
const loff_t end_offset = offset + (loff_t)data_size;
^~~~~~
lloff_t
exploit-1.c:107:45: error: expected ',' or ';' before 'data_size'
const loff_t end_offset = offset + (loff_t)data_size;
^~~~~~~~~
exploit-1.c:146:19: warning: implicit declaration of function 'splice'; did you mean 'stime'? [-Wimplicit-function-declaration]
ssize_t nbytes = splice(fd, &offset, p[1], NULL, 1, 0);
^~~~~~
stime
exploit-2.c: In function 'prepare_pipe':
exploit-2.c:102:44: error: 'F_GETPIPE_SZ' undeclared (first use in this function)
const unsigned pipe_size = fcntl(p[1], F_GETPIPE_SZ);
^~~~~~~~~~~~
exploit-2.c:102:44: note: each undeclared identifier is reported only once for each function it appears in
exploit-2.c: In function 'hax':
exploit-2.c:143:22: warning: implicit declaration of function 'splice'; did you mean 'stime'? [-Wimplicit-function-declaration]
ssize_t nbytes = splice(fd, &offset, p[1], NULL, 1, 0);
^~~~~~

What distribution are you compiling this on?

I am using Solaris V11, I am wondering if solaris systems are vulnerable for this CVE?

This vulnerability affects the Linux kernel.