// https://syzkaller.appspot.com/bug?id=e1772bca153bbe1f9ee19129f006e7404be322da // autogenerated by syzkaller (https://github.com/google/syzkaller) #define _GNU_SOURCE #include #include #include #include #include #include #include #include #include #ifndef __NR_connect #define __NR_connect 203 #endif #ifndef __NR_mmap #define __NR_mmap 222 #endif #ifndef __NR_sendto #define __NR_sendto 206 #endif #ifndef __NR_setsockopt #define __NR_setsockopt 208 #endif #ifndef __NR_socket #define __NR_socket 198 #endif uint64_t r[2] = {0xffffffffffffffff, 0xffffffffffffffff}; int main(void) { syscall(__NR_mmap, /*addr=*/0x1ffff000ul, /*len=*/0x1000, /*prot=*/0ul, /*flags=MAP_FIXED|MAP_ANONYMOUS|MAP_PRIVATE*/ 0x32ul, /*fd=*/(intptr_t)-1, /*offset=*/0ul); syscall(__NR_mmap, /*addr=*/0x20000000ul, /*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=*/0x21000000ul, /*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)) { } // socket$inet6 arguments: [ // domain: const = 0xa (8 bytes) // type: socket_type = 0x3 (8 bytes) // proto: int32 = 0xff (4 bytes) // ] // returns sock_in6 res = syscall(__NR_socket, /*domain=*/0xaul, /*type=SOCK_RAW*/ 3ul, /*proto=*/0xff); if (res != -1) r[0] = res; // setsockopt$IP6T_SO_SET_REPLACE arguments: [ // fd: sock_in6 (resource) // level: const = 0x29 (4 bytes) // opt: const = 0x40 (4 bytes) // val: ptr[in, ip6t_replace] { // union ip6t_replace { // filter: ip6t_replace_t["filter", 3, 4, IPT_FILTER_VALID_HOOKS, // ip6t_filter_matches, ip6t_filter_targets, ipt_unused, ipt_hook, // ipt_hook, ipt_hook, ipt_unused, ipt_unused, ipt_hook, ipt_hook, // ipt_hook, ipt_unused] { // name: buffer: {66 69 6c 74 65 72 00 00 00 00 00 00 00 00 00 00 00 // 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00} (length 0x20) // valid_hooks: const = 0xe (4 bytes) // num_entries: const = 0x4 (4 bytes) // size: bytesize = 0x340 (4 bytes) // hook_pre_routing: const = 0xffffffff (4 bytes) // hook_local_in: const = 0x1a0 (4 bytes) // hook_forward: const = 0xd0 (4 bytes) // hook_local_out: const = 0x1a0 (4 bytes) // hook_post_routing: const = 0xffffffff (4 bytes) // underflow_pre_routing: const = 0xffffffff (4 bytes) // underflow_local_in: const = 0x270 (4 bytes) // underflow_forward: const = 0x270 (4 bytes) // underflow_local_out: const = 0x270 (4 bytes) // underflow_post_routing: const = 0xffffffff (4 bytes) // num_counters: const = 0x4 (4 bytes) // counters: nil // entries: ip6t_replace_entries[3, ip6t_filter_matches, // ip6t_filter_targets] { // entries: array[ip6t_entry[ip6t_filter_matches, // ip6t_filter_targets]] { // ip6t_entry[ip6t_filter_matches, ip6t_filter_targets] { // matches: ip6t_entry_matches[ip6t_filter_matches] { // ipv6: union ip6t_ip6_or_uncond { // uncond: buffer: {00 00 00 00 00 00 00 00 00 00 00 00 00 // 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 // 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 // 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 // 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 // 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 // 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 // 00 00 00 00 00 00 00 00 00} (length 0x88) // } // nfcache: const = 0x0 (4 bytes) // target_offset: len = 0xa8 (2 bytes) // next_offset: len = 0xd0 (2 bytes) // comefrom: const = 0x0 (4 bytes) // pad = 0x0 (4 bytes) // counters: xt_counters { // pcnt: const = 0x0 (8 bytes) // bcnt: const = 0x0 (8 bytes) // } // matches: array[ip6t_filter_matches] { // } // } // target: union ip6t_filter_targets { // common: union ip6t_targets { // unspec: union xt_unspec_targets { // STANDARD: xt_target_t["", flags[nf_verdicts, int32], // 0] { // target_size: len = 0x28 (2 bytes) // name: buffer: {00 00 00 00 00 00 00 00 00 00 00 00 // 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00} // (length 0x1d) revision: const = 0x0 (1 bytes) data: // nf_verdicts = 0x0 (4 bytes) pad = 0x0 (4 bytes) // } // } // } // } // } // ip6t_entry[ip6t_filter_matches, ip6t_filter_targets] { // matches: ip6t_entry_matches[ip6t_filter_matches] { // ipv6: union ip6t_ip6_or_uncond { // uncond: buffer: {00 00 00 00 00 00 00 00 00 00 00 00 00 // 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 // 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 // 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 // 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 // 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 // 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 // 00 00 00 00 00 00 00 00 00} (length 0x88) // } // nfcache: const = 0x0 (4 bytes) // target_offset: len = 0xa8 (2 bytes) // next_offset: len = 0xd0 (2 bytes) // comefrom: const = 0x0 (4 bytes) // pad = 0x0 (4 bytes) // counters: xt_counters { // pcnt: const = 0x0 (8 bytes) // bcnt: const = 0x0 (8 bytes) // } // matches: array[ip6t_filter_matches] { // } // } // target: union ip6t_filter_targets { // common: union ip6t_targets { // unspec: union xt_unspec_targets { // STANDARD: xt_target_t["", flags[nf_verdicts, int32], // 0] { // target_size: len = 0x28 (2 bytes) // name: buffer: {00 00 00 00 00 00 00 00 00 00 00 00 // 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00} // (length 0x1d) revision: const = 0x0 (1 bytes) data: // nf_verdicts = 0xd0 (4 bytes) pad = 0x0 (4 bytes) // } // } // } // } // } // ip6t_entry[ip6t_filter_matches, ip6t_filter_targets] { // matches: ip6t_entry_matches[ip6t_filter_matches] { // ipv6: union ip6t_ip6_or_uncond { // uncond: buffer: {00 00 00 00 00 00 00 00 00 00 00 00 00 // 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 // 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 // 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 // 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 // 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 // 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 // 00 00 00 00 00 00 00 00 00} (length 0x88) // } // nfcache: const = 0x0 (4 bytes) // target_offset: len = 0xa8 (2 bytes) // next_offset: len = 0xd0 (2 bytes) // comefrom: const = 0x0 (4 bytes) // pad = 0x0 (4 bytes) // counters: xt_counters { // pcnt: const = 0x0 (8 bytes) // bcnt: const = 0x0 (8 bytes) // } // matches: array[ip6t_filter_matches] { // } // } // target: union ip6t_filter_targets { // common: union ip6t_targets { // unspec: union xt_unspec_targets { // STANDARD: xt_target_t["", flags[nf_verdicts, int32], // 0] { // target_size: len = 0x28 (2 bytes) // name: buffer: {00 00 00 00 00 00 00 00 00 00 00 00 // 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00} // (length 0x1d) revision: const = 0x0 (1 bytes) data: // nf_verdicts = 0x1a0 (4 bytes) pad = 0x0 (4 bytes) // } // } // } // } // } // } // underflow: ip6t_entry_underflow { // matches: ip6t_entry_underflow_matches { // ipv6: buffer: {00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 // 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 // 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 // 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 // 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 // 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 // 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 // 00} (length 0x88) nfcache: const = 0x0 (4 bytes) // target_offset: len = 0xa8 (2 bytes) // next_offset: len = 0xd0 (2 bytes) // comefrom: const = 0x0 (4 bytes) // pad = 0x0 (4 bytes) // counters: xt_counters { // pcnt: const = 0x0 (8 bytes) // bcnt: const = 0x0 (8 bytes) // } // } // target: xt_target_t["", const[NF_ACCEPT_VERDICT, int32], 0] { // target_size: len = 0x28 (2 bytes) // name: buffer: {00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 // 00 00 00 00 00 00 00 00 00 00 00 00 00 00} (length 0x1d) // revision: const = 0x0 (1 bytes) // data: const = 0xfffffffe (4 bytes) // pad = 0x0 (4 bytes) // } // } // } // } // } // } // len: len = 0x3a0 (8 bytes) // ] memcpy((void*)0x20000100, "filter\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000" "\000\000\000\000\000\000\000\000\000\000\000", 32); *(uint32_t*)0x20000120 = 0xe; *(uint32_t*)0x20000124 = 4; *(uint32_t*)0x20000128 = 0x340; *(uint32_t*)0x2000012c = -1; *(uint32_t*)0x20000130 = 0x1a0; *(uint32_t*)0x20000134 = 0xd0; *(uint32_t*)0x20000138 = 0x1a0; *(uint32_t*)0x2000013c = -1; *(uint32_t*)0x20000140 = -1; *(uint32_t*)0x20000144 = 0x270; *(uint32_t*)0x20000148 = 0x270; *(uint32_t*)0x2000014c = 0x270; *(uint32_t*)0x20000150 = -1; *(uint32_t*)0x20000154 = 4; *(uint64_t*)0x20000158 = 0; memset((void*)0x20000160, 0, 136); *(uint32_t*)0x200001e8 = 0; *(uint16_t*)0x200001ec = 0xa8; *(uint16_t*)0x200001ee = 0xd0; *(uint32_t*)0x200001f0 = 0; *(uint64_t*)0x200001f8 = 0; *(uint64_t*)0x20000200 = 0; *(uint16_t*)0x20000208 = 0x28; memset((void*)0x2000020a, 0, 29); *(uint8_t*)0x20000227 = 0; *(uint32_t*)0x20000228 = 0; memset((void*)0x20000230, 0, 136); *(uint32_t*)0x200002b8 = 0; *(uint16_t*)0x200002bc = 0xa8; *(uint16_t*)0x200002be = 0xd0; *(uint32_t*)0x200002c0 = 0; *(uint64_t*)0x200002c8 = 0; *(uint64_t*)0x200002d0 = 0; *(uint16_t*)0x200002d8 = 0x28; memset((void*)0x200002da, 0, 29); *(uint8_t*)0x200002f7 = 0; *(uint32_t*)0x200002f8 = 0xd0; memset((void*)0x20000300, 0, 136); *(uint32_t*)0x20000388 = 0; *(uint16_t*)0x2000038c = 0xa8; *(uint16_t*)0x2000038e = 0xd0; *(uint32_t*)0x20000390 = 0; *(uint64_t*)0x20000398 = 0; *(uint64_t*)0x200003a0 = 0; *(uint16_t*)0x200003a8 = 0x28; memset((void*)0x200003aa, 0, 29); *(uint8_t*)0x200003c7 = 0; *(uint32_t*)0x200003c8 = 0x1a0; memset((void*)0x200003d0, 0, 136); *(uint32_t*)0x20000458 = 0; *(uint16_t*)0x2000045c = 0xa8; *(uint16_t*)0x2000045e = 0xd0; *(uint32_t*)0x20000460 = 0; *(uint64_t*)0x20000468 = 0; *(uint64_t*)0x20000470 = 0; *(uint16_t*)0x20000478 = 0x28; memset((void*)0x2000047a, 0, 29); *(uint8_t*)0x20000497 = 0; *(uint32_t*)0x20000498 = 0xfffffffe; syscall(__NR_setsockopt, /*fd=*/r[0], /*level=*/0x29, /*opt=*/0x40, /*val=*/0x20000100ul, /*len=*/0x3a0ul); // socket$inet6 arguments: [ // domain: const = 0xa (8 bytes) // type: socket_type = 0x2 (8 bytes) // proto: int32 = 0x3a (4 bytes) // ] // returns sock_in6 res = syscall(__NR_socket, /*domain=*/0xaul, /*type=SOCK_DGRAM*/ 2ul, /*proto=*/0x3a); if (res != -1) r[1] = res; // connect$inet6 arguments: [ // fd: sock_in6 (resource) // addr: ptr[in, sockaddr_in6] { // sockaddr_in6 { // family: const = 0xa (2 bytes) // port: int16be = 0x4e24 (2 bytes) // flow: int32be = 0xfffffffb (4 bytes) // addr: union ipv6_addr { // empty: ipv6_addr_empty { // a0: buffer: {00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00} // (length 0x10) // } // } // scope: int32 = 0x10000 (4 bytes) // } // } // addrlen: len = 0x1c (8 bytes) // ] *(uint16_t*)0x20000180 = 0xa; *(uint16_t*)0x20000182 = htobe16(0x4e24); *(uint32_t*)0x20000184 = htobe32(0xfffffffb); memset((void*)0x20000188, 0, 16); *(uint32_t*)0x20000198 = 0x10000; syscall(__NR_connect, /*fd=*/r[1], /*addr=*/0x20000180ul, /*addrlen=*/0x1cul); // sendto$inet6 arguments: [ // fd: sock_in6 (resource) // buf: ptr[in, buffer] { // buffer: {80 00 37 bb fa 9b a1 ce} (length 0x8) // } // len: len = 0xffd8 (8 bytes) // f: send_flags = 0x0 (8 bytes) // addr: nil // addrlen: len = 0x0 (8 bytes) // ] memcpy((void*)0x20000080, "\x80\x00\x37\xbb\xfa\x9b\xa1\xce", 8); syscall(__NR_sendto, /*fd=*/r[1], /*buf=*/0x20000080ul, /*len=*/0xffd8ul, /*f=*/0ul, /*addr=*/0ul, /*addrlen=*/0ul); return 0; }