// https://syzkaller.appspot.com/bug?id=120b9a8b1962d9fbbff52d069342c7650b9be90e // 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 #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 void thread_start(void* (*fn)(void*), void* arg) { pthread_t th; pthread_attr_t attr; pthread_attr_init(&attr); pthread_attr_setstacksize(&attr, 128 << 10); int i = 0; for (; i < 100; i++) { if (pthread_create(&th, &attr, fn, arg) == 0) { pthread_attr_destroy(&attr); return; } if (errno == EAGAIN) { usleep(50); continue; } break; } exit(1); } #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)))) typedef struct { int state; } event_t; static void event_init(event_t* ev) { ev->state = 0; } static void event_reset(event_t* ev) { ev->state = 0; } static void event_set(event_t* ev) { if (ev->state) exit(1); __atomic_store_n(&ev->state, 1, __ATOMIC_RELEASE); syscall(SYS_futex, &ev->state, FUTEX_WAKE | FUTEX_PRIVATE_FLAG, 1000000); } static void event_wait(event_t* ev) { while (!__atomic_load_n(&ev->state, __ATOMIC_ACQUIRE)) syscall(SYS_futex, &ev->state, FUTEX_WAIT | FUTEX_PRIVATE_FLAG, 0, 0); } static int event_isset(event_t* ev) { return __atomic_load_n(&ev->state, __ATOMIC_ACQUIRE); } static int event_timedwait(event_t* ev, uint64_t timeout) { uint64_t start = current_time_ms(); uint64_t now = start; for (;;) { uint64_t remain = timeout - (now - start); struct timespec ts; ts.tv_sec = remain / 1000; ts.tv_nsec = (remain % 1000) * 1000 * 1000; syscall(SYS_futex, &ev->state, FUTEX_WAIT | FUTEX_PRIVATE_FLAG, 0, &ts); if (__atomic_load_n(&ev->state, __ATOMIC_ACQUIRE)) return 1; now = current_time_ms(); if (now - start > timeout) return 0; } } 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"); } struct thread_t { int created, call; event_t ready, done; }; static struct thread_t threads[16]; static void execute_call(int call); static int running; static void* thr(void* arg) { struct thread_t* th = (struct thread_t*)arg; for (;;) { event_wait(&th->ready); event_reset(&th->ready); execute_call(th->call); __atomic_fetch_sub(&running, 1, __ATOMIC_RELAXED); event_set(&th->done); } return 0; } static void execute_one(void) { if (write(1, "executing program\n", sizeof("executing program\n") - 1)) { } int i, call, thread; for (call = 0; call < 8; call++) { for (thread = 0; thread < (int)(sizeof(threads) / sizeof(threads[0])); thread++) { struct thread_t* th = &threads[thread]; if (!th->created) { th->created = 1; event_init(&th->ready); event_init(&th->done); event_set(&th->done); thread_start(thr, th); } if (!event_isset(&th->done)) continue; event_reset(&th->done); th->call = call; __atomic_fetch_add(&running, 1, __ATOMIC_RELAXED); event_set(&th->ready); event_timedwait(&th->done, 50 + (call == 0 ? 4000 : 0) + (call == 5 ? 4000 : 0)); break; } } for (i = 0; i < 100 && __atomic_load_n(&running, __ATOMIC_RELAXED); i++) sleep_ms(1); } 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[2] = {0xffffffffffffffff, 0xffffffffffffffff}; void execute_call(int call) { intptr_t res = 0; switch (call) { case 0: // syz_mount_image$ext4 arguments: [ // fs: ptr[in, buffer] { // buffer: {65 78 74 34 00} (length 0x5) // } // dir: ptr[in, buffer] { // buffer: {2e 2f 66 69 6c 65 30 00} (length 0x8) // } // flags: mount_flags = 0x4000 (8 bytes) // opts: ptr[in, fs_options[ext4_options]] { // fs_options[ext4_options] { // elems: array[fs_opt_elem[ext4_options]] { // } // common: array[fs_opt_elem[fs_options_common]] { // } // null: const = 0x0 (1 bytes) // } // } // chdir: int8 = 0xd (1 bytes) // size: len = 0x5d8 (8 bytes) // img: ptr[in, buffer] { // buffer: (compressed buffer with length 0x5d8) // } // ] // returns fd_dir memcpy((void*)0x200000000300, "ext4\000", 5); memcpy((void*)0x2000000005c0, "./file0\000", 8); *(uint8_t*)0x200000000600 = 0; memcpy( (void*)0x200000000c00, "\x78\x9c\xec\xdd\xcf\x6f\x14\x55\x1c\x00\xf0\xef\x6c\x7f\xd0\x52\xb4" "\x85\x18\x15\x0f\xd2\xc4\x18\x48\x94\x96\x16\x30\xc4\x78\x80\xab\x21" "\x0d\xfe\x88\x17\x2f\x56\x5a\x10\x29\xd0\xd0\x1a\x2d\x9a\x50\x12\xbc" "\x98\x18\x2f\xc6\x98\x78\xf2\x20\xfe\x17\x4a\xe4\xca\x49\x4f\x1e\xbc" "\x78\x32\x24\x44\x0d\x47\x13\xd7\xcc\x76\xa6\x74\xdb\xd9\x96\x2e\x6d" "\xa7\x32\x9f\x4f\xb2\xf4\xcd\x7b\x3b\xbc\x37\xdd\x7e\xfb\xde\xbe\xbe" "\x37\x1b\x40\x65\x0d\xa6\xff\xd4\x22\xf6\x46\xc4\x74\x12\xd1\x9f\xcc" "\x2f\x96\x75\x46\x56\x38\xb8\xf0\xbc\x7b\x7f\x7f\x72\x3a\x7d\x24\x51" "\xaf\xbf\xf1\x67\x12\x49\x96\x97\x3f\x3f\xc9\xbe\xf6\x65\x27\xf7\x44" "\xc4\xcf\x3f\x25\xb1\xa7\x63\x65\xbd\x33\x73\x57\xce\x8f\x4f\x4d\x4d" "\x5e\xce\x8e\x87\x67\x2f\x4c\x0f\xcf\xcc\x5d\x39\x78\xee\xc2\xf8\xd9" "\xc9\xb3\x93\x17\x47\x5f\x1a\x3d\x76\xf4\xc8\xd1\x63\x23\x87\xda\xba" "\xae\xab\x05\x79\x27\xaf\xbf\xff\x61\xff\x67\x63\x6f\x7f\xf7\xcd\x3f" "\xc9\xc8\xf7\xbf\x8d\x25\x71\x3c\x5e\xcd\x9e\xb8\xf4\x3a\x36\xca\x60" "\x0c\x36\xbe\x27\xc9\xca\xa2\xbe\x63\x1b\x5d\x59\x49\x3a\xb2\x9f\x93" "\xa5\x2f\x71\xd2\x59\x62\x83\x58\x97\xfc\xf5\xeb\x8a\x88\xa7\xa2\x3f" "\x3a\xe2\xfe\x8b\xd7\x1f\x9f\xbe\x56\x6a\xe3\x80\x4d\x55\x4f\x22\xea" "\x40\x45\x25\xe2\x1f\x2a\x2a\x1f\x07\xe4\xef\xed\x97\xbf\x0f\xae\x95" "\x32\x2a\x01\xb6\xc2\xdd\x13\x0b\x13\x00\x2b\xe3\xbf\x73\x61\x6e\x30" "\x7a\x1a\x73\x03\x3b\xef\x25\xb1\x74\x5a\x27\x89\x88\xf6\x66\xe6\x9a" "\xed\x8a\x88\xdb\xb7\xc6\xae\x9f\xb9\x35\x76\x3d\x36\x69\x1e\x0e\x28" "\x36\x7f\x2d\x22\x9e\x2e\x8a\xff\xa4\x11\xff\x03\xd1\x13\x03\x8d\xf8" "\xaf\x35\xc5\x7f\x3a\x2e\x38\x95\x7d\x4d\xf3\x5f\x6f\xb3\xfe\xe5\x53" "\xc5\xe2\x1f\xb6\xce\x42\xfc\xf7\xac\x1a\xff\xd1\x22\xfe\xdf\x59\x12" "\xff\xef\xb6\x59\xff\xe0\xfd\xe4\x7b\xbd\x4d\xf1\xdf\xdb\xee\x25\x01" "\x00\x00\x00\x00\x00\x40\x65\xdd\x3c\x11\x11\x2f\x16\xfd\xfd\xbf\xb6" "\xb8\xfe\x27\x0a\xd6\xff\xf4\x45\xc4\xf1\x0d\xa8\x7f\x70\xd9\xf1\xca" "\xbf\xff\xd7\xee\x6c\x40\x35\x40\x81\xbb\x27\x22\x5e\x29\x5c\xff\x5b" "\xcb\x57\xff\x0e\x74\x64\xa9\xc7\x1a\xeb\x01\xba\x92\x33\xe7\xa6\x26" "\x0f\x45\xc4\xe3\x11\x71\x20\xba\x76\xa4\xc7\x23\xab\xd4\x71\xf0\xf3" "\x3d\x5f\xb7\x2a\x1b\xcc\xd6\xff\xe5\x8f\xb4\xfe\xdb\xd9\x5a\xc0\xac" "\x1d\x77\x3a\x77\x34\x9f\x33\x31\x3e\x3b\xfe\xb0\xd7\x0d\x44\xdc\xbd" "\x16\xf1\x4c\xe1\xfa\xdf\x64\xb1\xff\x4f\x0a\xfa\xff\xf4\xf7\xc1\xf4" "\x03\xd6\xb1\xe7\xf9\x1b\xa7\x5a\x95\xad\x1d\xff\xc0\x66\xa9\x7f\x1b" "\xb1\xbf\xb0\xff\xbf\x7f\xd7\x8a\x64\xf5\xfb\x73\x0c\x37\xc6\x03\xc3" "\xf9\xa8\x60\xa5\x67\x3f\xfe\xe2\x87\x56\xf5\xb7\x1b\xff\x6e\x31\x01" "\x0f\x2f\xed\xff\x77\xae\x1e\xff\x03\xc9\xd2\xfb\xf5\xcc\xac\xbf\x8e" "\xc3\x73\x9d\xf5\x56\x65\xed\x8e\xff\xbb\x93\x37\x1b\xb7\x9c\xe9\xce" "\xf2\x3e\x1a\x9f\x9d\xbd\x3c\x12\xd1\x9d\x9c\xec\x48\x73\x9b\xf2\x47" "\xd7\xdf\x66\x78\x14\xe5\xf1\x90\xc7\x4b\x1a\xff\x07\x9e\x5b\x7d\xfe" "\xaf\x68\xfc\xdf\x1b\x11\xf3\xcb\xfe\xef\xe4\xaf\xe6\x3d\xc5\xb9\x27" "\xff\xed\xfb\xbd\x55\x7b\x8c\xff\xa1\x3c\x69\xfc\x4f\xac\xab\xff\x5f" "\x7f\x62\xf4\xc6\xc0\x8f\xad\xea\x7f\xb0\xfe\xff\x48\xa3\xaf\x3f\x90" "\xe5\x98\xff\x83\x05\x5f\xe5\x61\xda\xdd\x9c\x5f\x10\x8e\x9d\x45\x45" "\x5b\xdd\x5e\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x78\x14\xd4\x22\x62\x57" "\x24\xb5\xa1\xc5\x74\xad\x36\x34\x14\xd1\x17\x11\x4f\xc4\xce\xda\xd4" "\xa5\x99\xd9\x17\xce\x5c\xfa\xe0\xe2\x44\x5a\xd6\xf8\xfc\xff\x5a\xfe" "\x49\xbf\xfd\x0b\xc7\x49\xfe\xf9\xff\x03\x4b\x8e\x47\x97\x1d\x1f\x8e" "\x88\xdd\x11\xf1\x65\x47\x6f\xe3\x78\xe8\xf4\xa5\xa9\x89\xb2\x2f\x1e" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xb6\x89" "\xbe\x16\xfb\xff\x53\x7f\x74\x94\xdd\x3a\x60\xd3\x75\x96\xdd\x00\xa0" "\x34\x05\xf1\xff\x4b\x19\xed\x00\xb6\x9e\xfe\x1f\xaa\x4b\xfc\x43\x75" "\x89\x7f\xa8\x2e\xf1\x0f\xd5\x25\xfe\xa1\xba\xc4\x3f\x54\x97\xf8\x87" "\xea\x12\xff\x00\x00\x00\x00\x00\xf0\x48\xd9\xbd\xef\xe6\xaf\x49\x44" "\xcc\xbf\xdc\xdb\x78\xa4\xba\xb3\xb2\xae\x52\x5b\x06\x6c\xb6\x5a\xd9" "\x0d\x00\x4a\xe3\x16\x3f\x50\x5d\x96\xfe\x40\x75\x79\x8f\x0f\x24\x6b" "\x94\xf7\xb4\x3c\x69\xad\x33\x57\x33\x7d\xfa\x21\x4e\x06\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x80\xca\xd9\xbf\xd7\xfe\x7f\xa8\x2a\xfb\xff" "\xa1\xba\xec\xff\x87\xea\xca\xf7\xff\xef\x2b\xb9\x1d\xc0\xd6\xf3\x1e" "\x1f\x88\x35\x76\xf2\x17\xee\xff\x5f\xf3\x2c\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x60\x23\xcd\xcc\x5d\x39\x3f\x3e\x35\x35\x79\x59\xe2" "\xad\xed\xd1\x8c\xad\x4c\xd4\xeb\xf5\xab\xe9\x4f\xc1\x76\x69\xcf\xff" "\x3c\x91\x2f\x85\xdf\x2e\xed\x59\x96\xc8\xf7\xfa\x3d\xd8\x59\xe5\xfd" "\x4e\x02\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x9a\xfd\x17\x00\x00\xff\xff\x16\x12\x24\xc5", 1496); syz_mount_image(/*fs=*/0x200000000300, /*dir=*/0x2000000005c0, /*flags=MS_REC*/ 0x4000, /*opts=*/0x200000000600, /*chdir=*/0xd, /*size=*/0x5d8, /*img=*/0x200000000c00); break; case 1: // creat arguments: [ // file: ptr[in, buffer] { // buffer: {2e 2f 62 75 73 00} (length 0x6) // } // mode: open_mode = 0x0 (8 bytes) // ] // returns fd memcpy((void*)0x200000000040, "./bus\000", 6); res = syscall(__NR_creat, /*file=*/0x200000000040ul, /*mode=*/0ul); if (res != -1) r[0] = res; break; case 2: // mount arguments: [ // src: ptr[in, blockdev_filename] { // union blockdev_filename { // loop: loop_filename { // prefix: buffer: {2f 64 65 76 2f 6c 6f 6f 70} (length 0x9) // id: proc = 0x0 (1 bytes) // z: const = 0x0 (1 bytes) // } // } // } // dst: ptr[in, buffer] { // buffer: {2e 2f 62 75 73 00} (length 0x6) // } // type: nil // flags: mount_flags = 0x1000 (8 bytes) // data: nil // ] memcpy((void*)0x200000000380, "/dev/loop", 9); *(uint8_t*)0x200000000389 = 0x30 + procid * 1; *(uint8_t*)0x20000000038a = 0; memcpy((void*)0x200000000140, "./bus\000", 6); syscall(__NR_mount, /*src=*/0x200000000380ul, /*dst=*/0x200000000140ul, /*type=*/0ul, /*flags=MS_BIND*/ 0x1000ul, /*data=*/0ul); break; case 3: // open arguments: [ // file: ptr[in, buffer] { // buffer: {2e 2f 62 75 73 00} (length 0x6) // } // flags: open_flags = 0x185102 (8 bytes) // mode: open_mode = 0x0 (8 bytes) // ] // returns fd memcpy((void*)0x200000000080, "./bus\000", 6); res = syscall(__NR_open, /*file=*/0x200000000080ul, /*flags=O_SYNC|O_NOCTTY|O_DIRECT|O_CLOEXEC|O_RDWR*/ 0x185102ul, /*mode=*/0ul); if (res != -1) r[1] = res; break; case 4: // mmap arguments: [ // addr: VMA[0x800000] // len: len = 0x800000 (8 bytes) // prot: mmap_prot = 0x2 (8 bytes) // flags: mmap_flags = 0x28011 (8 bytes) // fd: fd (resource) // offset: intptr = 0x0 (8 bytes) // ] syscall(__NR_mmap, /*addr=*/0x200000000000ul, /*len=*/0x800000ul, /*prot=PROT_WRITE*/ 2ul, /*flags=MAP_STACK|MAP_POPULATE|MAP_FIXED|MAP_SHARED*/ 0x28011ul, /*fd=*/r[1], /*offset=*/0ul); break; case 5: // syz_mount_image$vfat arguments: [ // fs: ptr[in, buffer] { // buffer: {76 66 61 74 00} (length 0x5) // } // dir: ptr[in, buffer] { // buffer: {2e 2f 62 75 73 00} (length 0x6) // } // flags: mount_flags = 0x2000006 (8 bytes) // opts: ptr[inout, array[ANYUNION]] { // array[ANYUNION] { // union ANYUNION { // ANYBLOB: buffer: {73 68 6f 72 74 6e 61 6d 65 3d 6d 69 78 65 64 // 2c 75 74 66 38 3d 30 2c 75 74 66 38 3d 30 2c 73 68 6f 72 74 6e // 61 6d 65 3d 6d 69 78 65 64 2c 73 68 6f 72 74 6e 61 6d 65 3d 77 // 69 6e 39 35 2c 74 7a 3d 55 54 43 2c 6e 6f 6e 75 6d 74 61 69 6c // 3d 30 2c 75 6e 69 5f 78 6c 61 74 65 3d 30 2c 69 6f 63 68 61 72 // 73 65 74 3d 63 70 34 33 37 2c 73 68 6f 72 74 6e 61 6d 65 3d 77 // 69 6e 6e 74 2c 64 69 73 63 61 72 64 2c 73 68 6f 72 74 6e 61 6d // 65 3d 6d 69 78 65 64 2c 63 68 65 63 6b 3d 73 74 72 69 63 74 2c // 73 68 6f 72 74 6e 61 6d 65 3d 6d 69 78 65 64 2c 73 68 6f 72 74 // 6e 61 6d 65 3d 6d 69 78 65 64 2c 64 6f 73 31 78 66 6c 6f 70 70 // 79 2c 66 6c 75 73 68 2c 65 75 69 64 3c} (length 0xd9) // } // union ANYUNION { // ANYRESDEC: ANYRES64 (resource) // } // union ANYUNION { // ANYBLOB: buffer: {2c 6f 62 6a 5f 75 73 65 72 3d 03 00 00 e5 7f // 00 00 00 70 27 3b 32 31 e3 ae 29 18 e6 01 fc 94 9d 33 c8 0c d7 // e7 2f 85 69 cd 42 98 69 c1 57 99 47 b5 76 2a 49 f7 ec 9c e1 9e // 9a f7 c2 ac d3 6f b8 b5 7f 11 2d 34 10 34 01 f8 16 96 1f 6c b3 // 50 0f f1 76 ac fb ea 16 64 c2 72 f6 db b6 d4 3c d5 ee 7e ef fd // 06 f2 e6 40 3e b4 82 78 81 1f 2c 65 75 69 64 3d} (length 0x73) // } // union ANYUNION { // ANYRESDEC: ANYRES64 (resource) // } // union ANYUNION { // ANYBLOB: buffer: {11 00 f6 0a e3 0b 3c b5 ae 31 da 89 94 f1 b8 // 4b 12 be 26 31 82 20 12 e4 b0 b5 44 65 00 00 00 00 00 00 00 00 // 00 00 80 00} (length 0x28) // } // } // } // chdir: int8 = 0x25 (1 bytes) // size: len = 0x34f (8 bytes) // img: ptr[in, buffer] { // buffer: (compressed buffer with length 0x34f) // } // ] // returns fd_dir memcpy((void*)0x2000000000c0, "vfat\000", 5); memcpy((void*)0x200000000000, "./bus\000", 6); memcpy((void*)0x200000001740, "shortname=mixed,utf8=0,utf8=0,shortname=mixed,shortname=win95,tz=" "UTC,nonumtail=0,uni_xlate=0,iocharset=cp437,shortname=winnt," "discard,shortname=mixed,check=strict,shortname=mixed,shortname=" "mixed,dos1xfloppy,flush,euid<", 217); sprintf((char*)0x200000001819, "%020llu", (long long)0); memcpy( (void*)0x20000000182d, "\x2c\x6f\x62\x6a\x5f\x75\x73\x65\x72\x3d\x03\x00\x00\xe5\x7f\x00\x00" "\x00\x70\x27\x3b\x32\x31\xe3\xae\x29\x18\xe6\x01\xfc\x94\x9d\x33\xc8" "\x0c\xd7\xe7\x2f\x85\x69\xcd\x42\x98\x69\xc1\x57\x99\x47\xb5\x76\x2a" "\x49\xf7\xec\x9c\xe1\x9e\x9a\xf7\xc2\xac\xd3\x6f\xb8\xb5\x7f\x11\x2d" "\x34\x10\x34\x01\xf8\x16\x96\x1f\x6c\xb3\x50\x0f\xf1\x76\xac\xfb\xea" "\x16\x64\xc2\x72\xf6\xdb\xb6\xd4\x3c\xd5\xee\x7e\xef\xfd\x06\xf2\xe6" "\x40\x3e\xb4\x82\x78\x81\x1f\x2c\x65\x75\x69\x64\x3d", 115); sprintf((char*)0x2000000018a0, "%020llu", (long long)0); memcpy((void*)0x2000000018b4, "\x11\x00\xf6\x0a\xe3\x0b\x3c\xb5\xae\x31\xda\x89\x94\xf1\xb8\x4b" "\x12\xbe\x26\x31\x82\x20\x12\xe4\xb0\xb5\x44\x65\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x80\x00", 40); memcpy( (void*)0x2000000004c0, "\x78\x9c\xec\xdd\x3f\x6c\x1b\x65\x14\x00\xf0\xe7\x5e\x12\xa7\x11\x25" "\x1e\x90\x2a\x98\x0c\x1b\x12\xaa\x9a\x20\x06\x98\x12\x55\x45\xaa\xc8" "\x00\x45\x16\xff\x16\x2c\x9a\xf2\x27\x36\x95\x62\x61\x29\x0c\x71\xbc" "\x80\x2a\x26\x10\x0b\x12\x4c\x6c\x1d\x60\xec\x8c\x18\x10\x62\x63\x60" "\xa5\x48\xa8\x80\x58\xe8\x56\xa9\x11\x87\x6c\x9f\xed\x73\xec\x50\x67" "\x70\x68\xc5\xef\x37\x44\x4f\xef\xfb\xde\x7d\xef\x2e\xa7\xdc\x25\x4a" "\xbe\xbc\xde\x8a\xad\x4b\xf3\x71\xf9\xd6\xad\x9b\xb1\xb8\x58\x88\xb9" "\xb5\x73\x6b\x71\xbb\x10\xa5\x38\x11\x49\xf4\xec\xc5\x44\x1f\x2d\x4c" "\xce\x03\x00\xf7\xb8\xdb\x69\x1a\x7f\xa5\x3d\x77\x9f\xfd\xc9\x52\x3f" "\xf2\xec\x07\x80\xfb\x57\xf7\xf9\xff\xe6\xa9\x61\xa2\x78\x84\xe2\xab" "\x0f\xcc\xa2\x25\x00\x60\xc6\xa6\xfc\xfe\xff\xf9\x89\xd9\x2b\x33\x6b" "\x0b\x00\x98\xa1\xb1\xe7\xff\x63\x23\xc3\x07\x7e\xcc\x3f\x37\xf8\x9d" "\x00\x00\xe0\xfe\xf5\xe2\x2b\xaf\x3e\xb7\xbe\x11\x71\xb1\x5c\x5e\x8c" "\xa8\x7f\xd8\xac\x34\x2b\xf1\xcc\x70\x7c\xfd\x72\xbc\x1d\xb5\xd8\x8c" "\xb3\xb1\x1c\xfb\x11\xbd\x17\x85\xde\xdb\x42\xe7\xe3\xb3\x17\x36\xce" "\x9f\x2d\x77\xfc\x56\x8a\x4a\xa7\xa2\x59\x89\xa8\xb7\x9a\x95\xde\x9b" "\xc2\x7a\xd2\xad\x2f\xc6\x4a\x2c\x47\x29\xab\x4f\x07\xf5\x49\xa7\x7e" "\xa5\x5b\x5f\x8e\x88\xbd\x56\x77\xfd\xa8\x17\x9a\x95\xf9\x58\xca\xd6" "\xff\x79\x29\x36\x63\x35\x96\xe3\xa1\xb1\xfa\x88\x0b\x1b\xe7\x57\xcb" "\xd9\x01\x2a\xf5\x7e\x7d\x2b\xa2\x1d\x8b\xfd\x93\xe8\xf4\x7f\x26\x96" "\xe3\xc7\x37\xe2\x4a\xd4\xe2\x52\x74\x6a\x87\xfd\xef\xae\x94\xcb\xe7" "\xd2\x8d\x91\xfa\xe6\xb5\x62\x77\x1e\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\xcc\xc2\x99\xf2\x40\x69\xb0\xff" "\x4d\x5a\x6f\x35\x3f\xb8\x78\x70\x42\x69\x64\x7f\x9c\x4a\x6f\x38\xdb" "\x1f\xa8\xdd\xdb\x1f\x28\x2d\xf6\x77\xe7\xb9\x9a\x1c\xdc\x1f\x68\x74" "\x7f\x9e\x66\x65\x2e\x4e\xfc\xa7\x67\x0e\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\xf7\x8e\xc6\xce\x42\x54\x6b\xb5\xcd" "\xed\xc6\xce\xfb\x5b\xf9\xa0\x95\xcb\xbc\xfb\xfd\x57\xdf\x9e\x8c\xfe" "\xd0\x5c\x56\xfa\x4e\x32\xac\x8a\x2c\x39\x72\x9c\xfe\xc4\xdc\x91\x93" "\x18\x2c\x91\x0e\xca\xd3\x64\x64\x4e\x16\x24\x11\xfd\xc9\x7b\xd5\x6b" "\xd7\x07\x1d\xe7\xe7\x14\x07\x67\x31\x56\xde\x09\x8a\x63\x43\x85\xac" "\xa7\x6a\xad\x76\xea\xd1\x5f\x3f\x9f\x54\xf5\x77\x27\xd8\xeb\x66\x92" "\x18\xbb\x2c\xa3\x41\x21\x5b\x3f\x37\x54\x7f\xb0\x93\x58\x8c\x88\xfd" "\xc3\xaa\x0e\x0f\x56\xef\x32\xe7\x46\x9a\xa6\x87\x95\xef\x7e\x36\x5e" "\x15\x85\x88\xb9\x38\x72\x1b\x53\x04\xdf\xdd\x7c\xeb\xe1\x27\x1b\xa7" "\x9f\xea\x66\xbe\xc9\x36\x7d\x78\xfc\x89\xe5\x97\x6e\x7c\xfa\xe5\x1f" "\x5b\xd5\x5a\xb4\x7b\x57\xa6\x56\x5b\xd8\x6e\xec\xa7\x53\x1c\xb9\xd3" "\xeb\xf8\x50\x92\xbb\x7f\x0a\xd9\x75\x2e\x4c\xb8\x13\x26\x07\xed\x61" "\xa6\xbd\xdd\xd8\xa9\x26\x3f\xfd\xf9\xf2\x23\x1f\xff\x70\x60\x72\x32" "\xf9\xfe\x49\xf3\x99\xf7\x0e\x5f\xeb\xeb\x83\x99\x85\x5e\x50\x88\x28" "\xf5\x2f\xc2\xbf\xb5\x3a\x3f\xe1\xe6\x9f\x1c\xbc\x76\x67\x70\xf7\x1e" "\xfd\x13\x77\xfa\x8b\xb5\xea\xf5\xdd\x5f\x7e\x9f\xb6\x2a\xf7\x45\xc2" "\x46\x1d\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x70" "\x2c\x72\x7f\x2b\x7e\x04\x4f\xbf\x30\xbb\x8e\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\xe0\xf8\x0d\xff\xff\x7f\x2e\x68\x8f" "\x65\xa6\x09\xee\xb4\x62\x7c\xa8\xb8\xb9\xdd\x38\x74\xf1\x93\xc7\x7a" "\xaa\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\xfc\x8f\xfd\x13\x00\x00\xff\xff\xad\x28\x73\x09", 847); syz_mount_image(/*fs=*/0x2000000000c0, /*dir=*/0x200000000000, /*flags=MS_LAZYTIME|MS_NOSUID|MS_NODEV*/ 0x2000006, /*opts=*/0x200000001740, /*chdir=*/0x25, /*size=*/0x34f, /*img=*/0x2000000004c0); break; case 6: // write$cgroup_pid arguments: [ // fd: fd_cgroup_pid (resource) // buf: ptr[in, pid] { // pid (resource) // } // len: bytesize = 0x12 (8 bytes) // ] sprintf((char*)0x200000000100, "0x%016llx", (long long)0); syscall(__NR_write, /*fd=*/r[0], /*buf=*/0x200000000100ul, /*len=*/0x12ul); break; case 7: // sendmsg$nl_route_sched arguments: [ // fd: sock_nl_route (resource) // msg: ptr[in, msghdr_netlink[netlink_msg_route_sched]] { // msghdr_netlink[netlink_msg_route_sched] { // addr: nil // addrlen: len = 0x21 (4 bytes) // pad = 0x0 (4 bytes) // vec: ptr[in, iovec[in, netlink_msg_route_sched]] { // iovec[in, netlink_msg_route_sched] { // addr: ptr[in, netlink_msg_route_sched] { // union netlink_msg_route_sched { // newqdisc: netlink_msg_t[const[RTM_NEWQDISC, int16], // tcmsg[AF_UNSPEC], rtm_tca_policy] { // len: len = 0x54 (4 bytes) // type: const = 0x10 (2 bytes) // flags: netlink_msg_flags = 0x1 (2 bytes) // seq: int32 = 0x0 (4 bytes) // pid: int32 = 0x0 (4 bytes) // payload: tcmsg[AF_UNSPEC] { // family: const = 0x0 (1 bytes) // tcm__pad1: const = 0x0 (1 bytes) // tcm__pad2: const = 0x0 (2 bytes) // ifindex: ifindex (resource) // tcm_handle: tcm_handle { // minor: tcm_handle_offsets = 0x9 (2 bytes) // major: tcm_handle_offsets = 0x0 (2 bytes) // } // tcm_parent: tcm_handle { // minor: tcm_handle_offsets = 0xf (2 bytes) // major: tcm_handle_offsets = 0x0 (2 bytes) // } // tcm_info: tcm_handle { // minor: tcm_handle_offsets = 0xe (2 bytes) // major: tcm_handle_offsets = 0xd (2 bytes) // } // } // attrs: array[rtm_tca_policy] { // union rtm_tca_policy { // TCA_RATE: nlattr_t[const[TCA_RATE, int16], // tc_estimator] { // nla_len: offsetof = 0x6 (2 bytes) // nla_type: const = 0x5 (2 bytes) // payload: tc_estimator { // interval: int8 = 0x9 (1 bytes) // ewma_log: int8 = 0x1 (1 bytes) // } // size: buffer: {} (length 0x0) // pad = 0x0 (2 bytes) // } // } // union rtm_tca_policy { // TCA_STAB: nlattr_tt[const[TCA_STAB, int16:14], 0, 1, // array[stab_policy]] { // nla_len: offsetof = 0x28 (2 bytes) // nla_type: const = 0x8 (1 bytes) // NLA_F_NET_BYTEORDER: const = 0x0 (0 bytes) // NLA_F_NESTED: const = 0x1 (1 bytes) // payload: array[stab_policy] { // stab_policy { // TCA_STAB_BASE: nlattr_t[const[TCA_STAB_BASE, // int16], tc_sizespec] { // nla_len: offsetof = 0x1c (2 bytes) // nla_type: const = 0x1a (2 bytes) // payload: tc_sizespec { // cell_log: int8 = 0x0 (1 bytes) // size_log: int8 = 0x0 (1 bytes) // cell_align: int16 = 0x491 (2 bytes) // overhead: int32 = 0x0 (4 bytes) // linklayer: linklayer = 0x0 (4 bytes) // mpu: int32 = 0x0 (4 bytes) // mtu: int32 = 0x0 (4 bytes) // tsize: len = 0x2 (4 bytes) // } // size: buffer: {} (length 0x0) // } // TCA_STAB_DATA: nlattr_t[const[TCA_STAB_DATA, // int16], array[int16]] { // nla_len: offsetof = 0x8 (2 bytes) // nla_type: const = 0x1b (2 bytes) // payload: array[int16] { // int16 = 0x0 (2 bytes) // int16 = 0x0 (2 bytes) // } // size: buffer: {} (length 0x0) // } // } // } // size: buffer: {} (length 0x0) // } // } // } // } // } // } // len: len = 0x54 (8 bytes) // } // } // vlen: const = 0x1 (8 bytes) // ctrl: const = 0x0 (8 bytes) // ctrllen: const = 0x0 (8 bytes) // f: send_flags = 0x80 (4 bytes) // pad = 0x0 (4 bytes) // } // } // f: send_flags = 0x0 (8 bytes) // ] *(uint64_t*)0x200000000180 = 0; *(uint32_t*)0x200000000188 = 0x21; *(uint64_t*)0x200000000190 = 0x200000000000; *(uint64_t*)0x200000000000 = 0x2000000007c0; *(uint32_t*)0x2000000007c0 = 0x54; *(uint16_t*)0x2000000007c4 = 0x10; *(uint16_t*)0x2000000007c6 = 1; *(uint32_t*)0x2000000007c8 = 0; *(uint32_t*)0x2000000007cc = 0; *(uint8_t*)0x2000000007d0 = 0; *(uint8_t*)0x2000000007d1 = 0; *(uint16_t*)0x2000000007d2 = 0; *(uint32_t*)0x2000000007d4 = 0; *(uint16_t*)0x2000000007d8 = 9; *(uint16_t*)0x2000000007da = 0; *(uint16_t*)0x2000000007dc = 0xf; *(uint16_t*)0x2000000007de = 0; *(uint16_t*)0x2000000007e0 = 0xe; *(uint16_t*)0x2000000007e2 = 0xd; *(uint16_t*)0x2000000007e4 = 6; *(uint16_t*)0x2000000007e6 = 5; *(uint8_t*)0x2000000007e8 = 9; *(uint8_t*)0x2000000007e9 = 1; *(uint16_t*)0x2000000007ec = 0x28; STORE_BY_BITMASK(uint16_t, , 0x2000000007ee, 8, 0, 14); STORE_BY_BITMASK(uint16_t, , 0x2000000007ef, 0, 6, 1); STORE_BY_BITMASK(uint16_t, , 0x2000000007ef, 1, 7, 1); *(uint16_t*)0x2000000007f0 = 0x1c; *(uint16_t*)0x2000000007f2 = 0x1a; *(uint8_t*)0x2000000007f4 = 0; *(uint8_t*)0x2000000007f5 = 0; *(uint16_t*)0x2000000007f6 = 0x491; *(uint32_t*)0x2000000007f8 = 0; *(uint32_t*)0x2000000007fc = 0; *(uint32_t*)0x200000000800 = 0; *(uint32_t*)0x200000000804 = 0; *(uint32_t*)0x200000000808 = 2; *(uint16_t*)0x20000000080c = 8; *(uint16_t*)0x20000000080e = 0x1b; *(uint16_t*)0x200000000810 = 0; *(uint16_t*)0x200000000812 = 0; *(uint64_t*)0x200000000008 = 0x54; *(uint64_t*)0x200000000198 = 1; *(uint64_t*)0x2000000001a0 = 0; *(uint64_t*)0x2000000001a8 = 0; *(uint32_t*)0x2000000001b0 = 0x80; syscall(__NR_sendmsg, /*fd=*/(intptr_t)-1, /*msg=*/0x200000000180ul, /*f=*/0ul); break; } } 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; for (procid = 0; procid < 5; procid++) { if (fork() == 0) { loop(); } } sleep(1000000); return 0; }