--- test_CVE-2016-5195.c.orig 2016-10-30 06:16:53 +0100 +++ test_CVE-2016-5195.c 2016-10-30 06:16:53 +0100 @@ -29,10 +29,14 @@ #include #include -#ifndef PT_SET_PTRACER +#ifndef PR_SET_PTRACER #define PR_SET_PTRACER 0x59616d61 #endif +#ifndef PR_SET_PTRACER_ANY +#define PR_SET_PTRACER_ANY ((unsigned long)-1) +#endif + static long volatile *write_iters; static volatile unsigned long ready; static void *p_priv; @@ -180,6 +184,8 @@ fd = -1; #ifdef O_TMPFILE fd = open(".", O_TMPFILE | O_RDWR, 0700); +#else + errno = EISDIR; #endif if (fd != -1) { printf("+ Using O_TMPFILE\n"); @@ -224,4 +230,6 @@ try_procmem(); try_ptrace(); printf("No force-write means detected\n"); + + return 0; }