// https://syzkaller.appspot.com/bug?id=bfc3f972760618caea8f21371b32d8071ce0a56a // autogenerated by syzkaller (https://github.com/google/syzkaller) #define _GNU_SOURCE #include #include #include #include #include #include #include #include #ifndef __NR_close #define __NR_close 6 #endif #ifndef __NR_execve #define __NR_execve 11 #endif #ifndef __NR_mknod #define __NR_mknod 14 #endif #ifndef __NR_mmap #define __NR_mmap 192 #endif #ifndef __NR_openat #define __NR_openat 295 #endif #ifndef __NR_pipe #define __NR_pipe 42 #endif #ifndef __NR_socket #define __NR_socket 359 #endif #ifndef __NR_splice #define __NR_splice 313 #endif #ifndef __NR_write #define __NR_write 4 #endif #undef __NR_mmap #define __NR_mmap __NR_mmap2 uint64_t r[3] = {0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff}; int main(void) { syscall(__NR_mmap, 0x20000000, 0x1000000, 3, 0x32, -1, 0); long res = 0; res = syscall(__NR_pipe, 0x200000c0); if (res != -1) { r[0] = *(uint32_t*)0x200000c0; r[1] = *(uint32_t*)0x200000c4; } res = syscall(__NR_socket, 2, 2, 0); if (res != -1) r[2] = res; memcpy((void*)0x20000240, "\x00\x00\xfc\x91\x00\x00\x00\x00\x00\x00\x00\x02" "\x01\x00\x0b\x00\x24\x10\x8e\x5d\xaa\x3f\xc7\x59" "\x3f\xaf\xee\xc4\x01\x4c\xed\x85", 32); syscall(__NR_write, (long)r[1], 0x20000240, 0x20); syscall(__NR_close, (long)r[2]); memcpy((void*)0x20000000, "/proc/thread-self/attr/exec\000", 28); syscall(__NR_openat, 0xffffff9c, 0x20000000, 2, 0); syscall(__NR_splice, (long)r[0], 0, (long)r[2], 0, 0x10005, 0); memcpy((void*)0x20000200, "./file0\000", 8); syscall(__NR_mknod, 0x20000200, 0x103f, 0); memcpy((void*)0x20000180, "./file0\000", 8); syscall(__NR_execve, 0x20000180, 0, 0); return 0; }