// https://syzkaller.appspot.com/bug?id=0966a1f8b55b4c30ee9760b843eaaf8cf1d92669 // 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_splice #define __NR_splice 313 #endif #ifndef __NR_vmsplice #define __NR_vmsplice 316 #endif #undef __NR_mmap #define __NR_mmap __NR_mmap2 uint64_t r[2] = {0xffffffffffffffff, 0xffffffffffffffff}; int main(void) { syscall(__NR_mmap, 0x20000000, 0x1000000, 3, 0x32, -1, 0); long res = 0; res = syscall(__NR_pipe, 0x20000240); if (res != -1) { r[0] = *(uint32_t*)0x20000240; r[1] = *(uint32_t*)0x20000244; } *(uint32_t*)0x20000100 = 0x20000080; memcpy((void*)0x20000080, "\x94", 1); *(uint32_t*)0x20000104 = 1; syscall(__NR_vmsplice, (long)r[1], 0x20000100, 1, 0); syscall(__NR_close, (long)r[1]); memcpy((void*)0x20000000, "/proc/thread-self/attr/current", 31); syscall(__NR_openat, 0xffffff9c, 0x20000000, 2, 0); syscall(__NR_splice, (long)r[0], 0, (long)r[1], 0, 0x400003, 0); memcpy((void*)0x20000040, "./file0", 8); syscall(__NR_mknod, 0x20000040, 0x1040, 0); memcpy((void*)0x20000340, "./file0", 8); syscall(__NR_execve, 0x20000340, 0, 0); return 0; }