// https://syzkaller.appspot.com/bug?id=5388824c1e18a045263859c865be0409bc5459bf // autogenerated by syzkaller (https://github.com/google/syzkaller) #define _GNU_SOURCE #include #include #include #include #include #include #include #include #ifndef __NR_ioctl #define __NR_ioctl 29 #endif #ifndef __NR_mmap #define __NR_mmap 222 #endif #ifndef __NR_sendmsg #define __NR_sendmsg 211 #endif #ifndef __NR_socket #define __NR_socket 198 #endif #ifndef __NR_socketpair #define __NR_socketpair 199 #endif #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)))) uint64_t r[3] = {0xffffffffffffffff, 0xffffffffffffffff, 0x0}; int main(void) { syscall(__NR_mmap, /*addr=*/0x1ffff000ul, /*len=*/0x1000ul, /*prot=*/0ul, /*flags=*/0x32ul, /*fd=*/-1, /*offset=*/0ul); syscall(__NR_mmap, /*addr=*/0x20000000ul, /*len=*/0x1000000ul, /*prot=*/7ul, /*flags=*/0x32ul, /*fd=*/-1, /*offset=*/0ul); syscall(__NR_mmap, /*addr=*/0x21000000ul, /*len=*/0x1000ul, /*prot=*/0ul, /*flags=*/0x32ul, /*fd=*/-1, /*offset=*/0ul); intptr_t res = 0; res = syscall(__NR_socket, /*domain=*/0x10ul, /*type=*/3ul, /*proto=*/0); if (res != -1) r[0] = res; res = syscall(__NR_socketpair, /*domain=*/1ul, /*type=*/1ul, /*proto=*/0, /*fds=*/0x20000080ul); if (res != -1) r[1] = *(uint32_t*)0x20000084; memcpy((void*)0x20000000, "lo\000\000\000\000\000\000\000\000\000\000\000\000\000\000", 16); res = syscall(__NR_ioctl, /*fd=*/r[1], /*cmd=*/0x8933, /*arg=*/0x20000000ul); if (res != -1) r[2] = *(uint32_t*)0x20000010; *(uint64_t*)0x20000040 = 0; *(uint32_t*)0x20000048 = 0; *(uint64_t*)0x20000050 = 0x20000780; *(uint64_t*)0x20000780 = 0x20002500; *(uint32_t*)0x20002500 = 0x180; *(uint16_t*)0x20002504 = 0x24; *(uint16_t*)0x20002506 = 0xf0b; *(uint32_t*)0x20002508 = 0; *(uint32_t*)0x2000250c = 0; *(uint8_t*)0x20002510 = 0x60; *(uint8_t*)0x20002511 = 0; *(uint16_t*)0x20002512 = 0; *(uint32_t*)0x20002514 = r[2]; *(uint16_t*)0x20002518 = 0; *(uint16_t*)0x2000251a = 0; *(uint16_t*)0x2000251c = -1; *(uint16_t*)0x2000251e = -1; *(uint16_t*)0x20002520 = 0; *(uint16_t*)0x20002522 = 0; *(uint16_t*)0x20002524 = 0xa; *(uint16_t*)0x20002526 = 1; memcpy((void*)0x20002528, "netem\000", 6); *(uint16_t*)0x20002530 = 0x150; *(uint16_t*)0x20002532 = 2; *(uint32_t*)0x20002534 = 0; *(uint32_t*)0x20002538 = 0; *(uint32_t*)0x2000253c = 0; *(uint32_t*)0x20002540 = 0; *(uint32_t*)0x20002544 = 0; *(uint32_t*)0x20002548 = 0; *(uint16_t*)0x2000254c = 0xc8; STORE_BY_BITMASK(uint16_t, , 0x2000254e, 5, 0, 14); STORE_BY_BITMASK(uint16_t, , 0x2000254f, 0, 6, 1); STORE_BY_BITMASK(uint16_t, , 0x2000254f, 1, 7, 1); *(uint16_t*)0x20002550 = 0x14; *(uint16_t*)0x20002552 = 2; *(uint32_t*)0x20002554 = 0; *(uint32_t*)0x20002558 = 0; *(uint32_t*)0x2000255c = 0; *(uint32_t*)0x20002560 = 0; *(uint16_t*)0x20002564 = 0x18; *(uint16_t*)0x20002566 = 1; *(uint32_t*)0x20002568 = 0; *(uint32_t*)0x2000256c = 0; *(uint32_t*)0x20002570 = 0; *(uint32_t*)0x20002574 = 0; *(uint32_t*)0x20002578 = 0; *(uint16_t*)0x2000257c = 0x14; *(uint16_t*)0x2000257e = 2; *(uint32_t*)0x20002580 = 0; *(uint32_t*)0x20002584 = 0; *(uint32_t*)0x20002588 = 0; *(uint32_t*)0x2000258c = 0; *(uint16_t*)0x20002590 = 0x14; *(uint16_t*)0x20002592 = 2; *(uint32_t*)0x20002594 = 0; *(uint32_t*)0x20002598 = 0; *(uint32_t*)0x2000259c = 0; *(uint32_t*)0x200025a0 = 0; *(uint16_t*)0x200025a4 = 0x18; *(uint16_t*)0x200025a6 = 1; *(uint32_t*)0x200025a8 = 0; *(uint32_t*)0x200025ac = 0; *(uint32_t*)0x200025b0 = 0; *(uint32_t*)0x200025b4 = 0; *(uint32_t*)0x200025b8 = 0; *(uint16_t*)0x200025bc = 0x14; *(uint16_t*)0x200025be = 2; *(uint32_t*)0x200025c0 = 0; *(uint32_t*)0x200025c4 = 0; *(uint32_t*)0x200025c8 = 0; *(uint32_t*)0x200025cc = 0; *(uint16_t*)0x200025d0 = 0x14; *(uint16_t*)0x200025d2 = 2; *(uint32_t*)0x200025d4 = 0; *(uint32_t*)0x200025d8 = 0; *(uint32_t*)0x200025dc = 0; *(uint32_t*)0x200025e0 = 0; *(uint16_t*)0x200025e4 = 0x18; *(uint16_t*)0x200025e6 = 1; *(uint32_t*)0x200025e8 = 0; *(uint32_t*)0x200025ec = 0; *(uint32_t*)0x200025f0 = 0; *(uint32_t*)0x200025f4 = 0; *(uint32_t*)0x200025f8 = 0; *(uint16_t*)0x200025fc = 0x18; *(uint16_t*)0x200025fe = 1; *(uint32_t*)0x20002600 = 0xcd4; *(uint32_t*)0x20002604 = 4; *(uint32_t*)0x20002608 = 0x3f; *(uint32_t*)0x2000260c = 0x3f; *(uint32_t*)0x20002610 = 0x80000000; *(uint16_t*)0x20002614 = 0xc; *(uint16_t*)0x20002616 = 8; *(uint64_t*)0x20002618 = 0xbc427e488e42fee7; *(uint16_t*)0x20002620 = 0xc; *(uint16_t*)0x20002622 = 0xb; *(uint64_t*)0x20002624 = 0; *(uint16_t*)0x2000262c = 0x39; *(uint16_t*)0x2000262e = 2; memcpy( (void*)0x20002630, "\x5a\x14\x28\x84\x9c\xbb\x80\x21\x38\x3e\xd1\xbe\x0c\xf1\xa9\x94\x80\x8f" "\x60\x75\xfe\xba\x59\x10\x49\x84\xe0\x1e\x76\x42\x0b\xef\xee\xdc\xbe\x7e" "\xb1\x2f\xb4\xa8\x98\x8b\x70\xdf\x00\xbc\x76\x0a\x54\x0e\x7d\xe3\xf0", 53); *(uint16_t*)0x20002668 = 0xc; *(uint16_t*)0x2000266a = 4; *(uint32_t*)0x2000266c = 0; *(uint32_t*)0x20002670 = 0; *(uint16_t*)0x20002674 = 0xc; *(uint16_t*)0x20002676 = 0xa; *(uint64_t*)0x20002678 = 0; *(uint64_t*)0x20000788 = 0x180; *(uint64_t*)0x20000058 = 1; *(uint64_t*)0x20000060 = 0; *(uint64_t*)0x20000068 = 0; *(uint32_t*)0x20000070 = 0x8044000; syscall(__NR_sendmsg, /*fd=*/r[0], /*msg=*/0x20000040ul, /*f=*/0ul); return 0; }