// https://syzkaller.appspot.com/bug?id=5ecbc557fcdb8a2864e876f690ef377db999c50f // 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_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, 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 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, loopfd = -1, 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) { memset(loopname, 0, sizeof(loopname)); snprintf(loopname, sizeof(loopname), "/dev/loop%llu", procid); if (setup_loop_device(data, size, loopname, &loopfd) == -1) return -1; 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"); } 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) { ioctl(loopfd, LOOP_CLR_FD, 0); close(loopfd); } 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 (;;) { 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; } } } uint64_t r[2] = {0xffffffffffffffff, 0xffffffffffffffff}; void execute_one(void) { intptr_t res = 0; memcpy((void*)0x20000040, "msdos\000", 6); memcpy((void*)0x20000000, "./file0\000", 8); memcpy((void*)0x20000100, "check=strict", 12); *(uint8_t*)0x2000010c = 0x2c; memcpy((void*)0x2000010d, "nodots", 6); *(uint8_t*)0x20000113 = 0x2c; memcpy((void*)0x20000114, "showexec", 8); *(uint8_t*)0x2000011c = 0x2c; memcpy((void*)0x2000011d, "nodots", 6); *(uint8_t*)0x20000123 = 0x2c; memcpy((void*)0x20000124, "flush", 5); *(uint8_t*)0x20000129 = 0x2c; memcpy((void*)0x2000012a, "dots", 4); *(uint8_t*)0x2000012e = 0x2c; memcpy((void*)0x2000012f, "uid", 3); *(uint8_t*)0x20000132 = 0x3d; sprintf((char*)0x20000133, "0x%016llx", (long long)0xee01); *(uint8_t*)0x20000145 = 0x2c; memcpy((void*)0x20000146, "nocase", 6); *(uint8_t*)0x2000014c = 0x2c; memcpy((void*)0x2000014d, "nodots", 6); *(uint8_t*)0x20000153 = 0x2c; memcpy((void*)0x20000154, "dos1xfloppy", 11); *(uint8_t*)0x2000015f = 0x2c; memcpy((void*)0x20000160, "usefree", 7); *(uint8_t*)0x20000167 = 0x2c; memcpy((void*)0x20000168, "tz=UTC", 6); *(uint8_t*)0x2000016e = 0x2c; memcpy((void*)0x2000016f, "nodots", 6); *(uint8_t*)0x20000175 = 0x2c; memcpy((void*)0x20000176, "dots", 4); *(uint8_t*)0x2000017a = 0x2c; memcpy((void*)0x2000017b, "dmask", 5); *(uint8_t*)0x20000180 = 0x3d; sprintf((char*)0x20000181, "%023llo", (long long)0x101); *(uint8_t*)0x20000198 = 0x2c; *(uint8_t*)0x20000199 = 0; memcpy( (void*)0x20000280, "\x78\x9c\xec\xdd\xb1\xea\xd3\x50\x14\x07\xe0\xd3\xda\xda\xe2\xd4\x4d\x10" "\x87\x80\x8b\x53\x51\x9f\xa0\x22\x15\xc4\x80\xa0\x74\xd0\x49\xa1\xba\xb4" "\x22\xd8\x25\x3a\xd5\xb7\xd0\xf7\xf3\x01\xa4\x53\xb7\x88\x4d\x6d\xb4\xd4" "\xad\xe9\xf5\xdf\x7e\xdf\x92\x03\x3f\x72\x73\x4f\x20\x37\x53\x6e\x5e\xdf" "\x7e\x3f\x9b\x7e\x58\xbc\xfb\x7e\xf3\x6b\xf4\xfb\xad\x68\x8f\x62\x14\xeb" "\x56\x0c\xa2\x1d\xbf\x2d\x03\x00\x38\x27\xeb\xb2\x8c\x1f\x65\x25\xf5\x5c" "\x00\x80\xd3\xf0\xfe\x07\x80\xcb\xf3\xe2\xe5\xab\xa7\x0f\xf3\x7c\xfc\x3c" "\xcb\xfa\x11\xab\x65\x31\x29\x26\xd5\xb1\xca\x1f\x3f\xc9\xc7\xf7\xb2\x8d" "\x41\x7d\xd6\xaa\x28\x26\xd7\x76\xf9\xfd\x2a\xcf\xfe\xce\xbb\x71\x63\x9b" "\x3f\x38\x98\x5f\x8f\xbb\x77\xaa\xfc\x57\xf6\xe8\x59\xbe\x97\xf7\x62\xda" "\x7c\xfb\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x90\xc4\x30\xdb\x39\xb8\xbf\xcf\x70\xf8\xaf\xbc\xaa\xfe\xd8\x1f\x68" "\x6f\xff\x9e\x4e\xdc\xea\x9c\xac\x0d\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\xb8\xd2\x16\x9f\x3e\xcf\xde\xcc\xe7\x6f\x3f\x5e" "\x46\xd1\x3d\xde\x80\x65\x99\xbe\x9d\x23\x17\x5f\x12\x5e\xfd\x5b\x44\xfc" "\x17\x37\xe1\x98\x45\x34\x31\x72\x44\x2c\x37\x45\x7b\xfb\x0c\x37\x33\xf9" "\x7a\x8d\xe8\xa5\x5a\x9c\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\xe0\xc2\xd4\x1f\xfd\xa6\x9e\x09\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\xa4\x53\xff\xff\xbf\x81\x22\x62\x53\xa4\xee\x11\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\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\xf3\xf7\x33\x00\x00\xff\xff\x0d\x39\x31\x95", 409); syz_mount_image(0x20000040, 0x20000000, 0x3a100c8, 0x20000100, 1, 0x199, 0x20000280); memcpy((void*)0x200000c0, "./file0\000", 8); res = syscall(__NR_open, 0x200000c0ul, 0x40c2ul, 0ul); if (res != -1) r[0] = res; memcpy((void*)0x20000400, "./file0\000", 8); res = syscall(__NR_open, 0x20000400ul, 0ul, 0ul); if (res != -1) r[1] = res; memcpy( (void*)0x20001400, "\xbb\x8f\x9f\x64\x09\x03\x12\x7a\x53\x52\x7c\x6f\xbf\xe6\x5d\x43\xb0\xe0" "\x58\x6f\x2d\x40\xc7\xe7\xdf\x58\xca\xc8\x34\x20\xe8\x36\x62\xd6\xe3\x9b" "\xb6\xd5\x43\x06\x22\x43\x14\x54\xee\xde\xea\xee\x42\x3d\x8f\x21\x0b\xc3" "\x52\x5f\xa7\x92\x7c\x18\xd5\xfb\xc9\x1a\xb1\x3c\x20\x41\x13\x60\x47\xd8" "\xda\x93\x75\x93\x4d\x00\xf3\x25\x49\x9b\xfe\x77\x12\x20\x8d\x38\x7d\x41" "\xc3\x18\x21\xc2\xa2\x2d\x13\x25\xb5\x56\x52\x8e\x9b\x79\x0b\x74\x05\x3d" "\x1e\xd6\x31\xc6\xec\x81\x26\xd3\x7c\x87\x21\x61\x73\x13\x8c\x00\xce\xf3" "\x96\x86\x80\x29\xaf\x5b\x76\xbe\xba\xc5\xe3\x8b\x74\xd8\xbb\xc6\xae\x66" "\xb6\xe2\x02\xb6\xd5\x05\x71\x03\x77\x71\x0e\xa7\xd4\x3e\xdf\x00\xe1\xa4" "\xc1\xc6\x70\xbb\x4c\x26\x3c\xe7\x77\xda\x81\xab\xdd\x5b\xa5\xa5\xc8\x2f" "\x67\x23\x2f\x9b\x4d\x6f\x21\xb2\xe6\xaf\xa8\xb3\x8e\x46\x42\xb0\xda\xa2" "\xac\xbc\x04\x78\xd8\x9b\x88\xe8\xb2\x09\x4d\x42\x48\x85\x5e\x5e\x81\x99" "\x2e\x60\xbe\x3a\xff\xf0\xf3\xc3\x79\x93\x50\x61\x54\x89\xa9\x01\xa6\x59" "\xab\xde\xca\x0c\x61\x5a\x62\x2e\xbf\x64\x17\x5f\x99\x03\x20\xe0\x35\x6d" "\x4a\x11\xed\x62\xef\xf7\x2b\x70\x9c\x23\xdd\x65\x94\x2e\x8b\x53\x4d\x7d" "\x77\x5d\x37\x0c\x1e\x43\x56\x54\xa2\x63\x4e\x6e\xe3\x64\x9c\x4c\x3b\xcb" "\xe3\x9e\x86\x6f\x1e\xb9\x97\x2a\xf1\xa9\xce\xf4\x2e\x70\x17\x98\xa5\x3d" "\xc9\x2a\x24\x2a\xad\xba\xc3\x43\xe1\x76\x5c\xf8\xea\x56\x65\xe2\x2d\xed" "\xa6\x97\x77\xe5\x2b\x1e\x9e\x5d\x3e\xdc\x02\x22\x56\x93\x9e\x1e\xee\x01" "\x34\x48\x29\x49\x11\x13\x9d\x5b\x9c\x62\x41\x04\x9f\xec\xdf\x9b\x31\xf4" "\xcd\xf6\xcf\xf6\x5d\x71\xb5\x07\x1e\xf7\x0e\x17\x98\x34\x7c\x88\x46\xaa" "\x5b\x90\x5e\x83\x05\x0e\x3e\x60\x69\x86\xed\x3f\x60\x3d\x18\xc5\xcd\xeb" "\x11\xcd\xa1\xce\x3a\xbd\xde\xa9\x37\x62\x31\xaf\x13\x0e\x19\xfc\x76\x01" "\xec\x1a\xb8\xcb\x5a\x7d\xe9\xe2\x17\x45\x47\xf1\x82\x25\xb0\x9a\x54\xfc" "\x87\x20\xdb\xb9\x1e\xb6\x9c\x1b\xe8\x8e\x60\x1c\x3c\x9d\xf4\xf2\x75\x8f" "\x39\xa5\x15\x19\x51\xb9\xc6\xdb\xb4\x19\xff\xd7\x83\xa3\x4c\x9f\xad\x10" "\xf2\x01\xb8\x72\x4d\x31\x86\x5e\x2f\xc1\xfc\xf4\x8d\xb2\xbe\x71\x30\x53" "\xb4\x3a\x0e\x39\x43\xc1\xe2\xb0\x8e\x8a\x26\xe9\x46\xc4\x39\xd8\x91\xdb" "\x2a\x80\xb5\xff\xa0\x54\xbc\x8d\x01\x77\xd3\x21\x40\x56\x25\x0c\x61\xa5" "\x37\xd2\xec\x76\x30\xfb\x90\x39\x5d\xf2\xcd\x6a\xa9\xc5\xe5\x73\x36\x5d" "\xb5\x80\x52\x0b\xdc\x3f\x1c\x6b\x2b\xe9\x92\xe1\x51\x6a\x4b\x81\x0a\x11" "\x93\x5d\xc7\x80\x69\x9e\x46\x1d\x97\x15\xf7\x0c\x6d\x10\x3f\xf4\x9b\xf1" "\x68\xf3\xcf\xf4\xc0\xd0\xd6\xba\x56\x71\xfc\xd2\x97\x54\x50\xb0\xe1\xa3" "\x47\x41\x39\xcb\x0f\x2d\x34\x76\xfc\xd8\x7a\x8b\xcc\xbe\xb2\xf5\xf8\xa8" "\x21\x01\x7b\x87\x9a\xa5\xb9\xd1\xfa\xfa\x9f\x4c\x42\x9a\x74\xcd\x2d\xa7" "\x82\x11\x4d\x97\xbf\x03\x17\x46\xa8\x17\xdd\x02\x93\xc4\xed\xdc\x3a\x9e" "\xcb\x5a\xfe\x49\x6f\x49\x71\x47\x4c\xcd\x82\x74\x49\x40\x9f\x07\xcf\x94" "\xdd\xa2\xe7\xdb\xe8\x52\x0b\x5a\xff\xf1\x0a\x7e\x3b\x0b\x42\x89\xa1\x67" "\xfc\x69\x26\x35\xb5\xb7\x42\x6d\x9e\x77\x1b\x95\x86\x0b\x09\xa3\xe7\x52" "\xc8\x67\x21\x3c\x77\x2e\x48\xba\x30\xa7\x8f\xee\xcc\x7f\xf2\x6e\x63\xe1" "\x74\x9c\x62\xb5\x2d\x37\x7a\xc5\xcc\x52\xdb\x83\x0c\x96\x5e\x04\xcc\xfc" "\xfb\x24\xce\xac\xc6\x9c\xfd\xc2\x09\x41\x24\xdd\x27\xb2\xd6\x8f\x69\x94" "\x76\xa2\x56\x2b\xab\x1d\xe1\x17\xff\xc2\xb0\x70\x2e\xe8\xb0\xb7\x7f\x85" "\xfe\xce\xc3\xa2\x5b\x37\xab\x7e\xb0\x62\x32\xc9\xa7\x3b\x44\x70\xf1\x72" "\x7c\x82\x58\x1d\x81\x94\x2a\xbf\x42\xd3\xea\x37\x95\x79\x27\xad\x3d\xbd" "\x0e\xbe\x46\x67\x8a\x9f\x4d\x25\xc4\x7a\xca\xac\x83\xc1\x42\x10\xa5\x4b" "\x71\xfe\xd4\x0d\xf0\x17\xe2\xbe\x27\xf0\x1e\x3e\x6e\xa3\xea\x38\x1c\xa1" "\x4e\xfd\x20\x28\x58\xe6\x53\x5a\xd4\xf7\x9a\x8c\xdf\x47\xe3\x85\xb7\x40" "\xa7\x0c\x14\xe3\x65\x17\x31\xa4\x5c\xc0\xca\x4a\x56\xf2\xe9\x03\xca\xd0" "\x38\x4e\xfc\xc3\x64\xca\xf6\x7e\x09\x55\x1d\x35\xc6\x82\xeb\xc9\x0a\x92" "\x86\xc4\xd2\x74\xba\x1b\x8c\xed\x74\x2e\xde\x4e\x55\xa6\x2d\xb7\xef\x9a" "\x96\xfd\xe2\xad\xd0\x5b\x41\x59\x9f\xd7\x2a\x79\xba\x28\x0c\xc1\x25\xcb" "\x26\x6e\xf2\x1b\x7e\xea\xfe\x3e\xe6\xaa\x78\xee\xf3\x3f\xc6\x64\x54\x54" "\x9c\x3e\xc2\x98\xcb\x68\x3a\x55\xa3\x22\x08\xcf\x6c\xe8\x8b\x56\x01\x66" "\x15\x9d\x59\xe6\x5f\x30\x54\x0f\x62\xc5\x43\x76\x52\xea\x7f\x2a\x02\xf8" "\x7c\xa2\x42\xdd\x22\x50\xf5\x8e\x75\x93\x8a\x9a\x3d\xed\x51\xae\x65\x98" "\xc2\xab\xa5\x32\x87\xff\x5c\xda\xab\x17\xbe\x7f\x43\x10\xf8\xe0\x7e", 1025); syscall(__NR_write, r[0], 0x20001400ul, 0x401ul); memcpy((void*)0x200001c0, "./file0\000", 8); syscall(__NR_unlink, 0x200001c0ul); syscall(__NR_sendfile, r[0], r[1], 0ul, 0x11f06ul); } 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); loop(); return 0; }