// https://syzkaller.appspot.com/bug?id=42d3c057cb79ff6009a2f2742ea11d481c724ea3 // autogenerated by syzkaller (https://github.com/google/syzkaller) #define _GNU_SOURCE #include #include #include #include #include #include #include #include const int kInitNetNsFd = 239; static long syz_init_net_socket(volatile long domain, volatile long type, volatile long proto) { return syscall(__NR_socket, domain, type, proto); } #ifndef __NR_close #define __NR_close 6 #endif #ifndef __NR_mmap #define __NR_mmap 192 #endif #ifndef __NR_setsockopt #define __NR_setsockopt 366 #endif #undef __NR_mmap #define __NR_mmap __NR_mmap2 uint64_t r[1] = {0xffffffffffffffff}; int main(void) { syscall(__NR_mmap, 0x1ffff000, 0x1000, 0, 0x32, -1, 0); syscall(__NR_mmap, 0x20000000, 0x1000000, 7, 0x32, -1, 0); syscall(__NR_mmap, 0x21000000, 0x1000, 0, 0x32, -1, 0); intptr_t res = 0; res = syz_init_net_socket(3, 2, 0); if (res != -1) r[0] = res; syscall(__NR_close, -1); *(uint32_t*)0x20000000 = -1; syscall(__NR_setsockopt, (intptr_t)r[0], 0x101, 0x19, 0x20000000, 4); return 0; }