// https://syzkaller.appspot.com/bug?id=b36854b47dcb827d45fda42ecc3c2a187b70bbef // autogenerated by syzkaller (https://github.com/google/syzkaller) #define _GNU_SOURCE #include #include #include #include #include #include #include #include #include uint64_t r[2] = {0xffffffffffffffff, 0xffffffffffffffff}; int main(void) { syscall(__NR_mmap, /*addr=*/0x1ffffffff000ul, /*len=*/0x1000, /*prot=*/0ul, /*flags=MAP_FIXED|MAP_ANONYMOUS|MAP_PRIVATE*/ 0x32ul, /*fd=*/(intptr_t)-1, /*offset=*/0ul); syscall(__NR_mmap, /*addr=*/0x200000000000ul, /*len=*/0x1000000, /*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=*/0x1000, /*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)) { } // mkdirat arguments: [ // fd: fd_dir (resource) // path: ptr[in, buffer] { // buffer: {2e 2f 66 69 6c 65 30 00} (length 0x8) // } // mode: open_mode = 0x46 (8 bytes) // ] memcpy((void*)0x200000000040, "./file0\000", 8); syscall(__NR_mkdirat, /*fd=*/0xffffff9c, /*path=*/0x200000000040ul, /*mode=S_IWOTH|S_IROTH|S_IXUSR*/ 0x46ul); // mount$incfs arguments: [ // src: ptr[in, buffer] { // buffer: {2e 2f 66 69 6c 65 30 00} (length 0x8) // } // dst: ptr[in, buffer] { // buffer: {2e 2f 66 69 6c 65 30 00} (length 0x8) // } // type: ptr[in, buffer] { // buffer: {69 6e 63 72 65 6d 65 6e 74 61 6c 2d 66 73 00} (length 0xf) // } // flags: mount_flags = 0x0 (8 bytes) // opts: nil // ] memcpy((void*)0x200000000080, "./file0\000", 8); memcpy((void*)0x200000000040, "./file0\000", 8); memcpy((void*)0x200000000140, "incremental-fs\000", 15); syscall(__NR_mount, /*src=*/0x200000000080ul, /*dst=*/0x200000000040ul, /*type=*/0x200000000140ul, /*flags=*/0ul, /*opts=*/0ul); // openat arguments: [ // fd: fd_dir (resource) // file: ptr[in, buffer] { // buffer: {2e 2f 66 69 6c 65 30 00} (length 0x8) // } // flags: open_flags = 0x0 (4 bytes) // mode: open_mode = 0x8c (2 bytes) // ] // returns fd memcpy((void*)0x200000000180, "./file0\000", 8); res = syscall(__NR_openat, /*fd=*/0xffffff9c, /*file=*/0x200000000180ul, /*flags=*/0, /*mode=S_IROTH|S_IXGRP|S_IWUSR*/ 0x8c); if (res != -1) r[0] = res; // openat$incfs arguments: [ // fd: fd_dir (resource) // file: ptr[in, buffer] { // buffer: {2e 70 65 6e 64 69 6e 67 5f 72 65 61 64 73 00} (length 0xf) // } // flags: open_flags = 0x0 (4 bytes) // mode: open_mode = 0x130 (2 bytes) // ] // returns fd memcpy((void*)0x2000000001c0, ".pending_reads\000", 15); res = syscall(__NR_openat, /*fd=*/r[0], /*file=*/0x2000000001c0ul, /*flags=*/0, /*mode=S_IWGRP|S_IRGRP|S_IRUSR*/ 0x130); if (res != -1) r[1] = res; // ioctl$sock_SIOCETHTOOL arguments: [ // fd: sock (resource) // cmd: const = 0x8946 (4 bytes) // arg: ptr[inout, ifreq_dev_t[devnames, ptr[inout, ethtool_cmd_u]]] { // ifreq_dev_t[devnames, ptr[inout, ethtool_cmd_u]] { // ifr_ifrn: buffer: {74 65 61 6d 5f 73 6c 61 76 65 5f 30 00 00 00 00} // (length 0x10) elem: ptr[inout, ethtool_cmd_u] { // union ethtool_cmd_u { // ethtool_rxnfc: ethtool_rxnfc { // cmd: ethtool_rxnfc_cmd_flags = 0x32 (4 bytes) // flow_type: traffic_flow_types = 0x11 (4 bytes) // data: int64 = 0x1 (8 bytes) // fs: ethtool_rx_flow_spec { // flow_type: traffic_flow_types = 0xb (4 bytes) // h_u: union ethtool_flow_union { // udp_ip4_spec: ethtool_tcpip4_spec { // ip4src: union ipv4_addr { // multicast1: const = 0xe0000001 (4 bytes) // } // ip4dst: union ipv4_addr { // multicast1: const = 0xe0000001 (4 bytes) // } // psrc: int16be = 0x4e21 (2 bytes) // pdst: int16be = 0x4e22 (2 bytes) // tos: int8 = 0x5d (1 bytes) // pad = 0x0 (3 bytes) // } // } // h_ext: ethtool_flow_ext { // padding: const = 0x0 (2 bytes) // h_dest: union mac_addr { // dev: mac_addr_t[netdev_addr_id] { // a0: buffer: {aa aa aa aa aa} (length 0x5) // a1: int8 = 0x24 (1 bytes) // } // } // vlan_etype: int16be = 0x5 (2 bytes) // vlan_tci: int16be = 0xfb44 (2 bytes) // data: array[int32be] { // int32be = 0x5 (4 bytes) // int32be = 0x9 (4 bytes) // } // } // m_u: union ethtool_flow_union { // esp_ip4_spec: ethtool_ah_espip4_spec { // ip4src: union ipv4_addr { // local: ipv4_addr_t[const[170, int8]] { // a0: const = 0xac (1 bytes) // a1: const = 0x14 (1 bytes) // a2: const = 0x14 (1 bytes) // a3: const = 0xaa (1 bytes) // } // } // ip4dst: union ipv4_addr { // private: int32be = 0xa010100 (4 bytes) // } // spi: int32be = 0x9 (4 bytes) // tos: int8 = 0x0 (1 bytes) // pad = 0x0 (3 bytes) // } // } // m_ext: ethtool_flow_ext { // padding: const = 0x0 (2 bytes) // h_dest: union mac_addr { // broadcast: buffer: {ff ff ff ff ff ff} (length 0x6) // } // vlan_etype: int16be = 0x46 (2 bytes) // vlan_tci: int16be = 0x3ff (2 bytes) // data: array[int32be] { // int32be = 0x2 (4 bytes) // int32be = 0x0 (4 bytes) // } // } // pad = 0x0 (4 bytes) // ring_cookie: int64 = 0x10004 (8 bytes) // location: int32 = 0x2 (4 bytes) // pad = 0x0 (4 bytes) // } // rule_cnt: len = 0x0 (4 bytes) // rule_locs: array[int32] { // } // } // } // } // pad = 0x0 (16 bytes) // } // } // ] memcpy((void*)0x200000000380, "team_slave_0\000\000\000\000", 16); *(uint64_t*)0x200000000390 = 0x200000000080; *(uint32_t*)0x200000000080 = 0x32; *(uint32_t*)0x200000000084 = 0x11; *(uint64_t*)0x200000000088 = 1; *(uint32_t*)0x200000000090 = 0xb; *(uint32_t*)0x200000000094 = htobe32(0xe0000001); *(uint32_t*)0x200000000098 = htobe32(0xe0000001); *(uint16_t*)0x20000000009c = htobe16(0x4e21); *(uint16_t*)0x20000000009e = htobe16(0x4e22); *(uint8_t*)0x2000000000a0 = 0x5d; *(uint16_t*)0x2000000000c8 = 0; memset((void*)0x2000000000ca, 170, 5); *(uint8_t*)0x2000000000cf = 0x24; *(uint16_t*)0x2000000000d0 = htobe16(5); *(uint16_t*)0x2000000000d2 = htobe16(0xfb44); *(uint32_t*)0x2000000000d4 = htobe32(5); *(uint32_t*)0x2000000000d8 = htobe32(9); *(uint8_t*)0x2000000000dc = 0xac; *(uint8_t*)0x2000000000dd = 0x14; *(uint8_t*)0x2000000000de = 0x14; *(uint8_t*)0x2000000000df = 0xaa; *(uint32_t*)0x2000000000e0 = htobe32(0xa010100); *(uint32_t*)0x2000000000e4 = htobe32(9); *(uint8_t*)0x2000000000e8 = 0; *(uint16_t*)0x200000000110 = 0; memset((void*)0x200000000112, 255, 6); *(uint16_t*)0x200000000118 = htobe16(0x46); *(uint16_t*)0x20000000011a = htobe16(0x3ff); *(uint32_t*)0x20000000011c = htobe32(2); *(uint32_t*)0x200000000120 = htobe32(0); *(uint64_t*)0x200000000128 = 0x10004; *(uint32_t*)0x200000000130 = 2; *(uint32_t*)0x200000000138 = 0; syscall(__NR_ioctl, /*fd=*/(intptr_t)-1, /*cmd=*/0x8946, /*arg=*/0x200000000380ul); // ioctl$TIOCL_GETKMSGREDIRECT arguments: [ // fd: fd_tty (resource) // cmd: const = 0x40106726 (4 bytes) // arg: ptr[in, const[17, const]] { // const = 0x11 (1 bytes) // } // ] *(uint8_t*)0x2000000000c0 = 0x11; syscall(__NR_ioctl, /*fd=*/r[1], /*cmd=*/0x40106726, /*arg=*/0x2000000000c0ul); return 0; }