// https://syzkaller.appspot.com/bug?id=6d2b2d495ba164e0699e29f776574e07466323fd // autogenerated by syzkaller (https://github.com/google/syzkaller) #define _GNU_SOURCE #include #include #include #include #include #include #include #include uint64_t r[4] = {0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0x0}; 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 = 0x101c01 (4 bytes) // mode: const = 0x0 (2 bytes) // ] // returns fd_tun memcpy((void*)0x200000000100, "/dev/net/tun\000", 13); res = syscall( __NR_openat, /*fd=*/0xffffffffffffff9cul, /*file=*/0x200000000100ul, /*flags=O_SYNC|O_NONBLOCK|O_APPEND|O_WRONLY*/ 0x101c01, /*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 arguments: [ // domain: socket_domain = 0x400000000010 (8 bytes) // type: socket_type = 0x3 (8 bytes) // proto: int32 = 0x0 (4 bytes) // ] // returns sock res = syscall(__NR_socket, /*domain=AF_NETLINK|0x400000000000*/ 0x400000000010ul, /*type=SOCK_RAW*/ 3ul, /*proto=*/0); if (res != -1) r[1] = res; // socket$unix arguments: [ // domain: const = 0x1 (8 bytes) // type: unix_socket_type = 0x2 (8 bytes) // proto: const = 0x0 (4 bytes) // ] // returns sock_unix res = syscall(__NR_socket, /*domain=*/1ul, /*type=SOCK_DGRAM*/ 2ul, /*proto=*/0); if (res != -1) r[2] = res; // ioctl$sock_SIOCGIFINDEX arguments: [ // fd: sock (resource) // cmd: const = 0x8933 (4 bytes) // arg: ptr[out, ifreq_dev_t[devnames, ifindex]] { // ifreq_dev_t[devnames, ifindex] { // ifr_ifrn: buffer: {73 79 7a 6b 61 6c 6c 65 72 30 00 00 00 00 00 00} // (length 0x10) elem: ifindex (resource) pad = 0x0 (20 bytes) // } // } // ] memcpy((void*)0x200000000100, "syzkaller0\000\000\000\000\000\000", 16); res = syscall(__NR_ioctl, /*fd=*/r[2], /*cmd=*/0x8933, /*arg=*/0x200000000100ul); if (res != -1) r[3] = *(uint32_t*)0x200000000110; // ioctl$TUNSETLINK arguments: [ // fd: fd_tun (resource) // cmd: const = 0x400454cd (4 bytes) // arg: dev_type_arphdr = 0x1a (8 bytes) // ] syscall(__NR_ioctl, /*fd=*/r[0], /*cmd=*/0x400454cd, /*arg=ARPHRD_IEEE1394|ARPHRD_EETHER*/ 0x1aul); // sendmsg$nl_route_sched arguments: [ // fd: sock_nl_route (resource) // msg: ptr[in, msghdr_netlink[netlink_msg_route_sched]] { // msghdr_netlink[netlink_msg_route_sched] { // addr: nil // addrlen: len = 0x0 (4 bytes) // pad = 0x0 (4 bytes) // vec: ptr[in, iovec[in, netlink_msg_route_sched]] { // iovec[in, netlink_msg_route_sched] { // addr: ptr[in, netlink_msg_route_sched] { // union netlink_msg_route_sched { // newqdisc: netlink_msg_t[const[RTM_NEWQDISC, int16], // tcmsg[AF_UNSPEC], rtm_tca_policy] { // len: len = 0x30 (4 bytes) // type: const = 0x24 (2 bytes) // flags: netlink_msg_flags = 0xf1d (2 bytes) // seq: int32 = 0x0 (4 bytes) // pid: int32 = 0x0 (4 bytes) // payload: tcmsg[AF_UNSPEC] { // family: const = 0x0 (1 bytes) // tcm__pad1: const = 0x0 (1 bytes) // tcm__pad2: const = 0x0 (2 bytes) // ifindex: ifindex (resource) // tcm_handle: tcm_handle { // minor: tcm_handle_offsets = 0xfffe (2 bytes) // major: tcm_handle_offsets = 0x0 (2 bytes) // } // tcm_parent: tcm_handle { // minor: tcm_handle_offsets = 0xfff1 (2 bytes) // major: tcm_handle_offsets = 0xffff (2 bytes) // } // tcm_info: tcm_handle { // minor: tcm_handle_offsets = 0x0 (2 bytes) // major: tcm_handle_offsets = 0x0 (2 bytes) // } // } // attrs: array[rtm_tca_policy] { // union rtm_tca_policy { // qdisc_kind_options: union qdisc_kind_options { // q_clsact: nlattr_t[const[TCA_KIND, int16], // string["clsact"]] { // nla_len: offsetof = 0xb (2 bytes) // nla_type: const = 0x1 (2 bytes) // payload: buffer: {63 6c 73 61 63 74 00} (length // 0x7) size: buffer: {} (length 0x0) pad = 0x0 (1 // bytes) // } // } // } // } // } // } // } // len: len = 0x30 (8 bytes) // } // } // vlen: const = 0x1 (8 bytes) // ctrl: const = 0x0 (8 bytes) // ctrllen: const = 0x0 (8 bytes) // f: send_flags = 0x0 (4 bytes) // pad = 0x0 (4 bytes) // } // } // f: send_flags = 0x8c0 (8 bytes) // ] *(uint64_t*)0x2000000001c0 = 0; *(uint32_t*)0x2000000001c8 = 0; *(uint64_t*)0x2000000001d0 = 0x200000001300; *(uint64_t*)0x200000001300 = 0x200000000900; *(uint32_t*)0x200000000900 = 0x30; *(uint16_t*)0x200000000904 = 0x24; *(uint16_t*)0x200000000906 = 0xf1d; *(uint32_t*)0x200000000908 = 0; *(uint32_t*)0x20000000090c = 0; *(uint8_t*)0x200000000910 = 0; *(uint8_t*)0x200000000911 = 0; *(uint16_t*)0x200000000912 = 0; *(uint32_t*)0x200000000914 = r[3]; *(uint16_t*)0x200000000918 = 0xfffe; *(uint16_t*)0x20000000091a = 0; *(uint16_t*)0x20000000091c = 0xfff1; *(uint16_t*)0x20000000091e = -1; *(uint16_t*)0x200000000920 = 0; *(uint16_t*)0x200000000922 = 0; *(uint16_t*)0x200000000924 = 0xb; *(uint16_t*)0x200000000926 = 1; memcpy((void*)0x200000000928, "clsact\000", 7); *(uint64_t*)0x200000001308 = 0x30; *(uint64_t*)0x2000000001d8 = 1; *(uint64_t*)0x2000000001e0 = 0; *(uint64_t*)0x2000000001e8 = 0; *(uint32_t*)0x2000000001f0 = 0; syscall(__NR_sendmsg, /*fd=*/r[1], /*msg=*/0x2000000001c0ul, /*f=MSG_EOR|MSG_DONTWAIT|MSG_CONFIRM*/ 0x8c0ul); return 0; }