Syzkaller hit 'memory leak in netlbl_cipsov4_add - Fixed in v5.10.46' bug. executing program executing program BUG: memory leak unreferenced object 0xffff8880090cba00 (size 64): comm "syz-executor200", pid 385, jiffies 4294806256 (age 20.175s) hex dump (first 32 bytes): 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ backtrace: [<000000004d97b3fc>] kmalloc include/linux/slab.h:552 [inline] [<000000004d97b3fc>] kzalloc include/linux/slab.h:664 [inline] [<000000004d97b3fc>] netlbl_cipsov4_add_std net/netlabel/netlabel_cipso_v4.c:145 [inline] [<000000004d97b3fc>] netlbl_cipsov4_add+0x3ab/0x23e0 net/netlabel/netlabel_cipso_v4.c:416 [<00000000ee7b4348>] genl_family_rcv_msg_doit+0x22d/0x330 net/netlink/genetlink.c:739 [<00000000838a0795>] genl_family_rcv_msg net/netlink/genetlink.c:783 [inline] [<00000000838a0795>] genl_rcv_msg+0x33c/0x5a0 net/netlink/genetlink.c:800 [<00000000661b08cb>] netlink_rcv_skb+0x14b/0x430 net/netlink/af_netlink.c:2494 [<000000000af0f7af>] genl_rcv+0x24/0x40 net/netlink/genetlink.c:811 [<00000000328787c6>] netlink_unicast_kernel net/netlink/af_netlink.c:1304 [inline] [<00000000328787c6>] netlink_unicast+0x53a/0x7e0 net/netlink/af_netlink.c:1330 [<00000000a8af4ed9>] netlink_sendmsg+0x860/0xda0 net/netlink/af_netlink.c:1919 [<000000006a5b56de>] sock_sendmsg_nosec net/socket.c:651 [inline] [<000000006a5b56de>] sock_sendmsg+0x150/0x190 net/socket.c:671 [<0000000090daaf0a>] ____sys_sendmsg+0x709/0x870 net/socket.c:2353 [<00000000d52b95c4>] ___sys_sendmsg+0xf3/0x170 net/socket.c:2407 [<00000000153a9865>] __sys_sendmsg+0xe5/0x1b0 net/socket.c:2440 [<00000000ccf70f5e>] do_syscall_64+0x33/0x40 arch/x86/entry/common.c:46 [<000000001c5c19d4>] entry_SYSCALL_64_after_hwframe+0x44/0xa9 BUG: memory leak unreferenced object 0xffff8880090cb900 (size 64): comm "syz-executor200", pid 386, jiffies 4294814525 (age 11.906s) hex dump (first 32 bytes): 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ backtrace: [<000000004d97b3fc>] kmalloc include/linux/slab.h:552 [inline] [<000000004d97b3fc>] kzalloc include/linux/slab.h:664 [inline] [<000000004d97b3fc>] netlbl_cipsov4_add_std net/netlabel/netlabel_cipso_v4.c:145 [inline] [<000000004d97b3fc>] netlbl_cipsov4_add+0x3ab/0x23e0 net/netlabel/netlabel_cipso_v4.c:416 [<00000000ee7b4348>] genl_family_rcv_msg_doit+0x22d/0x330 net/netlink/genetlink.c:739 [<00000000838a0795>] genl_family_rcv_msg net/netlink/genetlink.c:783 [inline] [<00000000838a0795>] genl_rcv_msg+0x33c/0x5a0 net/netlink/genetlink.c:800 [<00000000661b08cb>] netlink_rcv_skb+0x14b/0x430 net/netlink/af_netlink.c:2494 [<000000000af0f7af>] genl_rcv+0x24/0x40 net/netlink/genetlink.c:811 [<00000000328787c6>] netlink_unicast_kernel net/netlink/af_netlink.c:1304 [inline] [<00000000328787c6>] netlink_unicast+0x53a/0x7e0 net/netlink/af_netlink.c:1330 [<00000000a8af4ed9>] netlink_sendmsg+0x860/0xda0 net/netlink/af_netlink.c:1919 [<000000006a5b56de>] sock_sendmsg_nosec net/socket.c:651 [inline] [<000000006a5b56de>] sock_sendmsg+0x150/0x190 net/socket.c:671 [<0000000090daaf0a>] ____sys_sendmsg+0x709/0x870 net/socket.c:2353 [<00000000d52b95c4>] ___sys_sendmsg+0xf3/0x170 net/socket.c:2407 [<00000000153a9865>] __sys_sendmsg+0xe5/0x1b0 net/socket.c:2440 [<00000000ccf70f5e>] do_syscall_64+0x33/0x40 arch/x86/entry/common.c:46 [<000000001c5c19d4>] entry_SYSCALL_64_after_hwframe+0x44/0xa9 Syzkaller reproducer: # {Threaded:false Collide:false Repeat:true RepeatTimes:0 Procs:1 Slowdown:1 Sandbox: Fault:false FaultCall:-1 FaultNth:0 Leak:true NetInjection:false NetDevices:false NetReset:false Cgroups:false BinfmtMisc:false CloseFDs:false KCSAN:false DevlinkPCI:false USB:false VhciInjection:false Wifi:false IEEE802154:false Sysctl:false UseTmpDir:false HandleSegv:false Repro:false Trace:false} r0 = syz_init_net_socket$nl_generic(0x10, 0x3, 0x10) r1 = syz_genetlink_get_family_id$netlbl_cipso(&(0x7f0000000000), r0) r2 = syz_init_net_socket$nl_generic(0x10, 0x3, 0x10) sendmsg$NLBL_CIPSOV4_C_ADD(r2, &(0x7f0000000280)={0x0, 0x0, &(0x7f0000000200)={&(0x7f0000000680)={0x234, r1, 0xdbb7de3ade089125, 0x70bd2c, 0x25dfdbfd, {}, [@NLBL_CIPSOV4_A_MLSCATLST={0x110, 0xc, 0x0, 0x1, [{0xc, 0xb, 0x0, 0x1, [@NLBL_CIPSOV4_A_MLSCATLOC={0x8, 0x9, 0x6ca7fb89}]}, {0x14, 0xb, 0x0, 0x1, [@NLBL_CIPSOV4_A_MLSCATLOC={0x8, 0x9, 0x72051c0f}, @NLBL_CIPSOV4_A_MLSCATLOC={0x8, 0x9, 0x1a4583a6}]}, {0xc, 0xb, 0x0, 0x1, [@NLBL_CIPSOV4_A_MLSCATLOC={0x8, 0x9, 0x60f635e2}]}, {0x3c, 0xb, 0x0, 0x1, [@NLBL_CIPSOV4_A_MLSCATLOC={0x8, 0x9, 0x3850476a}, @NLBL_CIPSOV4_A_MLSCATLOC={0x8, 0x9, 0x3c396fb1}, @NLBL_CIPSOV4_A_MLSCATREM={0x8, 0xa, 0xd7be}, @NLBL_CIPSOV4_A_MLSCATREM={0x8, 0xa, 0x874e}, @NLBL_CIPSOV4_A_MLSCATLOC={0x8, 0x9, 0x45491eb}, @NLBL_CIPSOV4_A_MLSCATLOC={0x8, 0x9, 0x51d8d6d3}, @NLBL_CIPSOV4_A_MLSCATLOC={0x8, 0x9, 0x85cc2b8}]}, {0x3c, 0xb, 0x0, 0x1, [@NLBL_CIPSOV4_A_MLSCATREM={0x8, 0xa, 0xdf0b}, @NLBL_CIPSOV4_A_MLSCATREM={0x8, 0xa, 0x7992}, @NLBL_CIPSOV4_A_MLSCATREM={0x8, 0xa, 0xe330}, @NLBL_CIPSOV4_A_MLSCATREM={0x8, 0xa, 0xb58}, @NLBL_CIPSOV4_A_MLSCATREM={0x8, 0xa, 0xd390}, @NLBL_CIPSOV4_A_MLSCATLOC={0x8, 0x9, 0x14af7628}, @NLBL_CIPSOV4_A_MLSCATLOC={0x8, 0x9, 0x3b47378d}]}, {0x24, 0xb, 0x0, 0x1, [@NLBL_CIPSOV4_A_MLSCATLOC={0x8, 0x9, 0x2f7ca9be}, @NLBL_CIPSOV4_A_MLSCATLOC={0x8, 0x9, 0x6487fc61}, @NLBL_CIPSOV4_A_MLSCATLOC={0x8, 0x9, 0x5a3fb21a}, @NLBL_CIPSOV4_A_MLSCATLOC={0x8, 0x9, 0x7af3f06b}]}, {0x44, 0xb, 0x0, 0x1, [@NLBL_CIPSOV4_A_MLSCATREM={0x8, 0xa, 0x531b}, @NLBL_CIPSOV4_A_MLSCATREM={0x8, 0xa, 0x48fe}, @NLBL_CIPSOV4_A_MLSCATREM={0x8, 0xa, 0x4a42}, @NLBL_CIPSOV4_A_MLSCATLOC={0x8, 0x9, 0x5bd4a3bf}, @NLBL_CIPSOV4_A_MLSCATREM={0x8, 0xa, 0xb88f}, @NLBL_CIPSOV4_A_MLSCATREM={0x8, 0xa, 0x2489}, @NLBL_CIPSOV4_A_MLSCATREM={0x8, 0xa, 0x7b65}, @NLBL_CIPSOV4_A_MLSCATLOC={0x8, 0x9, 0x2ac63b44}]}]}, @NLBL_CIPSOV4_A_TAGLST={0x34, 0x4, 0x0, 0x1, [{0x5}, {0x5, 0x3, 0x6}, {0x5, 0x3, 0x7}, {0x5, 0x3, 0x6}, {0x5, 0x3, 0x2}, {0x5, 0x3, 0x6}]}, @NLBL_CIPSOV4_A_DOI={0x8, 0x1, 0x1}, @NLBL_CIPSOV4_A_DOI={0x8}, @NLBL_CIPSOV4_A_MTYPE={0x8, 0x2, 0x1}, @NLBL_CIPSOV4_A_MLSLVLLST={0xc4, 0x8, 0x0, 0x1, [{0xc, 0x7, 0x0, 0x1, [@NLBL_CIPSOV4_A_MLSLVLREM={0x8, 0x6, 0x47}]}, {0x5c, 0x7, 0x0, 0x1, [@NLBL_CIPSOV4_A_MLSLVLLOC={0x8, 0x5, 0x55968de8}, @NLBL_CIPSOV4_A_MLSLVLLOC={0x8, 0x5, 0x7e825111}, @NLBL_CIPSOV4_A_MLSLVLREM={0x8, 0x6, 0xf4}, @NLBL_CIPSOV4_A_MLSLVLREM={0x8, 0x6, 0xb}, @NLBL_CIPSOV4_A_MLSLVLREM={0x8, 0x6, 0xe1}, @NLBL_CIPSOV4_A_MLSLVLREM={0x8, 0x6, 0x10}, @NLBL_CIPSOV4_A_MLSLVLLOC={0x8, 0x5, 0x6b5cf31b}, @NLBL_CIPSOV4_A_MLSLVLREM={0x8, 0x6, 0xaf}, @NLBL_CIPSOV4_A_MLSLVLLOC={0x8, 0x5, 0x19658c34}, @NLBL_CIPSOV4_A_MLSLVLLOC={0x8, 0x5, 0x64e9e55e}, @NLBL_CIPSOV4_A_MLSLVLLOC={0x8, 0x5, 0x3560f1a5}]}, {0x24, 0x7, 0x0, 0x1, [@NLBL_CIPSOV4_A_MLSLVLREM={0x8, 0x6, 0xeb}, @NLBL_CIPSOV4_A_MLSLVLREM={0x8, 0x6, 0x8}, @NLBL_CIPSOV4_A_MLSLVLREM={0x8, 0x6, 0x8}, @NLBL_CIPSOV4_A_MLSLVLREM={0x8, 0x6, 0xab}]}, {0x34, 0x7, 0x0, 0x1, [@NLBL_CIPSOV4_A_MLSLVLREM={0x8, 0x6, 0x40}, @NLBL_CIPSOV4_A_MLSLVLLOC={0x8, 0x5, 0x494da2d3}, @NLBL_CIPSOV4_A_MLSLVLLOC={0x8, 0x5, 0x5c6214ca}, @NLBL_CIPSOV4_A_MLSLVLREM={0x8, 0x6, 0xd3}, @NLBL_CIPSOV4_A_MLSLVLREM={0x8, 0x6, 0x2b}, @NLBL_CIPSOV4_A_MLSLVLLOC={0x8, 0x5, 0x7fa2bc72}]}]}]}, 0x234}, 0x1, 0x0, 0x0, 0x84}, 0x4844) C reproducer: // autogenerated by syzkaller (https://github.com/google/syzkaller) #define _GNU_SOURCE #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include static void sleep_ms(uint64_t ms) { usleep(ms * 1000); } static uint64_t current_time_ms(void) { struct timespec ts; if (clock_gettime(CLOCK_MONOTONIC, &ts)) exit(1); return (uint64_t)ts.tv_sec * 1000 + (uint64_t)ts.tv_nsec / 1000000; } #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)))) static bool write_file(const char* file, const char* what, ...) { char buf[1024]; va_list args; va_start(args, what); vsnprintf(buf, sizeof(buf), what, args); va_end(args); buf[sizeof(buf) - 1] = 0; int len = strlen(buf); int fd = open(file, O_WRONLY | O_CLOEXEC); if (fd == -1) return false; if (write(fd, buf, len) != len) { int err = errno; close(fd); errno = err; return false; } close(fd); return true; } 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; } const int kInitNetNsFd = 239; static long syz_init_net_socket(volatile long domain, volatile long type, volatile long proto) { return syscall(__NR_socket, domain, type, proto); } static long syz_genetlink_get_family_id(volatile long name, volatile long sock_arg) { bool dofail = false; int fd = sock_arg; if (fd < 0) { dofail = true; 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, dofail); if ((int)sock_arg < 0) close(fd); if (ret < 0) { return -1; } return ret; } static void kill_and_wait(int pid, int* status) { kill(-pid, SIGKILL); kill(pid, SIGKILL); for (int i = 0; i < 100; i++) { if (waitpid(-1, status, WNOHANG | __WALL) == pid) return; usleep(1000); } DIR* dir = opendir("/sys/fs/fuse/connections"); if (dir) { for (;;) { struct dirent* ent = readdir(dir); if (!ent) break; if (strcmp(ent->d_name, ".") == 0 || strcmp(ent->d_name, "..") == 0) continue; char abort[300]; snprintf(abort, sizeof(abort), "/sys/fs/fuse/connections/%s/abort", ent->d_name); int fd = open(abort, O_WRONLY); if (fd == -1) { continue; } if (write(fd, abort, 1) < 0) { } close(fd); } closedir(dir); } else { } while (waitpid(-1, status, __WALL) != pid) { } } static void setup_test() { prctl(PR_SET_PDEATHSIG, SIGKILL, 0, 0, 0); setpgrp(); write_file("/proc/self/oom_score_adj", "1000"); } #define KMEMLEAK_FILE "/sys/kernel/debug/kmemleak" static void setup_leak() { if (!write_file(KMEMLEAK_FILE, "scan")) exit(1); sleep(5); if (!write_file(KMEMLEAK_FILE, "scan")) exit(1); if (!write_file(KMEMLEAK_FILE, "clear")) exit(1); } static void check_leaks(void) { int fd = open(KMEMLEAK_FILE, O_RDWR); if (fd == -1) exit(1); uint64_t start = current_time_ms(); if (write(fd, "scan", 4) != 4) exit(1); sleep(1); while (current_time_ms() - start < 4 * 1000) sleep(1); if (write(fd, "scan", 4) != 4) exit(1); static char buf[128 << 10]; ssize_t n = read(fd, buf, sizeof(buf) - 1); if (n < 0) exit(1); int nleaks = 0; if (n != 0) { sleep(1); if (write(fd, "scan", 4) != 4) exit(1); if (lseek(fd, 0, SEEK_SET) < 0) exit(1); n = read(fd, buf, sizeof(buf) - 1); if (n < 0) exit(1); buf[n] = 0; char* pos = buf; char* end = buf + n; while (pos < end) { char* next = strstr(pos + 1, "unreferenced object"); if (!next) next = end; char prev = *next; *next = 0; fprintf(stderr, "BUG: memory leak\n%s\n", pos); *next = prev; pos = next; nleaks++; } } if (write(fd, "clear", 5) != 5) exit(1); close(fd); if (nleaks) exit(1); } static void execute_one(void); #define WAIT_FLAGS __WALL static void loop(void) { int iter = 0; for (;; iter++) { int pid = fork(); if (pid < 0) exit(1); if (pid == 0) { setup_test(); execute_one(); exit(0); } int status = 0; uint64_t start = current_time_ms(); for (;;) { if (waitpid(-1, &status, WNOHANG | WAIT_FLAGS) == pid) break; sleep_ms(1); if (current_time_ms() - start < 5000) { continue; } kill_and_wait(pid, &status); break; } check_leaks(); } } uint64_t r[3] = {0xffffffffffffffff, 0x0, 0xffffffffffffffff}; void execute_one(void) { intptr_t res = 0; res = -1; res = syz_init_net_socket(0x10, 3, 0x10); if (res != -1) r[0] = res; memcpy((void*)0x20000000, "NLBL_CIPSOv4\000", 13); res = -1; res = syz_genetlink_get_family_id(0x20000000, r[0]); if (res != -1) r[1] = res; res = -1; res = syz_init_net_socket(0x10, 3, 0x10); if (res != -1) r[2] = res; *(uint64_t*)0x20000280 = 0; *(uint32_t*)0x20000288 = 0; *(uint64_t*)0x20000290 = 0x20000200; *(uint64_t*)0x20000200 = 0x20000680; *(uint32_t*)0x20000680 = 0x234; *(uint16_t*)0x20000684 = r[1]; *(uint16_t*)0x20000686 = 0x9125; *(uint32_t*)0x20000688 = 0x70bd2c; *(uint32_t*)0x2000068c = 0x25dfdbfd; *(uint8_t*)0x20000690 = 1; *(uint8_t*)0x20000691 = 0; *(uint16_t*)0x20000692 = 0; *(uint16_t*)0x20000694 = 0x110; STORE_BY_BITMASK(uint16_t, , 0x20000696, 0xc, 0, 14); STORE_BY_BITMASK(uint16_t, , 0x20000697, 0, 6, 1); STORE_BY_BITMASK(uint16_t, , 0x20000697, 1, 7, 1); *(uint16_t*)0x20000698 = 0xc; STORE_BY_BITMASK(uint16_t, , 0x2000069a, 0xb, 0, 14); STORE_BY_BITMASK(uint16_t, , 0x2000069b, 0, 6, 1); STORE_BY_BITMASK(uint16_t, , 0x2000069b, 1, 7, 1); *(uint16_t*)0x2000069c = 8; *(uint16_t*)0x2000069e = 9; *(uint32_t*)0x200006a0 = 0x6ca7fb89; *(uint16_t*)0x200006a4 = 0x14; STORE_BY_BITMASK(uint16_t, , 0x200006a6, 0xb, 0, 14); STORE_BY_BITMASK(uint16_t, , 0x200006a7, 0, 6, 1); STORE_BY_BITMASK(uint16_t, , 0x200006a7, 1, 7, 1); *(uint16_t*)0x200006a8 = 8; *(uint16_t*)0x200006aa = 9; *(uint32_t*)0x200006ac = 0x72051c0f; *(uint16_t*)0x200006b0 = 8; *(uint16_t*)0x200006b2 = 9; *(uint32_t*)0x200006b4 = 0x1a4583a6; *(uint16_t*)0x200006b8 = 0xc; STORE_BY_BITMASK(uint16_t, , 0x200006ba, 0xb, 0, 14); STORE_BY_BITMASK(uint16_t, , 0x200006bb, 0, 6, 1); STORE_BY_BITMASK(uint16_t, , 0x200006bb, 1, 7, 1); *(uint16_t*)0x200006bc = 8; *(uint16_t*)0x200006be = 9; *(uint32_t*)0x200006c0 = 0x60f635e2; *(uint16_t*)0x200006c4 = 0x3c; STORE_BY_BITMASK(uint16_t, , 0x200006c6, 0xb, 0, 14); STORE_BY_BITMASK(uint16_t, , 0x200006c7, 0, 6, 1); STORE_BY_BITMASK(uint16_t, , 0x200006c7, 1, 7, 1); *(uint16_t*)0x200006c8 = 8; *(uint16_t*)0x200006ca = 9; *(uint32_t*)0x200006cc = 0x3850476a; *(uint16_t*)0x200006d0 = 8; *(uint16_t*)0x200006d2 = 9; *(uint32_t*)0x200006d4 = 0x3c396fb1; *(uint16_t*)0x200006d8 = 8; *(uint16_t*)0x200006da = 0xa; *(uint32_t*)0x200006dc = 0xd7be; *(uint16_t*)0x200006e0 = 8; *(uint16_t*)0x200006e2 = 0xa; *(uint32_t*)0x200006e4 = 0x874e; *(uint16_t*)0x200006e8 = 8; *(uint16_t*)0x200006ea = 9; *(uint32_t*)0x200006ec = 0x45491eb; *(uint16_t*)0x200006f0 = 8; *(uint16_t*)0x200006f2 = 9; *(uint32_t*)0x200006f4 = 0x51d8d6d3; *(uint16_t*)0x200006f8 = 8; *(uint16_t*)0x200006fa = 9; *(uint32_t*)0x200006fc = 0x85cc2b8; *(uint16_t*)0x20000700 = 0x3c; STORE_BY_BITMASK(uint16_t, , 0x20000702, 0xb, 0, 14); STORE_BY_BITMASK(uint16_t, , 0x20000703, 0, 6, 1); STORE_BY_BITMASK(uint16_t, , 0x20000703, 1, 7, 1); *(uint16_t*)0x20000704 = 8; *(uint16_t*)0x20000706 = 0xa; *(uint32_t*)0x20000708 = 0xdf0b; *(uint16_t*)0x2000070c = 8; *(uint16_t*)0x2000070e = 0xa; *(uint32_t*)0x20000710 = 0x7992; *(uint16_t*)0x20000714 = 8; *(uint16_t*)0x20000716 = 0xa; *(uint32_t*)0x20000718 = 0xe330; *(uint16_t*)0x2000071c = 8; *(uint16_t*)0x2000071e = 0xa; *(uint32_t*)0x20000720 = 0xb58; *(uint16_t*)0x20000724 = 8; *(uint16_t*)0x20000726 = 0xa; *(uint32_t*)0x20000728 = 0xd390; *(uint16_t*)0x2000072c = 8; *(uint16_t*)0x2000072e = 9; *(uint32_t*)0x20000730 = 0x14af7628; *(uint16_t*)0x20000734 = 8; *(uint16_t*)0x20000736 = 9; *(uint32_t*)0x20000738 = 0x3b47378d; *(uint16_t*)0x2000073c = 0x24; STORE_BY_BITMASK(uint16_t, , 0x2000073e, 0xb, 0, 14); STORE_BY_BITMASK(uint16_t, , 0x2000073f, 0, 6, 1); STORE_BY_BITMASK(uint16_t, , 0x2000073f, 1, 7, 1); *(uint16_t*)0x20000740 = 8; *(uint16_t*)0x20000742 = 9; *(uint32_t*)0x20000744 = 0x2f7ca9be; *(uint16_t*)0x20000748 = 8; *(uint16_t*)0x2000074a = 9; *(uint32_t*)0x2000074c = 0x6487fc61; *(uint16_t*)0x20000750 = 8; *(uint16_t*)0x20000752 = 9; *(uint32_t*)0x20000754 = 0x5a3fb21a; *(uint16_t*)0x20000758 = 8; *(uint16_t*)0x2000075a = 9; *(uint32_t*)0x2000075c = 0x7af3f06b; *(uint16_t*)0x20000760 = 0x44; STORE_BY_BITMASK(uint16_t, , 0x20000762, 0xb, 0, 14); STORE_BY_BITMASK(uint16_t, , 0x20000763, 0, 6, 1); STORE_BY_BITMASK(uint16_t, , 0x20000763, 1, 7, 1); *(uint16_t*)0x20000764 = 8; *(uint16_t*)0x20000766 = 0xa; *(uint32_t*)0x20000768 = 0x531b; *(uint16_t*)0x2000076c = 8; *(uint16_t*)0x2000076e = 0xa; *(uint32_t*)0x20000770 = 0x48fe; *(uint16_t*)0x20000774 = 8; *(uint16_t*)0x20000776 = 0xa; *(uint32_t*)0x20000778 = 0x4a42; *(uint16_t*)0x2000077c = 8; *(uint16_t*)0x2000077e = 9; *(uint32_t*)0x20000780 = 0x5bd4a3bf; *(uint16_t*)0x20000784 = 8; *(uint16_t*)0x20000786 = 0xa; *(uint32_t*)0x20000788 = 0xb88f; *(uint16_t*)0x2000078c = 8; *(uint16_t*)0x2000078e = 0xa; *(uint32_t*)0x20000790 = 0x2489; *(uint16_t*)0x20000794 = 8; *(uint16_t*)0x20000796 = 0xa; *(uint32_t*)0x20000798 = 0x7b65; *(uint16_t*)0x2000079c = 8; *(uint16_t*)0x2000079e = 9; *(uint32_t*)0x200007a0 = 0x2ac63b44; *(uint16_t*)0x200007a4 = 0x34; STORE_BY_BITMASK(uint16_t, , 0x200007a6, 4, 0, 14); STORE_BY_BITMASK(uint16_t, , 0x200007a7, 0, 6, 1); STORE_BY_BITMASK(uint16_t, , 0x200007a7, 1, 7, 1); *(uint16_t*)0x200007a8 = 5; *(uint16_t*)0x200007aa = 3; *(uint8_t*)0x200007ac = 0; *(uint16_t*)0x200007b0 = 5; *(uint16_t*)0x200007b2 = 3; *(uint8_t*)0x200007b4 = 6; *(uint16_t*)0x200007b8 = 5; *(uint16_t*)0x200007ba = 3; *(uint8_t*)0x200007bc = 7; *(uint16_t*)0x200007c0 = 5; *(uint16_t*)0x200007c2 = 3; *(uint8_t*)0x200007c4 = 6; *(uint16_t*)0x200007c8 = 5; *(uint16_t*)0x200007ca = 3; *(uint8_t*)0x200007cc = 2; *(uint16_t*)0x200007d0 = 5; *(uint16_t*)0x200007d2 = 3; *(uint8_t*)0x200007d4 = 6; *(uint16_t*)0x200007d8 = 8; *(uint16_t*)0x200007da = 1; *(uint32_t*)0x200007dc = 1; *(uint16_t*)0x200007e0 = 8; *(uint16_t*)0x200007e2 = 1; *(uint32_t*)0x200007e4 = 0; *(uint16_t*)0x200007e8 = 8; *(uint16_t*)0x200007ea = 2; *(uint32_t*)0x200007ec = 1; *(uint16_t*)0x200007f0 = 0xc4; STORE_BY_BITMASK(uint16_t, , 0x200007f2, 8, 0, 14); STORE_BY_BITMASK(uint16_t, , 0x200007f3, 0, 6, 1); STORE_BY_BITMASK(uint16_t, , 0x200007f3, 1, 7, 1); *(uint16_t*)0x200007f4 = 0xc; STORE_BY_BITMASK(uint16_t, , 0x200007f6, 7, 0, 14); STORE_BY_BITMASK(uint16_t, , 0x200007f7, 0, 6, 1); STORE_BY_BITMASK(uint16_t, , 0x200007f7, 1, 7, 1); *(uint16_t*)0x200007f8 = 8; *(uint16_t*)0x200007fa = 6; *(uint32_t*)0x200007fc = 0x47; *(uint16_t*)0x20000800 = 0x5c; STORE_BY_BITMASK(uint16_t, , 0x20000802, 7, 0, 14); STORE_BY_BITMASK(uint16_t, , 0x20000803, 0, 6, 1); STORE_BY_BITMASK(uint16_t, , 0x20000803, 1, 7, 1); *(uint16_t*)0x20000804 = 8; *(uint16_t*)0x20000806 = 5; *(uint32_t*)0x20000808 = 0x55968de8; *(uint16_t*)0x2000080c = 8; *(uint16_t*)0x2000080e = 5; *(uint32_t*)0x20000810 = 0x7e825111; *(uint16_t*)0x20000814 = 8; *(uint16_t*)0x20000816 = 6; *(uint32_t*)0x20000818 = 0xf4; *(uint16_t*)0x2000081c = 8; *(uint16_t*)0x2000081e = 6; *(uint32_t*)0x20000820 = 0xb; *(uint16_t*)0x20000824 = 8; *(uint16_t*)0x20000826 = 6; *(uint32_t*)0x20000828 = 0xe1; *(uint16_t*)0x2000082c = 8; *(uint16_t*)0x2000082e = 6; *(uint32_t*)0x20000830 = 0x10; *(uint16_t*)0x20000834 = 8; *(uint16_t*)0x20000836 = 5; *(uint32_t*)0x20000838 = 0x6b5cf31b; *(uint16_t*)0x2000083c = 8; *(uint16_t*)0x2000083e = 6; *(uint32_t*)0x20000840 = 0xaf; *(uint16_t*)0x20000844 = 8; *(uint16_t*)0x20000846 = 5; *(uint32_t*)0x20000848 = 0x19658c34; *(uint16_t*)0x2000084c = 8; *(uint16_t*)0x2000084e = 5; *(uint32_t*)0x20000850 = 0x64e9e55e; *(uint16_t*)0x20000854 = 8; *(uint16_t*)0x20000856 = 5; *(uint32_t*)0x20000858 = 0x3560f1a5; *(uint16_t*)0x2000085c = 0x24; STORE_BY_BITMASK(uint16_t, , 0x2000085e, 7, 0, 14); STORE_BY_BITMASK(uint16_t, , 0x2000085f, 0, 6, 1); STORE_BY_BITMASK(uint16_t, , 0x2000085f, 1, 7, 1); *(uint16_t*)0x20000860 = 8; *(uint16_t*)0x20000862 = 6; *(uint32_t*)0x20000864 = 0xeb; *(uint16_t*)0x20000868 = 8; *(uint16_t*)0x2000086a = 6; *(uint32_t*)0x2000086c = 8; *(uint16_t*)0x20000870 = 8; *(uint16_t*)0x20000872 = 6; *(uint32_t*)0x20000874 = 8; *(uint16_t*)0x20000878 = 8; *(uint16_t*)0x2000087a = 6; *(uint32_t*)0x2000087c = 0xab; *(uint16_t*)0x20000880 = 0x34; STORE_BY_BITMASK(uint16_t, , 0x20000882, 7, 0, 14); STORE_BY_BITMASK(uint16_t, , 0x20000883, 0, 6, 1); STORE_BY_BITMASK(uint16_t, , 0x20000883, 1, 7, 1); *(uint16_t*)0x20000884 = 8; *(uint16_t*)0x20000886 = 6; *(uint32_t*)0x20000888 = 0x40; *(uint16_t*)0x2000088c = 8; *(uint16_t*)0x2000088e = 5; *(uint32_t*)0x20000890 = 0x494da2d3; *(uint16_t*)0x20000894 = 8; *(uint16_t*)0x20000896 = 5; *(uint32_t*)0x20000898 = 0x5c6214ca; *(uint16_t*)0x2000089c = 8; *(uint16_t*)0x2000089e = 6; *(uint32_t*)0x200008a0 = 0xd3; *(uint16_t*)0x200008a4 = 8; *(uint16_t*)0x200008a6 = 6; *(uint32_t*)0x200008a8 = 0x2b; *(uint16_t*)0x200008ac = 8; *(uint16_t*)0x200008ae = 5; *(uint32_t*)0x200008b0 = 0x7fa2bc72; *(uint64_t*)0x20000208 = 0x234; *(uint64_t*)0x20000298 = 1; *(uint64_t*)0x200002a0 = 0; *(uint64_t*)0x200002a8 = 0; *(uint32_t*)0x200002b0 = 0x84; syscall(__NR_sendmsg, r[2], 0x20000280ul, 0x4844ul); } int main(void) { syscall(__NR_mmap, 0x1ffff000ul, 0x1000ul, 0ul, 0x32ul, -1, 0ul); syscall(__NR_mmap, 0x20000000ul, 0x1000000ul, 7ul, 0x32ul, -1, 0ul); syscall(__NR_mmap, 0x21000000ul, 0x1000ul, 0ul, 0x32ul, -1, 0ul); setup_leak(); loop(); return 0; }