// https://syzkaller.appspot.com/bug?id=0ddd1313c38a7e36e9926cbea1085ac45d9e1bd1 // autogenerated by syzkaller (https://github.com/google/syzkaller) #define _GNU_SOURCE #include #include #include #include #include #include #include #include #define BITMASK(bf_off, bf_len) (((1ull << (bf_len)) - 1) << (bf_off)) #define STORE_BY_BITMASK(type, htobe, addr, val, bf_off, bf_len) \ *(type*)(addr) = \ htobe((htobe(*(type*)(addr)) & ~BITMASK((bf_off), (bf_len))) | \ (((type)(val) << (bf_off)) & BITMASK((bf_off), (bf_len)))) 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); } uint64_t r[1] = {0xffffffffffffffff}; int main(void) { syscall(__NR_mmap, 0x1ffff000ul, 0x1000ul, 0ul, 0x32ul, -1, 0ul); syscall(__NR_mmap, 0x20000000ul, 0x1000000ul, 7ul, 0x32ul, -1, 0ul); syscall(__NR_mmap, 0x21000000ul, 0x1000ul, 0ul, 0x32ul, -1, 0ul); intptr_t res = 0; res = -1; res = syz_init_net_socket(0x10, 3, 0x10); if (res != -1) r[0] = res; *(uint64_t*)0x20000000 = 0; *(uint32_t*)0x20000008 = 0; *(uint64_t*)0x20000010 = 0x200004c0; *(uint64_t*)0x200004c0 = 0x20000740; *(uint32_t*)0x20000740 = 0x1c; *(uint16_t*)0x20000744 = 0x2a; *(uint16_t*)0x20000746 = 5; *(uint32_t*)0x20000748 = 0; *(uint32_t*)0x2000074c = 0; *(uint16_t*)0x20000750 = 8; STORE_BY_BITMASK(uint16_t, , 0x20000752, 0x8e, 0, 14); STORE_BY_BITMASK(uint16_t, , 0x20000753, 0, 6, 1); STORE_BY_BITMASK(uint16_t, , 0x20000753, 1, 7, 1); *(uint16_t*)0x20000754 = 8; STORE_BY_BITMASK(uint16_t, , 0x20000756, 1, 0, 14); STORE_BY_BITMASK(uint16_t, , 0x20000757, 0, 6, 1); STORE_BY_BITMASK(uint16_t, , 0x20000757, 0, 7, 1); *(uint32_t*)0x20000758 = 0; *(uint64_t*)0x200004c8 = 0x1c; *(uint64_t*)0x20000018 = 1; *(uint64_t*)0x20000020 = 0; *(uint64_t*)0x20000028 = 0; *(uint32_t*)0x20000030 = 0; syscall(__NR_sendmsg, r[0], 0x20000000ul, 0ul); return 0; }