// https://syzkaller.appspot.com/bug?id=2f3828005562c853cd09f8d1be22e62239c00d4e // autogenerated by syzkaller (https://github.com/google/syzkaller) #define _GNU_SOURCE #include #include #include #include #include #include #include #include uint64_t r[2] = {0xffffffffffffffff, 0xffffffffffffffff}; int main(void) { syscall(__NR_mmap, /*addr=*/0x1ffffffff000ul, /*len=*/0x1000ul, /*prot=*/0ul, /*flags=MAP_FIXED|MAP_ANONYMOUS|MAP_PRIVATE*/ 0x32ul, /*fd=*/(intptr_t)-1, /*offset=*/0ul); syscall(__NR_mmap, /*addr=*/0x200000000000ul, /*len=*/0x1000000ul, /*prot=PROT_WRITE|PROT_READ|PROT_EXEC*/ 7ul, /*flags=MAP_FIXED|MAP_ANONYMOUS|MAP_PRIVATE*/ 0x32ul, /*fd=*/(intptr_t)-1, /*offset=*/0ul); syscall(__NR_mmap, /*addr=*/0x200001000000ul, /*len=*/0x1000ul, /*prot=*/0ul, /*flags=MAP_FIXED|MAP_ANONYMOUS|MAP_PRIVATE*/ 0x32ul, /*fd=*/(intptr_t)-1, /*offset=*/0ul); const char* reason; (void)reason; intptr_t res = 0; if (write(1, "executing program\n", sizeof("executing program\n") - 1)) { } // openat$tun arguments: [ // fd: const = 0xffffffffffffff9c (8 bytes) // file: ptr[in, buffer] { // buffer: {2f 64 65 76 2f 6e 65 74 2f 74 75 6e 00} (length 0xd) // } // flags: open_flags = 0xa8442 (4 bytes) // mode: const = 0x0 (2 bytes) // ] // returns fd_tun memcpy((void*)0x200000000240, "/dev/net/tun\000", 13); res = syscall( __NR_openat, /*fd=*/0xffffffffffffff9cul, /*file=*/0x200000000240ul, /*flags=O_NOFOLLOW|O_LARGEFILE|O_CREAT|O_CLOEXEC|O_APPEND|0x2*/ 0xa8442, /*mode=*/0); if (res != -1) r[0] = res; // ioctl$TUNSETIFF arguments: [ // fd: fd_tun (resource) // cmd: const = 0x400454ca (4 bytes) // arg: ptr[in, ifreq_dev_t[devnames, flags[tun_setiff_flags, int16]]] { // ifreq_dev_t[devnames, flags[tun_setiff_flags, int16]] { // ifr_ifrn: buffer: {73 79 7a 6b 61 6c 6c 65 72 30 00 00 00 00 00 00} // (length 0x10) elem: tun_setiff_flags = 0x7101 (2 bytes) pad = 0x0 // (22 bytes) // } // } // ] memcpy((void*)0x200000000040, "syzkaller0\000\000\000\000\000\000", 16); *(uint16_t*)0x200000000050 = 0x7101; syscall(__NR_ioctl, /*fd=*/r[0], /*cmd=*/0x400454ca, /*arg=*/0x200000000040ul); // socket$netlink arguments: [ // domain: const = 0x10 (8 bytes) // type: const = 0x3 (8 bytes) // proto: netlink_proto = 0x14 (4 bytes) // ] // returns sock_netlink res = syscall(__NR_socket, /*domain=*/0x10ul, /*type=*/3ul, /*proto=NETLINK_RDMA*/ 0x14); if (res != -1) r[1] = res; // sendmsg$RDMA_NLDEV_CMD_NEWLINK arguments: [ // fd: sock_nl_rdma (resource) // msg: ptr[in, msghdr_netlink[netlink_msg[RDMA_NLDEV_NEWLINK, void, // nldev_policy$NEWLINK]]] { // msghdr_netlink[netlink_msg[RDMA_NLDEV_NEWLINK, void, // nldev_policy$NEWLINK]] { // addr: nil // addrlen: len = 0x0 (4 bytes) // pad = 0x0 (4 bytes) // vec: ptr[in, iovec[in, netlink_msg[RDMA_NLDEV_NEWLINK, void, // nldev_policy$NEWLINK]]] { // iovec[in, netlink_msg[RDMA_NLDEV_NEWLINK, void, // nldev_policy$NEWLINK]] { // addr: ptr[in, netlink_msg_t[const[RDMA_NLDEV_NEWLINK, int16], // void, nldev_policy$NEWLINK]] { // netlink_msg_t[const[RDMA_NLDEV_NEWLINK, int16], void, // nldev_policy$NEWLINK] { // len: len = 0x38 (4 bytes) // type: const = 0x1403 (2 bytes) // flags: netlink_msg_flags = 0x1 (2 bytes) // seq: int32 = 0x0 (4 bytes) // pid: int32 = 0x0 (4 bytes) // payload: buffer: {} (length 0x0) // attrs: array[nldev_policy$NEWLINK] { // nldev_policy$NEWLINK { // RDMA_NLDEV_ATTR_DEV_NAME: // nlattr_t[const[RDMA_NLDEV_ATTR_DEV_NAME, int16], // string[nldev_name]] { // nla_len: offsetof = 0x9 (2 bytes) // nla_type: const = 0x2 (2 bytes) // payload: buffer: {73 79 7a 32 00} (length 0x5) // size: buffer: {} (length 0x0) // pad = 0x0 (3 bytes) // } // RDMA_NLDEV_ATTR_LINK_TYPE: // nlattr_t[const[RDMA_NLDEV_ATTR_LINK_TYPE, int16], // string[nldev_type]] { // nla_len: offsetof = 0x8 (2 bytes) // nla_type: const = 0x41 (2 bytes) // payload: buffer: {73 69 77 00} (length 0x4) // size: buffer: {} (length 0x0) // } // RDMA_NLDEV_ATTR_NDEV_NAME: // nlattr_t[const[RDMA_NLDEV_ATTR_NDEV_NAME, int16], // devname] { // nla_len: offsetof = 0x14 (2 bytes) // nla_type: const = 0x33 (2 bytes) // payload: buffer: {73 79 7a 6b 61 6c 6c 65 72 30 00 00 // 00 00 00 00} (length 0x10) size: buffer: {} (length // 0x0) // } // } // } // } // } // len: len = 0x38 (8 bytes) // } // } // vlen: const = 0x1 (8 bytes) // ctrl: const = 0x0 (8 bytes) // ctrllen: const = 0x0 (8 bytes) // f: send_flags = 0x5 (4 bytes) // pad = 0x0 (4 bytes) // } // } // f: send_flags = 0x100 (8 bytes) // ] *(uint64_t*)0x2000000002c0 = 0; *(uint32_t*)0x2000000002c8 = 0; *(uint64_t*)0x2000000002d0 = 0x200000001200; *(uint64_t*)0x200000001200 = 0x200000001080; *(uint32_t*)0x200000001080 = 0x38; *(uint16_t*)0x200000001084 = 0x1403; *(uint16_t*)0x200000001086 = 1; *(uint32_t*)0x200000001088 = 0; *(uint32_t*)0x20000000108c = 0; *(uint16_t*)0x200000001090 = 9; *(uint16_t*)0x200000001092 = 2; memcpy((void*)0x200000001094, "syz2\000", 5); *(uint16_t*)0x20000000109c = 8; *(uint16_t*)0x20000000109e = 0x41; memcpy((void*)0x2000000010a0, "siw\000", 4); *(uint16_t*)0x2000000010a4 = 0x14; *(uint16_t*)0x2000000010a6 = 0x33; memcpy((void*)0x2000000010a8, "syzkaller0\000\000\000\000\000\000", 16); *(uint64_t*)0x200000001208 = 0x38; *(uint64_t*)0x2000000002d8 = 1; *(uint64_t*)0x2000000002e0 = 0; *(uint64_t*)0x2000000002e8 = 0; *(uint32_t*)0x2000000002f0 = 5; syscall(__NR_sendmsg, /*fd=*/r[1], /*msg=*/0x2000000002c0ul, /*f=*/0x100ul); return 0; }