Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #define _GNU_SOURCE
- #include <arpa/inet.h>
- #include <endian.h>
- #include <errno.h>
- #include <net/if.h>
- #include <netinet/in.h>
- #include <stdbool.h>
- #include <stdint.h>
- #include <stdio.h>
- #include <stdlib.h>
- #include <string.h>
- #include <sys/socket.h>
- #include <sys/syscall.h>
- #include <sys/types.h>
- #include <unistd.h>
- #include <linux/genetlink.h>
- #include <linux/if_addr.h>
- #include <linux/if_link.h>
- #include <linux/in6.h>
- #include <linux/neighbour.h>
- #include <linux/net.h>
- #include <linux/netlink.h>
- #include <linux/rtnetlink.h>
- #include <linux/veth.h>
- #define BITMASK(bf_off, bf_len) (((1ull << (bf_len)) - 1) << (bf_off))
- #define STORE_BY_BITMASK(type, htobe, addr, val, bf_off, bf_len) \
- *(type*)(addr) = \
- htobe((htobe(*(type*)(addr)) & ~BITMASK((bf_off), (bf_len))) | \
- (((type)(val) << (bf_off)) & BITMASK((bf_off), (bf_len))))
- struct csum_inet {
- uint32_t acc;
- };
- static void csum_inet_init(struct csum_inet* csum)
- {
- csum->acc = 0;
- }
- static void csum_inet_update(struct csum_inet* csum, const uint8_t* data,
- size_t length)
- {
- if (length == 0)
- return;
- size_t i = 0;
- for (; i < length - 1; i += 2)
- csum->acc += *(uint16_t*)&data[i];
- if (length & 1)
- csum->acc += le16toh((uint16_t)data[length - 1]);
- while (csum->acc > 0xffff)
- csum->acc = (csum->acc & 0xffff) + (csum->acc >> 16);
- }
- static uint16_t csum_inet_digest(struct csum_inet* csum)
- {
- return ~csum->acc;
- }
- struct nlmsg {
- char* pos;
- int nesting;
- struct nlattr* nested[8];
- char buf[4096];
- };
- static void netlink_init(struct nlmsg* nlmsg, int typ, int flags,
- const void* data, int size)
- {
- memset(nlmsg, 0, sizeof(*nlmsg));
- struct nlmsghdr* hdr = (struct nlmsghdr*)nlmsg->buf;
- hdr->nlmsg_type = typ;
- hdr->nlmsg_flags = NLM_F_REQUEST | NLM_F_ACK | flags;
- memcpy(hdr + 1, data, size);
- nlmsg->pos = (char*)(hdr + 1) + NLMSG_ALIGN(size);
- }
- static void netlink_attr(struct nlmsg* nlmsg, int typ, const void* data,
- int size)
- {
- struct nlattr* attr = (struct nlattr*)nlmsg->pos;
- attr->nla_len = sizeof(*attr) + size;
- attr->nla_type = typ;
- if (size > 0)
- memcpy(attr + 1, data, size);
- nlmsg->pos += NLMSG_ALIGN(attr->nla_len);
- }
- static int netlink_send_ext(struct nlmsg* nlmsg, int sock, uint16_t reply_type,
- int* reply_len, bool dofail)
- {
- if (nlmsg->pos > nlmsg->buf + sizeof(nlmsg->buf) || nlmsg->nesting)
- exit(1);
- struct nlmsghdr* hdr = (struct nlmsghdr*)nlmsg->buf;
- hdr->nlmsg_len = nlmsg->pos - nlmsg->buf;
- struct sockaddr_nl addr;
- memset(&addr, 0, sizeof(addr));
- addr.nl_family = AF_NETLINK;
- ssize_t n = sendto(sock, nlmsg->buf, hdr->nlmsg_len, 0,
- (struct sockaddr*)&addr, sizeof(addr));
- if (n != (ssize_t)hdr->nlmsg_len) {
- if (dofail)
- exit(1);
- return -1;
- }
- n = recv(sock, nlmsg->buf, sizeof(nlmsg->buf), 0);
- if (reply_len)
- *reply_len = 0;
- if (n < 0) {
- if (dofail)
- exit(1);
- return -1;
- }
- if (n < (ssize_t)sizeof(struct nlmsghdr)) {
- errno = EINVAL;
- if (dofail)
- exit(1);
- return -1;
- }
- if (hdr->nlmsg_type == NLMSG_DONE)
- return 0;
- if (reply_len && hdr->nlmsg_type == reply_type) {
- *reply_len = n;
- return 0;
- }
- if (n < (ssize_t)(sizeof(struct nlmsghdr) + sizeof(struct nlmsgerr))) {
- errno = EINVAL;
- if (dofail)
- exit(1);
- return -1;
- }
- if (hdr->nlmsg_type != NLMSG_ERROR) {
- errno = EINVAL;
- if (dofail)
- exit(1);
- return -1;
- }
- errno = -((struct nlmsgerr*)(hdr + 1))->error;
- return -errno;
- }
- static int netlink_query_family_id(struct nlmsg* nlmsg, int sock,
- const char* family_name, bool dofail)
- {
- struct genlmsghdr genlhdr;
- memset(&genlhdr, 0, sizeof(genlhdr));
- genlhdr.cmd = CTRL_CMD_GETFAMILY;
- netlink_init(nlmsg, GENL_ID_CTRL, 0, &genlhdr, sizeof(genlhdr));
- netlink_attr(nlmsg, CTRL_ATTR_FAMILY_NAME, family_name,
- strnlen(family_name, GENL_NAMSIZ - 1) + 1);
- int n = 0;
- int err = netlink_send_ext(nlmsg, sock, GENL_ID_CTRL, &n, dofail);
- if (err < 0) {
- return -1;
- }
- uint16_t id = 0;
- struct nlattr* attr = (struct nlattr*)(nlmsg->buf + NLMSG_HDRLEN +
- NLMSG_ALIGN(sizeof(genlhdr)));
- for (; (char*)attr < nlmsg->buf + n;
- attr = (struct nlattr*)((char*)attr + NLMSG_ALIGN(attr->nla_len))) {
- if (attr->nla_type == CTRL_ATTR_FAMILY_ID) {
- id = *(uint16_t*)(attr + 1);
- break;
- }
- }
- if (!id) {
- errno = EINVAL;
- return -1;
- }
- recv(sock, nlmsg->buf, sizeof(nlmsg->buf), 0);
- return id;
- }
- static long syz_genetlink_get_family_id(volatile long name,
- volatile long sock_arg)
- {
- int fd = sock_arg;
- if (fd < 0) {
- fd = socket(AF_NETLINK, SOCK_RAW, NETLINK_GENERIC);
- if (fd == -1) {
- return -1;
- }
- }
- struct nlmsg nlmsg_tmp;
- int ret = netlink_query_family_id(&nlmsg_tmp, fd, (char*)name, false);
- if ((int)sock_arg < 0)
- close(fd);
- if (ret < 0) {
- return -1;
- }
- return ret;
- }
- uint64_t r[8] = {0xffffffffffffffff, 0x0,
- 0xffffffffffffffff, 0xffffffffffffffff,
- 0xffffffffffffffff, 0xffffffffffffffff,
- 0xffffffffffffffff, 0xffffffffffffffff};
- int main(void)
- {
- syscall(__NR_mmap, /*addr=*/0x1ffff000ul, /*len=*/0x1000ul, /*prot=*/0ul,
- /*flags=MAP_FIXED|MAP_ANONYMOUS|MAP_PRIVATE*/ 0x32ul, /*fd=*/-1,
- /*offset=*/0ul);
- syscall(__NR_mmap, /*addr=*/0x20000000ul, /*len=*/0x1000000ul,
- /*prot=PROT_WRITE|PROT_READ|PROT_EXEC*/ 7ul,
- /*flags=MAP_FIXED|MAP_ANONYMOUS|MAP_PRIVATE*/ 0x32ul, /*fd=*/-1,
- /*offset=*/0ul);
- syscall(__NR_mmap, /*addr=*/0x21000000ul, /*len=*/0x1000ul, /*prot=*/0ul,
- /*flags=MAP_FIXED|MAP_ANONYMOUS|MAP_PRIVATE*/ 0x32ul, /*fd=*/-1,
- /*offset=*/0ul);
- intptr_t res = 0;
- res = syscall(__NR_socket, /*domain=*/0x10ul, /*type=*/3ul, /*proto=*/0x10);
- if (res != -1)
- r[0] = res;
- memcpy((void*)0x200000c0, "nl80211\000", 8);
- res = -1;
- res = syz_genetlink_get_family_id(/*name=*/0x200000c0, /*fd=*/-1);
- if (res != -1)
- r[1] = res;
- *(uint64_t*)0x20000900 = 0;
- *(uint32_t*)0x20000908 = 0;
- *(uint64_t*)0x20000910 = 0x200008c0;
- *(uint64_t*)0x200008c0 = 0x20000380;
- *(uint32_t*)0x20000380 = 0x24;
- *(uint16_t*)0x20000384 = r[1];
- *(uint16_t*)0x20000386 = 1;
- *(uint32_t*)0x20000388 = 0;
- *(uint32_t*)0x2000038c = 0;
- *(uint8_t*)0x20000390 = 0x31;
- *(uint8_t*)0x20000391 = 0;
- *(uint16_t*)0x20000392 = 0;
- *(uint16_t*)0x20000394 = 8;
- *(uint16_t*)0x20000396 = 1;
- *(uint32_t*)0x20000398 = 0;
- *(uint16_t*)0x2000039c = 8;
- *(uint16_t*)0x2000039e = 3;
- *(uint32_t*)0x200003a0 = 0;
- *(uint64_t*)0x200008c8 = 0x24;
- *(uint64_t*)0x20000918 = 1;
- *(uint64_t*)0x20000920 = 0;
- *(uint64_t*)0x20000928 = 0;
- *(uint32_t*)0x20000930 = 0;
- syscall(__NR_sendmsg, /*fd=*/r[0], /*msg=*/0x20000900ul, /*f=*/0ul);
- memcpy((void*)0x20000300, "ethtool\000", 8);
- syz_genetlink_get_family_id(/*name=*/0x20000300, /*fd=*/r[0]);
- syscall(__NR_ioctl, /*fd=*/-1, /*cmd=*/0x89f0, /*arg=*/0ul);
- memcpy((void*)0x20000040, "/proc/partitions\000", 17);
- res = syscall(__NR_openat, /*fd=*/0xffffffffffffff9cul, /*file=*/0x20000040ul,
- /*flags=*/0ul, /*mode=*/0ul);
- if (res != -1)
- r[2] = res;
- res = -1;
- res = syz_genetlink_get_family_id(/*name=*/0, /*fd=*/r[2]);
- if (res != -1)
- r[3] = res;
- memcpy((void*)0x20000540, "team0\000\000\000\000\000\000\000\000\000\000\000",
- 16);
- res = syscall(__NR_ioctl, /*fd=*/-1, /*cmd=*/0x8933, /*arg=*/0x20000540ul);
- if (res != -1)
- r[4] = *(uint32_t*)0x20000550;
- memcpy((void*)0x20000600, "syztnl2\000\000\000\000\000\000\000\000\000", 16);
- *(uint64_t*)0x20000610 = 0x20000580;
- memcpy((void*)0x20000580, "syztnl2\000\000\000\000\000\000\000\000\000", 16);
- *(uint32_t*)0x20000590 = 0;
- *(uint8_t*)0x20000594 = 4;
- *(uint8_t*)0x20000595 = -1;
- *(uint8_t*)0x20000596 = 0;
- *(uint32_t*)0x20000598 = htobe32(0x5fd23cba);
- *(uint32_t*)0x2000059c = 0x50;
- *(uint8_t*)0x200005a0 = 0xfe;
- *(uint8_t*)0x200005a1 = 0x88;
- memset((void*)0x200005a2, 0, 12);
- *(uint8_t*)0x200005ae = 1;
- *(uint8_t*)0x200005af = 1;
- *(uint64_t*)0x200005b0 = htobe64(0);
- *(uint64_t*)0x200005b8 = htobe64(1);
- *(uint16_t*)0x200005c0 = htobe16(0x8000);
- *(uint16_t*)0x200005c2 = htobe16(8);
- *(uint32_t*)0x200005c4 = htobe32(0x3f);
- *(uint32_t*)0x200005c8 = htobe32(3);
- res = syscall(__NR_ioctl, /*fd=*/r[2], /*cmd=*/0x89f0, /*arg=*/0x20000600ul);
- if (res != -1)
- r[5] = *(uint32_t*)0x20000590;
- memcpy((void*)0x20000700, "tunl0\000\000\000\000\000\000\000\000\000\000\000",
- 16);
- *(uint64_t*)0x20000710 = 0x20000640;
- memcpy((void*)0x20000640, "gretap0\000\000\000\000\000\000\000\000\000", 16);
- *(uint32_t*)0x20000650 = 0;
- *(uint16_t*)0x20000654 = htobe16(1);
- *(uint16_t*)0x20000656 = htobe16(0);
- *(uint32_t*)0x20000658 = htobe32(0);
- *(uint32_t*)0x2000065c = htobe32(0x100);
- STORE_BY_BITMASK(uint8_t, , 0x20000660, 0x19, 0, 4);
- STORE_BY_BITMASK(uint8_t, , 0x20000660, 4, 4, 4);
- STORE_BY_BITMASK(uint8_t, , 0x20000661, 1, 0, 2);
- STORE_BY_BITMASK(uint8_t, , 0x20000661, 7, 2, 6);
- *(uint16_t*)0x20000662 = htobe16(0x64);
- *(uint16_t*)0x20000664 = htobe16(0x68);
- *(uint16_t*)0x20000666 = htobe16(0);
- *(uint8_t*)0x20000668 = 0;
- *(uint8_t*)0x20000669 = 0x29;
- *(uint16_t*)0x2000066a = htobe16(0);
- *(uint32_t*)0x2000066c = htobe32(-1);
- *(uint32_t*)0x20000670 = htobe32(0x64010100);
- *(uint8_t*)0x20000674 = 0x44;
- *(uint8_t*)0x20000675 = 0x20;
- *(uint8_t*)0x20000676 = 0x14;
- STORE_BY_BITMASK(uint8_t, , 0x20000677, 0, 0, 4);
- STORE_BY_BITMASK(uint8_t, , 0x20000677, 4, 4, 4);
- *(uint32_t*)0x20000678 = htobe32(7);
- *(uint32_t*)0x2000067c = htobe32(9);
- *(uint32_t*)0x20000680 = htobe32(0xcdd);
- *(uint32_t*)0x20000684 = htobe32(9);
- *(uint32_t*)0x20000688 = htobe32(7);
- *(uint32_t*)0x2000068c = htobe32(0x81);
- *(uint32_t*)0x20000690 = htobe32(0x8000);
- *(uint8_t*)0x20000694 = 1;
- *(uint8_t*)0x20000695 = 0x44;
- *(uint8_t*)0x20000696 = 0x14;
- *(uint8_t*)0x20000697 = 0x2b;
- STORE_BY_BITMASK(uint8_t, , 0x20000698, 1, 0, 4);
- STORE_BY_BITMASK(uint8_t, , 0x20000698, 9, 4, 4);
- *(uint32_t*)0x20000699 = htobe32(0xe0000001);
- *(uint32_t*)0x2000069d = htobe32(0);
- *(uint32_t*)0x200006a1 = htobe32(0xa010101);
- *(uint32_t*)0x200006a5 = htobe32(0xfffff001);
- *(uint8_t*)0x200006a9 = 7;
- *(uint8_t*)0x200006aa = 0x1b;
- *(uint8_t*)0x200006ab = 0;
- *(uint32_t*)0x200006ac = htobe32(-1);
- *(uint8_t*)0x200006b0 = 0xac;
- *(uint8_t*)0x200006b1 = 0x14;
- *(uint8_t*)0x200006b2 = 0x14;
- *(uint8_t*)0x200006b3 = 0xaa;
- *(uint8_t*)0x200006b4 = 0xac;
- *(uint8_t*)0x200006b5 = 0x1e;
- *(uint8_t*)0x200006b6 = 0;
- *(uint8_t*)0x200006b7 = 1;
- *(uint32_t*)0x200006b8 = htobe32(-1);
- *(uint8_t*)0x200006bc = 0xac;
- *(uint8_t*)0x200006bd = 0x1e;
- *(uint8_t*)0x200006be = 0;
- *(uint8_t*)0x200006bf = 1;
- *(uint32_t*)0x200006c0 = htobe32(0xe0000001);
- struct csum_inet csum_1;
- csum_inet_init(&csum_1);
- csum_inet_update(&csum_1, (const uint8_t*)0x20000660, 100);
- *(uint16_t*)0x2000066a = csum_inet_digest(&csum_1);
- res = syscall(__NR_ioctl, /*fd=*/-1, /*cmd=*/0x89f0, /*arg=*/0x20000700ul);
- if (res != -1)
- r[6] = *(uint32_t*)0x20000650;
- syscall(__NR_ioctl, /*fd=*/r[2], /*cmd=*/0x89f3, /*arg=*/0ul);
- memcpy((void*)0x20000880, "team0\000\000\000\000\000\000\000\000\000\000\000",
- 16);
- res = syscall(__NR_ioctl, /*fd=*/r[2], /*cmd=*/0x8933, /*arg=*/0x20000880ul);
- if (res != -1)
- r[7] = *(uint32_t*)0x20000890;
- *(uint64_t*)0x20000ac0 = 0x200004c0;
- *(uint16_t*)0x200004c0 = 0x10;
- *(uint16_t*)0x200004c2 = 0;
- *(uint32_t*)0x200004c4 = 0;
- *(uint32_t*)0x200004c8 = 0x80000000;
- *(uint32_t*)0x20000ac8 = 0xc;
- *(uint64_t*)0x20000ad0 = 0x20000a80;
- *(uint64_t*)0x20000a80 = 0x20000b00;
- memcpy(
- (void*)0x20000b00,
- "\x94\x00\x00\x00\x19\xc7\x2c\xf3\xff\x14\x1d\x9c\xca\x7f\xb1\x2c\x9e\x74"
- "\xfc\xdb\x4b\x00\xdc\x36\x81\x09\x14\x14\x97\x7f\xa6\xd3\x5e\x7c\xc0\xee"
- "\x1a\xdd\xc0\x12\xc2\xb4\xb1\xe9\x7d\x14\x7e\x24\x99\x14\x4b\x03\xcb\x91"
- "\xc9\x2b\x74\x32\x93\x64\xe5\xab\x1d\xd2\x51\xcb\x87\xcf\x3f\x6f\x47\x6e"
- "\xfa\xf6\x5e\x63\xd9\xb1\x80\xed\xf6\x05\x00\x60\xad\x1b\x7d\xd6\x5a\xa6"
- "\x7a\xf8\x61\x69\x34\xac\x0d\x87\xd7\x7f\xbe\xa0\x9d\x7e\x89\x15\xcb\x25"
- "\xe3\x3d\xf2\x7b\xb7\x34\x9f\xad\xe2\xce\x14\x9f\x28\x83\xfb\x20\xb1\xea"
- "\xe0\xaa\xce\x7a\xb7\x45\x6b\x48\xb3\xe4\xbd\x81\x65\x5e\x78\x73\xa9\x66"
- "\x55\xcb\x93\x9d\xb7\x4f\x33\xa1\xd5\xe2\x51\x7d\xaf\xd6\x32\x22\xfd\x0d"
- "\x18\x5b\x79\xa5\xb7\x05\x27\xf4\x9e\xed\xa1\x44\xd3\x28\x93\x01\x2e\xc2"
- "\xb4\x99\xc3\x11\x89\xdd\x07\x98\x66",
- 189);
- *(uint16_t*)0x20000bbd = r[3];
- memcpy((void*)0x20000bbf,
- "\x02\x00\x26\xbd\x70\x00\xfe\xdb\xdf\x25\x00\x00\x00\x00\x08\x00\x01"
- "\x00",
- 18);
- *(uint32_t*)0x20000bd1 = r[4];
- memcpy((void*)0x20000bd5,
- "\xfc\x00\x02\x80\x3c\x00\x01\x00\x24\x00\x01\x00\x65\x6e\x61\x62\x6c"
- "\x65\x64\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
- "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x05\x00\x03\x00\x06\x00\x00"
- "\x00\x04\x00\x04\x00\x08\x00\x06\x00",
- 60);
- *(uint32_t*)0x20000c11 = r[5];
- memcpy((void*)0x20000c15,
- "\x40\x00\x01\x00\x24\x00\x01\x00\x70\x72\x69\x6f\x72\x69\x74\x79\x00"
- "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
- "\x00\x00\x00\x00\x00\x00\x05\x00\x03\x00\x0e\x00\x00\x00\x08\x00\x04"
- "\x00\x37\x0a\x00\x00\x08\x00\x06\x00",
- 60);
- *(uint32_t*)0x20000c51 = r[6];
- memcpy((void*)0x20000c55,
- "\x3c\x00\x01\x00\x24\x00\x01\x00\x65\x6e\x61\x62\x6c\x65\x64\x00\x00"
- "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
- "\x00\x00\x00\x00\x00\x00\x05\x00\x03\x00\x06\x00\x00\x00\x04\x00\x04"
- "\x00\x08\x00\x06\x00",
- 56);
- *(uint32_t*)0x20000c8d = -1;
- memcpy((void*)0x20000c91,
- "\x40\x00\x01\x00\x24\x00\x01\x00\x71\x75\x65\x75\x65\x5f\x69\x64\x00"
- "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
- "\x00\x00\x00\x00\x00\x00\x05\x00\x03\x00\x03\x00\x00\x00\x08\x00\x04"
- "\x00\x20\x00\x00\x00\x08\x00\x06\x00",
- 60);
- *(uint32_t*)0x20000ccd = 0;
- memcpy((void*)0x20000cd1, "\x08\x00\x01\x00", 4);
- *(uint32_t*)0x20000cd5 = r[7];
- memcpy((void*)0x20000cd9,
- "\x74\x00\x02\x80\x38\x00\x01\x00\x24\x00\x01\x00\x6e\x6f\x74\x69\x66"
- "\x79\x5f\x70\x65\x65\x72\x73\x5f\x69\x6e\x74\x65\x72\x76\x61\x6c\x00"
- "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x05\x00\x03\x00\x03\x00\x00"
- "\x00\x08\x00\x04\x00\x00\x02\x00\x00\x38\x00\x01\x00\x24\x00\x01\x00"
- "\x6c\x62\x5f\x73\x74\x61\x74\x73\x5f\x72\x65\x66\x72\x65\x73\x68\x5f"
- "\x69\x6e\x74\x65\x72\x76\x61\x6c\x00\x00\x00\x00\x00\x00\x00\x05\x00"
- "\x03\x00\x03\x00\x00\x00\x08\x00\x04\x00\x02\x00\x00\x00",
- 116);
- *(uint64_t*)0x20000a88 = 0x194;
- *(uint64_t*)0x20000ad8 = 1;
- *(uint64_t*)0x20000ae0 = 0;
- *(uint64_t*)0x20000ae8 = 0;
- *(uint32_t*)0x20000af0 = 0x8000;
- syscall(__NR_sendmsg, /*fd=*/r[2], /*msg=*/0x20000ac0ul,
- /*f=MSG_FASTOPEN|MSG_MORE|MSG_EOR|MSG_CONFIRM*/ 0x20008880ul);
- memcpy((void*)0x20000540, "tunl0\000\000\000\000\000\000\000\000\000\000\000",
- 16);
- *(uint64_t*)0x20000550 = 0x20000480;
- memcpy((void*)0x20000480, "erspan0\000\000\000\000\000\000\000\000\000", 16);
- *(uint32_t*)0x20000490 = 0;
- *(uint16_t*)0x20000494 = htobe16(0x40);
- *(uint16_t*)0x20000496 = htobe16(0x10);
- *(uint32_t*)0x20000498 = htobe32(0xa4);
- *(uint32_t*)0x2000049c = htobe32(7);
- STORE_BY_BITMASK(uint8_t, , 0x200004a0, 0x1e, 0, 4);
- STORE_BY_BITMASK(uint8_t, , 0x200004a0, 4, 4, 4);
- STORE_BY_BITMASK(uint8_t, , 0x200004a1, 2, 0, 2);
- STORE_BY_BITMASK(uint8_t, , 0x200004a1, 9, 2, 6);
- *(uint16_t*)0x200004a2 = htobe16(0x78);
- *(uint16_t*)0x200004a4 = htobe16(0x66);
- *(uint16_t*)0x200004a6 = htobe16(0);
- *(uint8_t*)0x200004a8 = 1;
- *(uint8_t*)0x200004a9 = 4;
- *(uint16_t*)0x200004aa = htobe16(0);
- *(uint32_t*)0x200004ac = htobe32(0x64010102);
- *(uint32_t*)0x200004b0 = htobe32(0xe0000002);
- *(uint8_t*)0x200004b4 = 0x89;
- *(uint8_t*)0x200004b5 = 0xf;
- *(uint8_t*)0x200004b6 = 0xa6;
- *(uint8_t*)0x200004b7 = 0xac;
- *(uint8_t*)0x200004b8 = 0x14;
- *(uint8_t*)0x200004b9 = 0x14;
- *(uint8_t*)0x200004ba = 0xbb;
- *(uint32_t*)0x200004bb = htobe32(0);
- *(uint8_t*)0x200004bf = 0xac;
- *(uint8_t*)0x200004c0 = 0x1e;
- *(uint8_t*)0x200004c1 = 1;
- *(uint8_t*)0x200004c2 = 1;
- *(uint8_t*)0x200004c3 = 0x44;
- *(uint8_t*)0x200004c4 = 0xc;
- *(uint8_t*)0x200004c5 = 0x83;
- STORE_BY_BITMASK(uint8_t, , 0x200004c6, 0, 0, 4);
- STORE_BY_BITMASK(uint8_t, , 0x200004c6, 0xe, 4, 4);
- *(uint32_t*)0x200004c7 = htobe32(0x8001);
- *(uint32_t*)0x200004cb = htobe32(0);
- *(uint8_t*)0x200004cf = 0x44;
- *(uint8_t*)0x200004d0 = 0x14;
- *(uint8_t*)0x200004d1 = 0xc5;
- STORE_BY_BITMASK(uint8_t, , 0x200004d2, 1, 0, 4);
- STORE_BY_BITMASK(uint8_t, , 0x200004d2, 8, 4, 4);
- *(uint8_t*)0x200004d3 = 0xac;
- *(uint8_t*)0x200004d4 = 0x14;
- *(uint8_t*)0x200004d5 = 0x14;
- *(uint8_t*)0x200004d6 = 0xaa;
- *(uint32_t*)0x200004d7 = htobe32(0x1ff);
- *(uint32_t*)0x200004db = htobe32(0x7f000001);
- *(uint32_t*)0x200004df = htobe32(7);
- *(uint8_t*)0x200004e3 = 0x44;
- *(uint8_t*)0x200004e4 = 0xc;
- *(uint8_t*)0x200004e5 = 0x84;
- STORE_BY_BITMASK(uint8_t, , 0x200004e6, 0, 0, 4);
- STORE_BY_BITMASK(uint8_t, , 0x200004e6, 0, 4, 4);
- *(uint32_t*)0x200004e7 = htobe32(2);
- *(uint32_t*)0x200004eb = htobe32(0x100);
- *(uint8_t*)0x200004ef = 0x44;
- *(uint8_t*)0x200004f0 = 0xc;
- *(uint8_t*)0x200004f1 = 0x91;
- STORE_BY_BITMASK(uint8_t, , 0x200004f2, 1, 0, 4);
- STORE_BY_BITMASK(uint8_t, , 0x200004f2, 0xb, 4, 4);
- *(uint8_t*)0x200004f3 = 0xac;
- *(uint8_t*)0x200004f4 = 0x14;
- *(uint8_t*)0x200004f5 = 0x14;
- *(uint8_t*)0x200004f6 = 0x30;
- *(uint32_t*)0x200004f7 = htobe32(7);
- *(uint8_t*)0x200004fb = 0x44;
- *(uint8_t*)0x200004fc = 0x1c;
- *(uint8_t*)0x200004fd = 0x19;
- STORE_BY_BITMASK(uint8_t, , 0x200004fe, 3, 0, 4);
- STORE_BY_BITMASK(uint8_t, , 0x200004fe, 5, 4, 4);
- *(uint8_t*)0x200004ff = 0xac;
- *(uint8_t*)0x20000500 = 0x1e;
- *(uint8_t*)0x20000501 = 1;
- *(uint8_t*)0x20000502 = 1;
- *(uint32_t*)0x20000503 = htobe32(0x401);
- *(uint32_t*)0x20000507 = htobe32(0xe0000001);
- *(uint32_t*)0x2000050b = htobe32(0x1f);
- *(uint32_t*)0x2000050f = htobe32(-1);
- *(uint32_t*)0x20000513 = htobe32(0x81);
- struct csum_inet csum_2;
- csum_inet_init(&csum_2);
- csum_inet_update(&csum_2, (const uint8_t*)0x200004a0, 120);
- *(uint16_t*)0x200004aa = csum_inet_digest(&csum_2);
- syscall(__NR_ioctl, /*fd=*/-1, /*cmd=*/0x89f3, /*arg=*/0x20000540ul);
- memcpy((void*)0x20000600, "erspan0\000\000\000\000\000\000\000\000\000", 16);
- *(uint64_t*)0x20000610 = 0x20000580;
- memcpy((void*)0x20000580, "erspan0\000\000\000\000\000\000\000\000\000", 16);
- *(uint32_t*)0x20000590 = 0;
- *(uint16_t*)0x20000594 = htobe16(0x8091);
- *(uint16_t*)0x20000596 = htobe16(0x7800);
- *(uint32_t*)0x20000598 = htobe32(5);
- *(uint32_t*)0x2000059c = htobe32(5);
- STORE_BY_BITMASK(uint8_t, , 0x200005a0, 0xa, 0, 4);
- STORE_BY_BITMASK(uint8_t, , 0x200005a0, 4, 4, 4);
- STORE_BY_BITMASK(uint8_t, , 0x200005a1, 1, 0, 2);
- STORE_BY_BITMASK(uint8_t, , 0x200005a1, 0xb, 2, 6);
- *(uint16_t*)0x200005a2 = htobe16(0x28);
- *(uint16_t*)0x200005a4 = htobe16(0x64);
- *(uint16_t*)0x200005a6 = htobe16(0);
- *(uint8_t*)0x200005a8 = 8;
- *(uint8_t*)0x200005a9 = 0x29;
- *(uint16_t*)0x200005aa = htobe16(0);
- *(uint8_t*)0x200005ac = 0xac;
- *(uint8_t*)0x200005ad = 0x14;
- *(uint8_t*)0x200005ae = 0x14;
- *(uint8_t*)0x200005af = 0xaa;
- *(uint8_t*)0x200005b0 = 0xac;
- *(uint8_t*)0x200005b1 = 0x14;
- *(uint8_t*)0x200005b2 = 0x14;
- *(uint8_t*)0x200005b3 = 0xaa;
- *(uint8_t*)0x200005b4 = 0x44;
- *(uint8_t*)0x200005b5 = 0x14;
- *(uint8_t*)0x200005b6 = 0x93;
- STORE_BY_BITMASK(uint8_t, , 0x200005b7, 0, 0, 4);
- STORE_BY_BITMASK(uint8_t, , 0x200005b7, 6, 4, 4);
- *(uint32_t*)0x200005b8 = htobe32(0x10000);
- *(uint32_t*)0x200005bc = htobe32(0xfea);
- *(uint32_t*)0x200005c0 = htobe32(0x10001);
- *(uint32_t*)0x200005c4 = htobe32(9);
- struct csum_inet csum_3;
- csum_inet_init(&csum_3);
- csum_inet_update(&csum_3, (const uint8_t*)0x200005a0, 40);
- *(uint16_t*)0x200005aa = csum_inet_digest(&csum_3);
- syscall(__NR_ioctl, /*fd=*/-1, /*cmd=*/0x89f0, /*arg=*/0x20000600ul);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment