// https://syzkaller.appspot.com/bug?id=bedf2f2ad814eac14abbeaf3a884c07fc86304dd // autogenerated by syzkaller (https://github.com/google/syzkaller) #define _GNU_SOURCE #include #include #include #include #include #include #include #include #include #ifndef __NR_mmap #define __NR_mmap 222 #endif #ifndef __NR_sendmsg #define __NR_sendmsg 211 #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$nl_netfilter arguments: [ // domain: const = 0x10 (8 bytes) // type: const = 0x3 (8 bytes) // proto: const = 0xc (4 bytes) // ] // returns sock_nl_netfilter res = syscall(__NR_socket, /*domain=*/0x10ul, /*type=*/3ul, /*proto=*/0xc); if (res != -1) r[0] = res; // sendmsg$IPCTNL_MSG_CT_NEW arguments: [ // fd: sock_nl_netfilter (resource) // msg: ptr[in, // msghdr_netlink[netlink_msg_netfilter_t[NFNL_SUBSYS_CTNETLINK, // IPCTNL_MSG_CT_NEW, ct_nla_policy]]] { // msghdr_netlink[netlink_msg_netfilter_t[NFNL_SUBSYS_CTNETLINK, // IPCTNL_MSG_CT_NEW, ct_nla_policy]] { // addr: nil // addrlen: len = 0x0 (4 bytes) // pad = 0x0 (4 bytes) // vec: ptr[in, iovec[in, // netlink_msg_netfilter_t[NFNL_SUBSYS_CTNETLINK, IPCTNL_MSG_CT_NEW, // ct_nla_policy]]] { // iovec[in, netlink_msg_netfilter_t[NFNL_SUBSYS_CTNETLINK, // IPCTNL_MSG_CT_NEW, ct_nla_policy]] { // addr: ptr[inout, array[ANYUNION]] { // array[ANYUNION] { // union ANYUNION { // ANYBLOB: buffer: {90 00 00 00 00 01 01 06 00 00 00 00 00 // 00 00 00 02 00 00 00 34 00 01 80 14 00 01 80 08 00 01 00 // 01 02 03 04 08 00 02 00 05 06 07 08 1c 00 02 80 05 00 01 // 00 06 00 00 00 06 00 02 00 04 d2 00 00 06 00 03 00 00 15 // 00 00 34 00 02 80 14 00 01 80 08 00 01 00 05 06 07 08 08 // 00 02 00 01 02 03 04 1c 00 02 80 05 00 01 00 06 00 00 00 // 06 00 02 00 00 15 00 00 06 00 03 00 04 d2 00 00 08 00 07 // 00 00 00 01 2c 0c 00 05 80 08 00 01 00 66 74 70} (length // 0x8f) // } // } // } // len: len = 0x90 (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 = 0x0 (8 bytes) // ] *(uint64_t*)0x20000200 = 0; *(uint32_t*)0x20000208 = 0; *(uint64_t*)0x20000210 = 0x20000000; *(uint64_t*)0x20000000 = 0x20000400; memcpy( (void*)0x20000400, "\x90\x00\x00\x00\x00\x01\x01\x06\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00" "\x00\x00\x34\x00\x01\x80\x14\x00\x01\x80\x08\x00\x01\x00\x01\x02\x03\x04" "\x08\x00\x02\x00\x05\x06\x07\x08\x1c\x00\x02\x80\x05\x00\x01\x00\x06\x00" "\x00\x00\x06\x00\x02\x00\x04\xd2\x00\x00\x06\x00\x03\x00\x00\x15\x00\x00" "\x34\x00\x02\x80\x14\x00\x01\x80\x08\x00\x01\x00\x05\x06\x07\x08\x08\x00" "\x02\x00\x01\x02\x03\x04\x1c\x00\x02\x80\x05\x00\x01\x00\x06\x00\x00\x00" "\x06\x00\x02\x00\x00\x15\x00\x00\x06\x00\x03\x00\x04\xd2\x00\x00\x08\x00" "\x07\x00\x00\x00\x01\x2c\x0c\x00\x05\x80\x08\x00\x01\x00\x66\x74\x70", 143); *(uint64_t*)0x20000008 = 0x90; *(uint64_t*)0x20000218 = 1; *(uint64_t*)0x20000220 = 0; *(uint64_t*)0x20000228 = 0; *(uint32_t*)0x20000230 = 0; syscall(__NR_sendmsg, /*fd=*/r[0], /*msg=*/0x20000200ul, /*f=*/0ul); // sendmsg$IPCTNL_MSG_EXP_NEW arguments: [ // fd: sock_nl_netfilter (resource) // msg: ptr[in, // msghdr_netlink[netlink_msg_netfilter_t[NFNL_SUBSYS_CTNETLINK_EXP, // IPCTNL_MSG_EXP_NEW, exp_nla_policy]]] { // msghdr_netlink[netlink_msg_netfilter_t[NFNL_SUBSYS_CTNETLINK_EXP, // IPCTNL_MSG_EXP_NEW, exp_nla_policy]] { // addr: nil // addrlen: len = 0x0 (4 bytes) // pad = 0x0 (4 bytes) // vec: ptr[in, iovec[in, // netlink_msg_netfilter_t[NFNL_SUBSYS_CTNETLINK_EXP, // IPCTNL_MSG_EXP_NEW, exp_nla_policy]]] { // iovec[in, netlink_msg_netfilter_t[NFNL_SUBSYS_CTNETLINK_EXP, // IPCTNL_MSG_EXP_NEW, exp_nla_policy]] { // addr: ptr[inout, array[ANYUNION]] { // array[ANYUNION] { // union ANYUNION { // ANYBLOB: buffer: {c8 00 00 00 00 02 01 06 00 00 00 00 00 // 00 00 00 02 00 00 00 34 00 01 80 14 00 01 80 08 00 01 00 // 01 02 03 04 08 00 02 00 05 06 07 08 1c 00 02 80 05 00 01 // 00 06 00 00 00 06 00 02 00 04 d2 00 00 06 00 03 00 00 15 // 00 00 34 00 02 80 14 00 01 80 08 00 01 00 05 06 07 08 08 // 00 02 00 01 02 03 04 1c 00 02 80 05 00 01 00 06 00 00 00 // 06 00 02 00 00 14 00 00 06 00 03 00 9c 40 00 00 34 00 03 // 80 14 00 01 80 08 00 01 00 ff ff ff ff 08 00 02 00 ff ff // ff ff 1c 00 02 80 05 00 01 00 ff 00 00 00 06 00 02 00 00 // 00 00 00 06 00 03 00 ff ff 00 00 16 00 0b 00 6e 61 74 2d // 66 6f 6c 6c 6f 77 2d 6d 61 73 74 65 72} (length 0xc5) // } // } // } // len: len = 0xc8 (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 = 0x0 (8 bytes) // ] *(uint64_t*)0x20000300 = 0; *(uint32_t*)0x20000308 = 0; *(uint64_t*)0x20000310 = 0x20000100; *(uint64_t*)0x20000100 = 0x20000800; memcpy( (void*)0x20000800, "\xc8\x00\x00\x00\x00\x02\x01\x06\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00" "\x00\x00\x34\x00\x01\x80\x14\x00\x01\x80\x08\x00\x01\x00\x01\x02\x03\x04" "\x08\x00\x02\x00\x05\x06\x07\x08\x1c\x00\x02\x80\x05\x00\x01\x00\x06\x00" "\x00\x00\x06\x00\x02\x00\x04\xd2\x00\x00\x06\x00\x03\x00\x00\x15\x00\x00" "\x34\x00\x02\x80\x14\x00\x01\x80\x08\x00\x01\x00\x05\x06\x07\x08\x08\x00" "\x02\x00\x01\x02\x03\x04\x1c\x00\x02\x80\x05\x00\x01\x00\x06\x00\x00\x00" "\x06\x00\x02\x00\x00\x14\x00\x00\x06\x00\x03\x00\x9c\x40\x00\x00\x34\x00" "\x03\x80\x14\x00\x01\x80\x08\x00\x01\x00\xff\xff\xff\xff\x08\x00\x02\x00" "\xff\xff\xff\xff\x1c\x00\x02\x80\x05\x00\x01\x00\xff\x00\x00\x00\x06\x00" "\x02\x00\x00\x00\x00\x00\x06\x00\x03\x00\xff\xff\x00\x00\x16\x00\x0b\x00" "\x6e\x61\x74\x2d\x66\x6f\x6c\x6c\x6f\x77\x2d\x6d\x61\x73\x74\x65\x72", 197); *(uint64_t*)0x20000108 = 0xc8; *(uint64_t*)0x20000318 = 1; *(uint64_t*)0x20000320 = 0; *(uint64_t*)0x20000328 = 0; *(uint32_t*)0x20000330 = 0; syscall(__NR_sendmsg, /*fd=*/r[0], /*msg=*/0x20000300ul, /*f=*/0ul); // socket$nl_netfilter arguments: [ // domain: const = 0x10 (8 bytes) // type: const = 0x3 (8 bytes) // proto: const = 0xc (4 bytes) // ] // returns sock_nl_netfilter res = syscall(__NR_socket, /*domain=*/0x10ul, /*type=*/3ul, /*proto=*/0xc); if (res != -1) r[1] = res; // sendmsg$IPCTNL_MSG_EXP_DELETE arguments: [ // fd: sock_nl_netfilter (resource) // msg: ptr[in, // msghdr_netlink[netlink_msg_netfilter_t[NFNL_SUBSYS_CTNETLINK_EXP, // IPCTNL_MSG_EXP_DELETE, exp_nla_policy]]] { // msghdr_netlink[netlink_msg_netfilter_t[NFNL_SUBSYS_CTNETLINK_EXP, // IPCTNL_MSG_EXP_DELETE, exp_nla_policy]] { // addr: nil // addrlen: len = 0x0 (4 bytes) // pad = 0x0 (4 bytes) // vec: ptr[in, iovec[in, // netlink_msg_netfilter_t[NFNL_SUBSYS_CTNETLINK_EXP, // IPCTNL_MSG_EXP_DELETE, exp_nla_policy]]] { // iovec[in, netlink_msg_netfilter_t[NFNL_SUBSYS_CTNETLINK_EXP, // IPCTNL_MSG_EXP_DELETE, exp_nla_policy]] { // addr: ptr[in, // netlink_msg_netfilter_tt[NFNL_SUBSYS_CTNETLINK_EXP, // IPCTNL_MSG_EXP_DELETE, array[exp_nla_policy]]] { // netlink_msg_netfilter_tt[NFNL_SUBSYS_CTNETLINK_EXP, // IPCTNL_MSG_EXP_DELETE, array[exp_nla_policy]] { // len: len = 0x20 (4 bytes) // type: const = 0x2 (1 bytes) // subsys: const = 0x2 (1 bytes) // flags: netlink_netfilter_msg_flags = 0x801 (2 bytes) // seq: const = 0x0 (4 bytes) // pid: const = 0x0 (4 bytes) // hdr: nfgenmsg { // nfgen_family: nfproto = 0x5 (1 bytes) // version: const = 0x0 (1 bytes) // res_id: int16be = 0x4 (2 bytes) // } // attrs: array[exp_nla_policy] { // union exp_nla_policy { // CTA_EXPECT_HELP_NAME: // nlattr_t[const[CTA_EXPECT_HELP_NAME, int16], // string[xt_helper_names]] { // nla_len: offsetof = 0xa (2 bytes) // nla_type: const = 0x6 (2 bytes) // payload: buffer: {51 2e 39 33 31 00} (length 0x6) // size: buffer: {} (length 0x0) // } // } // } // } // } // len: len = 0x20 (8 bytes) // } // } // vlen: const = 0x1 (8 bytes) // ctrl: const = 0x0 (8 bytes) // ctrllen: const = 0x0 (8 bytes) // f: send_flags = 0x4000010 (4 bytes) // pad = 0x0 (4 bytes) // } // } // f: send_flags = 0x0 (8 bytes) // ] *(uint64_t*)0x20000600 = 0; *(uint32_t*)0x20000608 = 0; *(uint64_t*)0x20000610 = 0x200005c0; *(uint64_t*)0x200005c0 = 0x200004c0; *(uint32_t*)0x200004c0 = 0x20; *(uint8_t*)0x200004c4 = 2; *(uint8_t*)0x200004c5 = 2; *(uint16_t*)0x200004c6 = 0x801; *(uint32_t*)0x200004c8 = 0; *(uint32_t*)0x200004cc = 0; *(uint8_t*)0x200004d0 = 5; *(uint8_t*)0x200004d1 = 0; *(uint16_t*)0x200004d2 = htobe16(4); *(uint16_t*)0x200004d4 = 0xa; *(uint16_t*)0x200004d6 = 6; memcpy((void*)0x200004d8, "Q.931\000", 6); *(uint64_t*)0x200005c8 = 0x20; *(uint64_t*)0x20000618 = 1; *(uint64_t*)0x20000620 = 0; *(uint64_t*)0x20000628 = 0; *(uint32_t*)0x20000630 = 0x4000010; syscall(__NR_sendmsg, /*fd=*/r[1], /*msg=*/0x20000600ul, /*f=*/0ul); return 0; }