// https://syzkaller.appspot.com/bug?id=101b7e71f53b37caf00bf159bd293d6d6512242a // 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 #ifndef __NR_bpf #define __NR_bpf 321 #endif #ifndef __NR_memfd_create #define __NR_memfd_create 319 #endif static unsigned long long procid; 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; } 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; } //% This code is derived from puff.{c,h}, found in the zlib development. The //% original files come with the following copyright notice: //% Copyright (C) 2002-2013 Mark Adler, all rights reserved //% version 2.3, 21 Jan 2013 //% This software is provided 'as-is', without any express or implied //% warranty. In no event will the author be held liable for any damages //% arising from the use of this software. //% Permission is granted to anyone to use this software for any purpose, //% including commercial applications, and to alter it and redistribute it //% freely, subject to the following restrictions: //% 1. The origin of this software must not be misrepresented; you must not //% claim that you wrote the original software. If you use this software //% in a product, an acknowledgment in the product documentation would be //% appreciated but is not required. //% 2. Altered source versions must be plainly marked as such, and must not be //% misrepresented as being the original software. //% 3. This notice may not be removed or altered from any source distribution. //% Mark Adler madler@alumni.caltech.edu //% BEGIN CODE DERIVED FROM puff.{c,h} #define MAXBITS 15 #define MAXLCODES 286 #define MAXDCODES 30 #define MAXCODES (MAXLCODES + MAXDCODES) #define FIXLCODES 288 struct puff_state { unsigned char* out; unsigned long outlen; unsigned long outcnt; const unsigned char* in; unsigned long inlen; unsigned long incnt; int bitbuf; int bitcnt; jmp_buf env; }; static int puff_bits(struct puff_state* s, int need) { long val = s->bitbuf; while (s->bitcnt < need) { if (s->incnt == s->inlen) longjmp(s->env, 1); val |= (long)(s->in[s->incnt++]) << s->bitcnt; s->bitcnt += 8; } s->bitbuf = (int)(val >> need); s->bitcnt -= need; return (int)(val & ((1L << need) - 1)); } static int puff_stored(struct puff_state* s) { s->bitbuf = 0; s->bitcnt = 0; if (s->incnt + 4 > s->inlen) return 2; unsigned len = s->in[s->incnt++]; len |= s->in[s->incnt++] << 8; if (s->in[s->incnt++] != (~len & 0xff) || s->in[s->incnt++] != ((~len >> 8) & 0xff)) return -2; if (s->incnt + len > s->inlen) return 2; if (s->outcnt + len > s->outlen) return 1; for (; len--; s->outcnt++, s->incnt++) { if (s->in[s->incnt]) s->out[s->outcnt] = s->in[s->incnt]; } return 0; } struct puff_huffman { short* count; short* symbol; }; static int puff_decode(struct puff_state* s, const struct puff_huffman* h) { int first = 0; int index = 0; int bitbuf = s->bitbuf; int left = s->bitcnt; int code = first = index = 0; int len = 1; short* next = h->count + 1; while (1) { while (left--) { code |= bitbuf & 1; bitbuf >>= 1; int count = *next++; if (code - count < first) { s->bitbuf = bitbuf; s->bitcnt = (s->bitcnt - len) & 7; return h->symbol[index + (code - first)]; } index += count; first += count; first <<= 1; code <<= 1; len++; } left = (MAXBITS + 1) - len; if (left == 0) break; if (s->incnt == s->inlen) longjmp(s->env, 1); bitbuf = s->in[s->incnt++]; if (left > 8) left = 8; } return -10; } static int puff_construct(struct puff_huffman* h, const short* length, int n) { int len; for (len = 0; len <= MAXBITS; len++) h->count[len] = 0; int symbol; for (symbol = 0; symbol < n; symbol++) (h->count[length[symbol]])++; if (h->count[0] == n) return 0; int left = 1; for (len = 1; len <= MAXBITS; len++) { left <<= 1; left -= h->count[len]; if (left < 0) return left; } short offs[MAXBITS + 1]; offs[1] = 0; for (len = 1; len < MAXBITS; len++) offs[len + 1] = offs[len] + h->count[len]; for (symbol = 0; symbol < n; symbol++) if (length[symbol] != 0) h->symbol[offs[length[symbol]]++] = symbol; return left; } static int puff_codes(struct puff_state* s, const struct puff_huffman* lencode, const struct puff_huffman* distcode) { static const short lens[29] = {3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 15, 17, 19, 23, 27, 31, 35, 43, 51, 59, 67, 83, 99, 115, 131, 163, 195, 227, 258}; static const short lext[29] = {0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 0}; static const short dists[30] = { 1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49, 65, 97, 129, 193, 257, 385, 513, 769, 1025, 1537, 2049, 3073, 4097, 6145, 8193, 12289, 16385, 24577}; static const short dext[30] = {0, 0, 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13}; int symbol; do { symbol = puff_decode(s, lencode); if (symbol < 0) return symbol; if (symbol < 256) { if (s->outcnt == s->outlen) return 1; if (symbol) s->out[s->outcnt] = symbol; s->outcnt++; } else if (symbol > 256) { symbol -= 257; if (symbol >= 29) return -10; int len = lens[symbol] + puff_bits(s, lext[symbol]); symbol = puff_decode(s, distcode); if (symbol < 0) return symbol; unsigned dist = dists[symbol] + puff_bits(s, dext[symbol]); if (dist > s->outcnt) return -11; if (s->outcnt + len > s->outlen) return 1; while (len--) { if (dist <= s->outcnt && s->out[s->outcnt - dist]) s->out[s->outcnt] = s->out[s->outcnt - dist]; s->outcnt++; } } } while (symbol != 256); return 0; } static int puff_fixed(struct puff_state* s) { static int virgin = 1; static short lencnt[MAXBITS + 1], lensym[FIXLCODES]; static short distcnt[MAXBITS + 1], distsym[MAXDCODES]; static struct puff_huffman lencode, distcode; if (virgin) { lencode.count = lencnt; lencode.symbol = lensym; distcode.count = distcnt; distcode.symbol = distsym; short lengths[FIXLCODES]; int symbol; for (symbol = 0; symbol < 144; symbol++) lengths[symbol] = 8; for (; symbol < 256; symbol++) lengths[symbol] = 9; for (; symbol < 280; symbol++) lengths[symbol] = 7; for (; symbol < FIXLCODES; symbol++) lengths[symbol] = 8; puff_construct(&lencode, lengths, FIXLCODES); for (symbol = 0; symbol < MAXDCODES; symbol++) lengths[symbol] = 5; puff_construct(&distcode, lengths, MAXDCODES); virgin = 0; } return puff_codes(s, &lencode, &distcode); } static int puff_dynamic(struct puff_state* s) { static const short order[19] = {16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15}; int nlen = puff_bits(s, 5) + 257; int ndist = puff_bits(s, 5) + 1; int ncode = puff_bits(s, 4) + 4; if (nlen > MAXLCODES || ndist > MAXDCODES) return -3; short lengths[MAXCODES]; int index; for (index = 0; index < ncode; index++) lengths[order[index]] = puff_bits(s, 3); for (; index < 19; index++) lengths[order[index]] = 0; short lencnt[MAXBITS + 1], lensym[MAXLCODES]; struct puff_huffman lencode = {lencnt, lensym}; int err = puff_construct(&lencode, lengths, 19); if (err != 0) return -4; index = 0; while (index < nlen + ndist) { int symbol; int len; symbol = puff_decode(s, &lencode); if (symbol < 0) return symbol; if (symbol < 16) lengths[index++] = symbol; else { len = 0; if (symbol == 16) { if (index == 0) return -5; len = lengths[index - 1]; symbol = 3 + puff_bits(s, 2); } else if (symbol == 17) symbol = 3 + puff_bits(s, 3); else symbol = 11 + puff_bits(s, 7); if (index + symbol > nlen + ndist) return -6; while (symbol--) lengths[index++] = len; } } if (lengths[256] == 0) return -9; err = puff_construct(&lencode, lengths, nlen); if (err && (err < 0 || nlen != lencode.count[0] + lencode.count[1])) return -7; short distcnt[MAXBITS + 1], distsym[MAXDCODES]; struct puff_huffman distcode = {distcnt, distsym}; err = puff_construct(&distcode, lengths + nlen, ndist); if (err && (err < 0 || ndist != distcode.count[0] + distcode.count[1])) return -8; return puff_codes(s, &lencode, &distcode); } static int puff(unsigned char* dest, unsigned long* destlen, const unsigned char* source, unsigned long sourcelen) { struct puff_state s = { .out = dest, .outlen = *destlen, .outcnt = 0, .in = source, .inlen = sourcelen, .incnt = 0, .bitbuf = 0, .bitcnt = 0, }; int err; if (setjmp(s.env) != 0) err = 2; else { int last; do { last = puff_bits(&s, 1); int type = puff_bits(&s, 2); err = type == 0 ? puff_stored(&s) : (type == 1 ? puff_fixed(&s) : (type == 2 ? puff_dynamic(&s) : -1)); if (err != 0) break; } while (!last); } *destlen = s.outcnt; return err; } //% END CODE DERIVED FROM puff.{c,h} #define ZLIB_HEADER_WIDTH 2 static int puff_zlib_to_file(const unsigned char* source, unsigned long sourcelen, int dest_fd) { if (sourcelen < ZLIB_HEADER_WIDTH) return 0; source += ZLIB_HEADER_WIDTH; sourcelen -= ZLIB_HEADER_WIDTH; const unsigned long max_destlen = 132 << 20; void* ret = mmap(0, max_destlen, PROT_WRITE | PROT_READ, MAP_PRIVATE | MAP_ANON, -1, 0); if (ret == MAP_FAILED) return -1; unsigned char* dest = (unsigned char*)ret; unsigned long destlen = max_destlen; int err = puff(dest, &destlen, source, sourcelen); if (err) { munmap(dest, max_destlen); errno = -err; return -1; } if (write(dest_fd, dest, destlen) != (ssize_t)destlen) { munmap(dest, max_destlen); return -1; } return munmap(dest, max_destlen); } static int setup_loop_device(unsigned char* data, unsigned long size, const char* loopname, int* loopfd_p) { int err = 0, loopfd = -1; int memfd = syscall(__NR_memfd_create, "syzkaller", 0); if (memfd == -1) { err = errno; goto error; } if (puff_zlib_to_file(data, size, memfd)) { err = errno; goto error_close_memfd; } loopfd = open(loopname, O_RDWR); if (loopfd == -1) { err = errno; goto error_close_memfd; } if (ioctl(loopfd, LOOP_SET_FD, memfd)) { if (errno != EBUSY) { err = errno; goto error_close_loop; } ioctl(loopfd, LOOP_CLR_FD, 0); usleep(1000); if (ioctl(loopfd, LOOP_SET_FD, memfd)) { err = errno; goto error_close_loop; } } close(memfd); *loopfd_p = loopfd; return 0; error_close_loop: close(loopfd); error_close_memfd: close(memfd); error: errno = err; return -1; } static void reset_loop_device(const char* loopname) { int loopfd = open(loopname, O_RDWR); if (loopfd == -1) { return; } if (ioctl(loopfd, LOOP_CLR_FD, 0)) { } close(loopfd); } static long syz_mount_image(volatile long fsarg, volatile long dir, volatile long flags, volatile long optsarg, volatile long change_dir, volatile unsigned long size, volatile long image) { unsigned char* data = (unsigned char*)image; int res = -1, err = 0, need_loop_device = !!size; char* mount_opts = (char*)optsarg; char* target = (char*)dir; char* fs = (char*)fsarg; char* source = NULL; char loopname[64]; if (need_loop_device) { int loopfd; memset(loopname, 0, sizeof(loopname)); snprintf(loopname, sizeof(loopname), "/dev/loop%llu", procid); if (setup_loop_device(data, size, loopname, &loopfd) == -1) return -1; close(loopfd); source = loopname; } mkdir(target, 0777); char opts[256]; memset(opts, 0, sizeof(opts)); if (strlen(mount_opts) > (sizeof(opts) - 32)) { } strncpy(opts, mount_opts, sizeof(opts) - 32); if (strcmp(fs, "iso9660") == 0) { flags |= MS_RDONLY; } else if (strncmp(fs, "ext", 3) == 0) { bool has_remount_ro = false; char* remount_ro_start = strstr(opts, "errors=remount-ro"); if (remount_ro_start != NULL) { char after = *(remount_ro_start + strlen("errors=remount-ro")); char before = remount_ro_start == opts ? '\0' : *(remount_ro_start - 1); has_remount_ro = ((before == '\0' || before == ',') && (after == '\0' || after == ',')); } if (strstr(opts, "errors=panic") || !has_remount_ro) strcat(opts, ",errors=continue"); } else if (strcmp(fs, "xfs") == 0) { strcat(opts, ",nouuid"); } else if (strncmp(fs, "gfs2", 4) == 0 && (strstr(opts, "errors=panic") || strstr(opts, "debug"))) { strcat(opts, ",errors=withdraw"); } res = mount(source, target, fs, flags, opts); if (res == -1) { err = errno; goto error_clear_loop; } res = open(target, O_RDONLY | O_DIRECTORY); if (res == -1) { err = errno; goto error_clear_loop; } if (change_dir) { res = chdir(target); if (res == -1) { err = errno; } } error_clear_loop: if (need_loop_device) reset_loop_device(loopname); errno = err; return res; } 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 reset_loop() { char buf[64]; snprintf(buf, sizeof(buf), "/dev/loop%llu", procid); int loopfd = open(buf, O_RDWR); if (loopfd != -1) { ioctl(loopfd, LOOP_CLR_FD, 0); close(loopfd); } } static void setup_test() { prctl(PR_SET_PDEATHSIG, SIGKILL, 0, 0, 0); setpgrp(); write_file("/proc/self/oom_score_adj", "1000"); } static void execute_one(void); #define WAIT_FLAGS __WALL static void loop(void) { int iter = 0; for (;; iter++) { reset_loop(); 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 (;;) { sleep_ms(10); if (waitpid(-1, &status, WNOHANG | WAIT_FLAGS) == pid) break; if (current_time_ms() - start < 5000) continue; kill_and_wait(pid, &status); break; } } } uint64_t r[4] = {0x0, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff}; void execute_one(void) { intptr_t res = 0; if (write(1, "executing program\n", sizeof("executing program\n") - 1)) { } // prlimit64 arguments: [ // pid: pid (resource) // res: rlimit_type = 0xe (8 bytes) // new: ptr[in, rlimit] { // rlimit { // soft: intptr = 0x8 (8 bytes) // hard: intptr = 0x88 (8 bytes) // } // } // old: nil // ] *(uint64_t*)0x200000000140 = 8; *(uint64_t*)0x200000000148 = 0x88; syscall(__NR_prlimit64, /*pid=*/0, /*res=RLIMIT_RTPRIO*/ 0xeul, /*new=*/0x200000000140ul, /*old=*/0ul); // sched_setscheduler arguments: [ // pid: pid (resource) // policy: sched_policy = 0x2 (8 bytes) // prio: ptr[in, int32] { // int32 = 0x7 (4 bytes) // } // ] *(uint32_t*)0x200000000180 = 7; syscall(__NR_sched_setscheduler, /*pid=*/0, /*policy=SCHED_RR*/ 2ul, /*prio=*/0x200000000180ul); // getpid arguments: [ // ] // returns pid res = syscall(__NR_getpid); if (res != -1) r[0] = res; // sched_setscheduler arguments: [ // pid: pid (resource) // policy: sched_policy = 0x2 (8 bytes) // prio: ptr[in, int32] { // int32 = 0x7 (4 bytes) // } // ] *(uint32_t*)0x200000000200 = 7; syscall(__NR_sched_setscheduler, /*pid=*/r[0], /*policy=SCHED_RR*/ 2ul, /*prio=*/0x200000000200ul); // mmap arguments: [ // addr: VMA[0xb36000] // len: len = 0xb36000 (8 bytes) // prot: mmap_prot = 0xb635773f06ebbee2 (8 bytes) // flags: mmap_flags = 0x8031 (8 bytes) // fd: fd (resource) // offset: intptr = 0x0 (8 bytes) // ] syscall( __NR_mmap, /*addr=*/0x200000000000ul, /*len=*/0xb36000ul, /*prot=PROT_GROWSUP|PROT_WRITE|0xb635773f04ebbee0*/ 0xb635773f06ebbee2ul, /*flags=MAP_POPULATE|MAP_FIXED|MAP_ANONYMOUS|MAP_SHARED*/ 0x8031ul, /*fd=*/(intptr_t)-1, /*offset=*/0ul); // socketpair$unix arguments: [ // domain: const = 0x1 (8 bytes) // type: unix_socket_type = 0x2 (8 bytes) // proto: const = 0x0 (4 bytes) // fds: nil // ] syscall(__NR_socketpair, /*domain=*/1ul, /*type=SOCK_DGRAM*/ 2ul, /*proto=*/0, /*fds=*/0ul); // bpf$PROG_LOAD_XDP arguments: [ // cmd: const = 0x5 (8 bytes) // arg: nil // size: len = 0x0 (8 bytes) // ] // returns fd_bpf_prog_xdp syscall(__NR_bpf, /*cmd=*/5ul, /*arg=*/0ul, /*size=*/0ul); // connect$unix arguments: [ // fd: sock_unix (resource) // addr: nil // addrlen: len = 0x0 (8 bytes) // ] syscall(__NR_connect, /*fd=*/(intptr_t)-1, /*addr=*/0ul, /*addrlen=*/0ul); // sendmmsg$unix arguments: [ // fd: sock_unix (resource) // mmsg: nil // vlen: len = 0x0 (8 bytes) // f: send_flags = 0x0 (8 bytes) // ] syscall(__NR_sendmmsg, /*fd=*/(intptr_t)-1, /*mmsg=*/0ul, /*vlen=*/0ul, /*f=*/0ul); // unshare arguments: [ // flags: unshare_flags = 0x20060400 (8 bytes) // ] syscall(__NR_unshare, /*flags=CLONE_SYSVSEM|CLONE_NEWPID|CLONE_NEWNS|CLONE_FILES*/ 0x20060400ul); // recvmmsg arguments: [ // fd: sock (resource) // mmsg: nil // vlen: len = 0x0 (8 bytes) // f: recv_flags = 0x2 (8 bytes) // timeout: nil // ] syscall(__NR_recvmmsg, /*fd=*/(intptr_t)-1, /*mmsg=*/0ul, /*vlen=*/0ul, /*f=MSG_PEEK*/ 2ul, /*timeout=*/0ul); // madvise arguments: [ // addr: VMA[0x3000] // len: len = 0x7fffffffffffffff (8 bytes) // advice: madvise_flags = 0x3 (8 bytes) // ] syscall(__NR_madvise, /*addr=*/0x200000000000ul, /*len=*/0x7ffffffffffffffful, /*advice=MADV_WILLNEED*/ 3ul); // sendmsg$nl_route_sched arguments: [ // fd: sock_nl_route (resource) // msg: nil // f: send_flags = 0x0 (8 bytes) // ] syscall(__NR_sendmsg, /*fd=*/(intptr_t)-1, /*msg=*/0ul, /*f=*/0ul); // socket$netlink arguments: [ // domain: const = 0x10 (8 bytes) // type: const = 0x3 (8 bytes) // proto: netlink_proto = 0x0 (4 bytes) // ] // returns sock_netlink res = syscall(__NR_socket, /*domain=*/0x10ul, /*type=*/3ul, /*proto=*/0); if (res != -1) r[1] = res; // sendmsg$nl_route_sched arguments: [ // fd: sock_nl_route (resource) // msg: nil // f: send_flags = 0x0 (8 bytes) // ] syscall(__NR_sendmsg, /*fd=*/(intptr_t)-1, /*msg=*/0ul, /*f=*/0ul); // syz_mount_image$nilfs2 arguments: [ // fs: ptr[in, buffer] { // buffer: {6e 69 6c 66 73 32 00} (length 0x7) // } // dir: ptr[in, buffer] { // buffer: {2e 2f 66 69 6c 65 30 00} (length 0x8) // } // flags: mount_flags = 0x1080c (8 bytes) // opts: ptr[inout, array[ANYUNION]] { // array[ANYUNION] { // union ANYUNION { // ANYRES64: ANYRES64 (resource) // } // union ANYUNION { // ANYRES8: ANYRES8 (resource) // } // union ANYUNION { // ANYRESOCT: ANYRES64 (resource) // } // union ANYUNION { // ANYBLOB: buffer: {d1 79 4d a8 c0 cc da 03 42 76 e2 8a 25 c4 5c 8e // 1e b8 b5 95 a3 7f fd fe 7d 2a 8c 39 72 a6 93 1d 2c bb 0d 8d c9 20 // bb de 15 d8 79 0d 46 cc b3 a5 f3 6f f4 12 23 62 51 d8 63 34 f1 75 // 45 cc ae 88} (length 0x40) // } // union ANYUNION { // ANYRES32: ANYRES32 (resource) // } // union ANYUNION { // ANYRES32: ANYRES32 (resource) // } // union ANYUNION { // ANYRESOCT: ANYRES64 (resource) // } // union ANYUNION { // ANYRES8: ANYRES8 (resource) // } // union ANYUNION { // ANYRESDEC: ANYRES64 (resource) // } // union ANYUNION { // ANYRESOCT: ANYRES64 (resource) // } // union ANYUNION { // ANYRES32: ANYRES32 (resource) // } // } // } // chdir: int8 = 0x1 (1 bytes) // size: len = 0xa7a (8 bytes) // img: ptr[in, buffer] { // buffer: (compressed buffer with length 0xa7a) // } // ] // returns fd_dir memcpy((void*)0x200000000180, "nilfs2\000", 7); memcpy((void*)0x200000000000, "./file0\000", 8); *(uint64_t*)0x200000000440 = 0; *(uint8_t*)0x200000000448 = -1; sprintf((char*)0x200000000449, "%023llo", (long long)-1); memcpy((void*)0x200000000460, "\xd1\x79\x4d\xa8\xc0\xcc\xda\x03\x42\x76\xe2\x8a\x25\xc4\x5c\x8e\x1e" "\xb8\xb5\x95\xa3\x7f\xfd\xfe\x7d\x2a\x8c\x39\x72\xa6\x93\x1d\x2c\xbb" "\x0d\x8d\xc9\x20\xbb\xde\x15\xd8\x79\x0d\x46\xcc\xb3\xa5\xf3\x6f\xf4" "\x12\x23\x62\x51\xd8\x63\x34\xf1\x75\x45\xcc\xae\x88", 64); *(uint32_t*)0x2000000004a0 = -1; *(uint32_t*)0x2000000004a4 = -1; sprintf((char*)0x2000000004a8, "%023llo", (long long)0); *(uint8_t*)0x2000000004bf = -1; sprintf((char*)0x2000000004c0, "%020llu", (long long)0); sprintf((char*)0x2000000004d4, "%023llo", (long long)-1); *(uint32_t*)0x2000000004eb = 0; memcpy( (void*)0x200000000980, "\x78\x9c\xec\xdd\x4b\x8c\x1c\x47\x19\x00\xe0\xee\xdd\x9d\xb5\x9d\x38\x78" "\x1c\x6c\x62\x9c\x90\xd8\x04\x92\x08\xc8\x6e\xbc\x6b\xcc\xc3\x82\x38\x8a" "\x2f\x58\x31\xe2\x16\x29\xe2\x62\x39\x4e\xb0\x70\x0c\xc2\x91\x20\x51\x24" "\x6c\x9f\xb8\x91\xc8\x32\x37\xc4\x43\x9c\x72\x89\x00\x21\x91\x0b\xb2\x72" "\xe2\x12\x89\x58\xe2\x92\x53\xe0\xc0\x01\xcb\x48\x91\x38\x40\x82\x3d\x68" "\x67\xab\x66\x67\x7e\xcf\xa4\x67\xbd\x8f\xde\xd9\xf9\x3e\xa9\xa6\xa6\xbb" "\x6a\xba\xaa\x67\x7b\x7a\xfb\x55\x55\x05\x30\xb6\x26\xda\xaf\x8d\xf6\xeb" "\xe5\x37\x2f\x1d\xfd\xe7\x43\xff\xd8\xb6\xf0\xfe\xf1\x4e\x8e\x66\xfb\x75" "\xaa\x6b\x6a\x21\x77\x99\xa6\xa7\xc2\xf2\xde\x9b\x5c\x8c\x6f\xbc\xff\xca" "\xc9\x7e\x71\x59\xcc\xb5\x5f\xf3\xf4\x64\xd7\x67\xef\x2c\x8a\xe2\x7c\xb1" "\xaf\xb8\x52\x34\x8b\xbd\x97\xaf\xbe\xf6\xf6\xdc\x53\xc7\x2f\x1c\xbb\xb8" "\xff\x9d\xd7\x0f\x5f\x5b\x83\x55\x07\x00\x80\xb1\xf3\xad\x2b\x87\x0f\xee" "\xfe\xdb\x5f\xee\xdd\xf9\xc1\x1b\xf7\x1f\x29\xb6\x74\xe6\xe7\xe3\xf3\x66" "\x9a\xde\x9e\x8e\xfb\x8f\xa4\x03\xff\x85\x68\xaa\xcc\xe7\x0f\x4b\xe7\x03" "\x65\x57\xe8\x36\x1d\xf2\x4d\xa5\x30\x11\xf2\x4d\xf6\xc9\x57\x74\xe5\x6b" "\xe4\x7c\x5b\x7b\x3f\x17\xcb\x9f\x0e\xcb\x6d\x0c\xc8\xb7\xa5\xa2\xfc\xc9" "\x70\x8e\x52\x86\xfa\xc0\x28\xcb\xdb\x71\xb3\x28\x27\x66\x7a\xa6\x27\x26" "\x66\x66\x16\xcf\xc9\x8b\xf6\x79\xfd\x74\x39\x73\xf6\xf4\x99\xe7\xce\xd5" "\x54\x51\x60\xd5\xfd\xfb\x81\xa2\x28\xf6\x09\xc2\xb8\x85\xd6\x8e\xce\x8f" "\xa0\xf6\xba\xd4\x17\xba\xbe\x05\x80\x5a\xc5\xfb\x85\xb7\x38\x1f\xaf\x2c" "\xac\x4c\x67\x69\x53\xc3\x95\x7f\xfd\x89\x89\xfe\x9f\xef\xd5\x58\xcd\x3a" "\x32\x3e\xd6\x7b\xfb\x57\x7e\x5c\x7e\x6f\x3d\xd6\xbb\xfc\xaa\xf5\xff\xcd" "\x85\x35\x5e\x7f\xc6\xca\xf0\x5b\xd3\xd6\x35\xad\xc7\x6a\xcb\xeb\x95\x7f" "\x47\xdb\xd3\x74\xbc\x8f\x10\x9f\x5f\x5a\xee\xfe\x27\x2f\x6f\x32\x2c\x6f" "\xd8\x03\x80\x41\xf7\x11\x46\xe5\xfe\xc2\xa0\x7a\x4e\xae\x73\x3d\x6e\xd7" "\xa0\xfa\xc7\xed\x62\xb3\xfa\x5a\x8a\xf3\xf7\xf0\xf5\x90\xde\xfd\xfb\x89" "\x7f\xd3\x51\xf9\x1b\x03\xfd\xfd\x67\xc3\x5d\xff\xdf\xb6\x54\xb9\xda\xeb" "\x22\x08\x9b\x3b\xb4\xea\xdc\xf9\x00\xf5\xaa\x38\xad\x8f\xcf\xcd\xb5\x92" "\x9c\x1e\x9f\xeb\x8b\xe9\x5b\x2a\xd2\xb7\x56\xa4\x6f\xab\x48\xbf\xa3\x22" "\xfd\xce\x8a\x74\x18\x67\xbf\x7f\xf1\xa7\xc5\xab\x65\xd1\xb7\x3d\x5e\xb1" "\x78\xfe\xdf\xfe\xb1\x0c\x7b\x3d\x2c\x5f\x67\xbb\x2b\xc5\x1f\x5b\x66\x7d" "\xe2\xf5\xc8\xe5\x5e\x8f\x8b\xcf\xfd\x2e\xd7\x4a\xcb\x8f\xcf\x13\xc3\x46" "\xf6\xc7\x13\x4f\x9f\xfa\xf2\xb3\xcf\x5c\x5d\x7c\xfe\xbf\xec\x6c\xff\x37" "\xd3\xf6\xbe\x2f\x4d\x37\xd3\x6f\xeb\x4a\xca\x90\xaf\x17\xc6\xeb\xea\x9d" "\x67\xff\x9b\xbd\xe5\x4c\x0c\xc8\x77\x77\xa8\xcf\x5d\x7d\xf2\xb7\xdf\xef" "\xea\xcd\x57\xee\x5a\x5a\x4e\xd1\xb5\x9f\xb9\xa5\x1e\x7b\x7a\x3f\xb7\x63" "\x50\xbe\xfb\x7a\xf3\x35\x43\xbe\x6d\x29\xc4\xc3\xa5\x78\x7c\x72\x47\xf8" "\x5c\x3e\xfe\xc8\xfb\xd5\xfc\x7d\x4d\x85\xf5\x6d\x84\xf5\x98\x0e\xf5\xc8" "\xfb\x95\x9d\x29\x1e\xad\xbb\x31\x6c\x54\x79\x7b\x1c\xf4\xfc\x7f\xde\x3e" "\xf7\x14\x8d\xf2\xb9\xd3\x67\x4e\x3d\x96\xa6\xf3\x76\xfa\xe7\xc9\xc6\x96" "\x85\xf9\x07\xd6\xb9\xde\xc0\xca\x0d\xdb\xfe\x67\x4f\xd1\xdb\xfe\x67\x7b" "\x67\x7e\x63\xa2\x7b\xbf\xb0\x63\x69\x7e\xd9\xbd\x5f\x68\x86\xf9\x73\x03" "\xe6\xcf\xa7\xe9\xfc\x7f\xee\x3b\x93\xdb\xda\xf3\x67\x4e\x7e\xef\xcc\xb3" "\xab\xbd\xf2\x30\xe6\xce\xbd\xf4\xf2\x77\x4f\x9c\x39\x73\xea\x07\xde\x78" "\xe3\x8d\x37\x9d\x37\x75\xef\x99\x80\xb5\x36\xfb\xe2\x0b\xdf\x9f\x3d\xf7" "\xd2\xcb\x8f\x9e\x7e\xe1\xc4\xf3\xa7\x9e\x3f\x75\x76\xfe\xd0\xa1\xf9\xb9" "\xb9\x43\x5f\x99\x3f\x38\xdb\x3e\xae\x9f\xed\x3e\xba\x07\x36\x93\xa5\x7f" "\xfa\x75\xd7\x04\x00\x00\x00\x00\x00\x00\x00\x00\x00\x18\xd6\x0f\x8f\x1d" "\xbd\xfa\xd7\xb7\xbe\xf4\xee\x62\xfb\xff\xa5\xf6\x7f\xb9\xfd\x7f\x7e\xf2" "\x37\xb7\xff\xff\x49\x68\xff\x1f\xdb\xc9\xe7\x76\xf0\xb9\x1d\xe0\xce\x3e" "\xe9\xed\x3c\xa1\x83\xd5\xe9\x90\xaf\x91\xc2\xc7\x43\x7d\x77\x85\x72\x76" "\x87\xcf\x7d\x22\xc5\x9d\x71\xfc\x52\xfb\xff\x5c\x5c\xec\xd7\x35\xd7\xe7" "\x9e\x30\x3f\xf6\xdf\x9b\xf3\x85\xee\x04\x6e\xe9\x2f\x65\x3a\xf4\x41\x12" "\xc7\x0b\xfc\x74\x8a\x2f\xa6\xf8\xd7\x05\xd4\xa8\xfc\x79\xff\xd9\x29\xae" "\xea\xdf\x3a\x6f\xeb\xb9\x7f\x0a\xfd\x52\x8c\xa6\xfc\x77\xcb\xfd\x99\xe4" "\x7e\x4c\x72\xfb\xef\x41\xfd\x3a\xe5\xfd\xff\xce\xfe\x8b\xfd\xf1\x6a\xd7" "\x93\xd5\xb5\x1e\xcd\x09\xeb\x5e\x47\xa0\xbf\x7f\x6d\xb8\xfe\xbf\xd7\x24" "\x2c\x75\xf8\x59\x7b\x5d\xba\xce\x18\x6a\xaf\x8b\xb0\xd1\xc2\x8d\x56\xab" "\xb5\x9e\xe5\xb5\x5a\x1f\x35\x8a\x87\xb1\xa6\x80\xf5\x53\xf7\xf8\x9f\xf9" "\xba\x67\x8e\xcf\xfe\xe9\x1b\x5b\x17\x42\xce\x76\xfd\x89\xde\xfd\x65\xec" "\xbf\x14\x56\xa2\xee\xf1\x2f\x6b\x2b\x3f\x5f\x58\x1c\xd7\xf5\x1f\xb2\xfc" "\xd5\x1e\xff\xb3\x33\xfe\xdd\xd0\xfb\xbf\x30\x62\x5e\xf3\xf6\xca\xfd\xef" "\x2f\xae\xbd\xdb\x55\x6c\xb1\x77\x60\xf9\x5b\x8a\x9e\xf2\xe3\xfa\xe7\x7e" "\xa0\x77\x2d\xaf\xfc\x0f\x52\xf9\x79\x6d\x1e\x2e\x06\x95\xdf\xbb\xfe\xad" "\x5f\x85\xf2\xe3\x0d\xa1\x21\x7d\x18\xca\xbf\x63\xc8\xf2\xe3\xfa\x5f\x5a" "\x6e\xc1\xa9\xc0\xff\xa5\xf2\xf3\xd7\xf6\xc8\x83\xc3\x96\xbf\xb8\x80\x72" "\xa2\xb7\x1e\xf1\xba\x71\xbe\xff\x17\xaf\x1b\x67\x37\xc2\xfa\xe7\xbe\x3d" "\x97\xbb\xfe\xb7\x3b\x50\xe3\xcd\x54\x3e\x8c\xb3\x51\x19\x67\x76\xb9\x7a" "\xc6\xff\xbd\xd0\x5a\xff\xf1\x7f\x57\x38\xc2\x50\x7c\x0e\xe3\x8b\x69\x3a" "\xef\x08\xf3\x73\x0e\x71\xbc\x93\xe5\xd6\x3f\x3f\x5f\x91\xff\x0f\xec\x0e" "\xcb\x2f\x2b\xfe\xbf\x19\xff\x77\xb4\x7d\x35\xc5\x55\xbf\x87\x3c\xfe\x6f" "\xde\x1e\x9b\x7d\xa6\x27\xba\xa6\x1b\x7d\xbe\xdb\xcd\xba\xaf\x81\x51\xf5" "\xde\xaa\xdd\xff\xeb\x7a\x62\x6e\x03\xdc\x47\x11\xc6\x27\x94\xb6\xb9\xdb" "\x0e\xad\x56\xab\xd6\x9b\x7c\xee\x30\xd6\xab\xee\xef\xbf\xee\xf3\x84\xba" "\xcb\xaf\xfb\xfb\xaf\x12\xc7\xff\x8d\xc7\xf0\x71\xfc\xdf\x98\x1e\xc7\xff" "\x8d\xe9\x71\xfc\xdf\x98\xde\xbe\xae\xf8\xe1\xd2\xa0\xbd\xf1\xfb\x8a\xe3" "\xff\xc6\xf4\x38\xfe\x6f\x4c\xbf\x27\x94\x1b\xc7\x07\xde\x53\x91\xfe\xc9" "\x8a\xf4\xbd\x15\xe9\xf7\x56\xa4\xdf\x57\x91\xfe\xa9\x8a\xf4\xfd\x15\xe9" "\xf7\x57\xa4\x3f\x50\x91\x7e\x77\x45\xfa\x83\x15\xe9\x9f\x09\x7f\xf1\x98" "\xfe\xd9\x8a\xcf\x3f\x54\x91\xfe\xc8\x47\xa7\xcf\xff\xa8\xe2\xf3\x9b\x5d" "\x6e\x8f\x32\xae\xeb\x0f\xe3\x2c\xb6\xcf\xf3\xfb\x87\xf1\x91\xef\xff\x0c" "\xfa\xfd\xef\xaa\x48\x07\x46\xd7\xcf\xde\x38\xf0\xe4\x33\xbf\xfb\x76\x73" "\xb1\xfd\xff\x74\xe7\x7a\x48\xbe\x8f\x77\x24\x4d\x37\xd2\xb9\x73\x3c\x5f" "\x8a\xd7\x4f\x26\x53\xda\x5b\x69\xfa\xef\x21\x7d\xa3\x5f\xef\x80\x71\x12" "\xfb\xcf\x88\xff\xdf\x1f\xae\x48\x07\x46\x57\x7e\xce\xcb\xef\x1b\xc6\x50" "\xd9\xbf\xc7\x9e\x61\xfb\xad\x1a\x74\x9c\xcf\x68\xf9\x5c\x8a\x3f\x9f\xe2" "\x2f\xa4\xf8\xd1\x14\xcf\xa4\x78\x36\xc5\x07\x52\x3c\xb7\x4e\xf5\x63\x6d" "\x3c\xf9\xdb\x3f\x1c\x7e\xb5\x5c\x3a\xdf\xdf\x11\xd2\x87\x7d\x9e\x3c\xb6" "\x07\x8a\xfd\x44\xcd\x0f\x59\x9f\x78\x7d\x60\xb9\xcf\xb3\xc7\x7e\xfc\x96" "\x6b\xa5\xe5\xdf\x66\x73\x30\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\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\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\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\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\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\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\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\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\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\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\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\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\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\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\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\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" "\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\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\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\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\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\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\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\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\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\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\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\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\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\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\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\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\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\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" "\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\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\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\x00\x00\x00\x00\x00\x00\x00\x00\x00\x80\xda\x4c\xb4\x5f\x0f" "\x1e\xdc\x53\x16\xc5\xe5\x37\x2f\x1d\x7d\xfa\xf8\xe9\xd9\x85\x39\x8f\x77" "\x72\x34\xdb\xaf\x53\x5d\x53\x8d\xce\xe7\x8a\xe2\xb1\x14\x4f\xa6\xf8\x97" "\xe9\xcd\x8d\xf7\x5f\x39\xd9\x1d\xdf\x4c\x71\x59\xcc\x15\x65\x51\x76\xe6" "\x17\xdf\xbc\xde\x29\xe9\xce\xa2\x28\xce\x17\xfb\x8a\x2b\x45\xb3\xd8\x7b" "\xf9\xea\x6b\x6f\xcf\x3d\x75\xfc\xc2\xb1\x8b\xfb\xdf\x79\xfd\xf0\xb5\xb5" "\xfb\x06\x00\x00\x00\x60\xf3\xfb\x7f\x00\x00\x00\xff\xff\x4d\xda\x1c" "\x2a", 2682); syz_mount_image( /*fs=*/0x200000000180, /*dir=*/0x200000000000, /*flags=MS_POSIXACL|MS_NOEXEC|MS_NODIRATIME|MS_NODEV*/ 0x1080c, /*opts=*/0x200000000440, /*chdir=*/1, /*size=*/0xa7a, /*img=*/0x200000000980); // openat arguments: [ // fd: fd_dir (resource) // file: nil // flags: open_flags = 0x0 (4 bytes) // mode: open_mode = 0x0 (2 bytes) // ] // returns fd res = syscall(__NR_openat, /*fd=*/0xffffff9c, /*file=*/0ul, /*flags=*/0, /*mode=*/0); if (res != -1) r[2] = res; // ioctl$FS_IOC_REMOVE_ENCRYPTION_KEY arguments: [ // fd: fd_dir (resource) // cmd: const = 0x80186e82 (4 bytes) // arg: nil // ] syscall(__NR_ioctl, /*fd=*/r[2], /*cmd=*/0x80186e82, /*arg=*/0ul); // openat$dir arguments: [ // fd: const = 0xffffffffffffff9c (8 bytes) // file: ptr[in, buffer] { // buffer: {2e 00} (length 0x2) // } // flags: open_flags = 0x0 (4 bytes) // mode: open_mode = 0x82 (2 bytes) // ] // returns fd_dir memcpy((void*)0x200000000000, ".\000", 2); res = syscall(__NR_openat, /*fd=*/0xffffffffffffff9cul, /*file=*/0x200000000000ul, /*flags=*/0, /*mode=S_IWOTH|S_IWUSR*/ 0x82); if (res != -1) r[3] = res; // ioctl$FITRIM arguments: [ // fd: fd (resource) // cmd: const = 0xc0185879 (4 bytes) // arg: ptr[in, fstrim_range] { // fstrim_range { // start: int64 = 0x6 (8 bytes) // len: int64 = 0x656 (8 bytes) // minlen: int64 = 0x4010 (8 bytes) // } // } // ] *(uint64_t*)0x200000000040 = 6; *(uint64_t*)0x200000000048 = 0x656; *(uint64_t*)0x200000000050 = 0x4010; syscall(__NR_ioctl, /*fd=*/r[3], /*cmd=*/0xc0185879, /*arg=*/0x200000000040ul); // sendmmsg arguments: [ // fd: sock (resource) // mmsg: nil // vlen: len = 0x0 (8 bytes) // f: send_flags = 0x20000000 (8 bytes) // ] syscall(__NR_sendmmsg, /*fd=*/r[1], /*mmsg=*/0ul, /*vlen=*/0ul, /*f=MSG_FASTOPEN*/ 0x20000000ul); } int main(void) { syscall(__NR_mmap, /*addr=*/0x1ffffffff000ul, /*len=*/0x1000ul, /*prot=*/0ul, /*flags=MAP_FIXED|MAP_ANONYMOUS|MAP_PRIVATE*/ 0x32ul, /*fd=*/(intptr_t)-1, /*offset=*/0ul); syscall(__NR_mmap, /*addr=*/0x200000000000ul, /*len=*/0x1000000ul, /*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=*/0x1000ul, /*prot=*/0ul, /*flags=MAP_FIXED|MAP_ANONYMOUS|MAP_PRIVATE*/ 0x32ul, /*fd=*/(intptr_t)-1, /*offset=*/0ul); const char* reason; (void)reason; loop(); return 0; }