// https://syzkaller.appspot.com/bug?id=401361e302e3bc6130ca09fe977ab6b89b9d0962 // 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; } static long syz_open_dev(volatile long a0, volatile long a1, volatile long a2) { if (a0 == 0xc || a0 == 0xb) { char buf[128]; sprintf(buf, "/dev/%s/%d:%d", a0 == 0xc ? "char" : "block", (uint8_t)a1, (uint8_t)a2); return open(buf, O_RDWR, 0); } else { unsigned long nb = a1; char buf[1024]; char* hash; strncpy(buf, (char*)a0, sizeof(buf) - 1); buf[sizeof(buf) - 1] = 0; while ((hash = strchr(buf, '#'))) { *hash = '0' + (char)(nb % 10); nb /= 10; } return open(buf, a2 & ~O_CREAT, 0); } } //% 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[2] = {0xffffffffffffffff, 0xffffffffffffffff}; void execute_one(void) { intptr_t res = 0; if (write(1, "executing program\n", sizeof("executing program\n") - 1)) { } // mkdirat arguments: [ // fd: fd_dir (resource) // path: ptr[in, buffer] { // buffer: {2e 2f 64 65 62 75 67 00} (length 0x8) // } // mode: open_mode = 0x1ff (8 bytes) // ] memcpy((void*)0x200000000000, "./debug\000", 8); syscall( __NR_mkdirat, /*fd=*/0xffffff9c, /*path=*/0x200000000000ul, /*mode=S_IXOTH|S_IWOTH|S_IROTH|S_IXGRP|S_IWGRP|S_IRGRP|S_IXUSR|S_IWUSR|0x100*/ 0x1fful); // mount arguments: [ // src: nil // dst: ptr[in, buffer] { // buffer: {2e 2f 64 65 62 75 67 00} (length 0x8) // } // type: ptr[in, buffer] { // buffer: {64 65 62 75 67 66 73 00} (length 0x8) // } // flags: mount_flags = 0x0 (8 bytes) // data: nil // ] memcpy((void*)0x200000000000, "./debug\000", 8); memcpy((void*)0x200000000040, "debugfs\000", 8); syscall(__NR_mount, /*src=*/0ul, /*dst=*/0x200000000000ul, /*type=*/0x200000000040ul, /*flags=*/0ul, /*data=*/0ul); // openat arguments: [ // fd: fd_dir (resource) // file: ptr[in, buffer] { // buffer: {2e 2f 64 65 62 75 67 2f 64 79 6e 61 6d 69 63 5f 64 65 62 75 // 67 2f 63 6f 6e 74 72 6f 6c 00} (length 0x1e) // } // flags: open_flags = 0x2 (4 bytes) // mode: open_mode = 0x0 (2 bytes) // ] // returns fd memcpy((void*)0x200000000080, "./debug/dynamic_debug/control\000", 30); res = syscall(__NR_openat, /*fd=*/0xffffff9c, /*file=*/0x200000000080ul, /*flags=O_RDWR*/ 2, /*mode=*/0); if (res != -1) r[0] = res; // write arguments: [ // fd: fd (resource) // buf: ptr[in, buffer] { // buffer: {2b 70} (length 0x2) // } // count: len = 0x2 (8 bytes) // ] memcpy((void*)0x200000000100, "+p", 2); syscall(__NR_write, /*fd=*/r[0], /*buf=*/0x200000000100ul, /*count=*/2ul); // syz_open_dev$dvb_frontend arguments: [ // dev: ptr[in, buffer] { // buffer: {2f 64 65 76 2f 64 76 62 2f 61 64 61 70 74 65 72 23 2f 66 72 // 6f 6e 74 65 6e 64 23 00} (length 0x1c) // } // id: intptr = 0x0 (8 bytes) // flags: open_flags = 0x0 (8 bytes) // ] // returns fd_dvb_frontend memcpy((void*)0x200000000080, "/dev/dvb/adapter#/frontend#\000", 28); res = -1; res = syz_open_dev(/*dev=*/0x200000000080, /*id=*/0, /*flags=*/0); if (res != -1) r[1] = res; // syz_mount_image$hfsplus arguments: [ // fs: ptr[in, buffer] { // buffer: {68 66 73 70 6c 75 73 00} (length 0x8) // } // dir: ptr[in, buffer] { // buffer: {2e 2f 66 69 6c 65 30 00} (length 0x8) // } // flags: mount_flags = 0x88 (8 bytes) // opts: ptr[in, fs_options[hfsplus_options]] { // fs_options[hfsplus_options] { // elems: array[fs_opt_elem[hfsplus_options]] { // fs_opt_elem[hfsplus_options] { // elem: union hfsplus_options { // nobarrier: buffer: {6e 6f 62 61 72 72 69 65 72} (length 0x9) // } // comma: const = 0x2c (1 bytes) // } // fs_opt_elem[hfsplus_options] { // elem: union hfsplus_options { // nls: fs_opt["nls", stringnoz[codepages_names]] { // name: buffer: {6e 6c 73} (length 0x3) // eq: const = 0x3d (1 bytes) // val: buffer: {61 73 63 69 69} (length 0x5) // } // } // comma: const = 0x2c (1 bytes) // } // fs_opt_elem[hfsplus_options] { // elem: union hfsplus_options { // part: fs_opt["part", fmt[hex, int32]] { // name: buffer: {70 61 72 74} (length 0x4) // eq: const = 0x3d (1 bytes) // val: int32 = 0x101 (18 bytes) // } // } // comma: const = 0x2c (1 bytes) // } // fs_opt_elem[hfsplus_options] { // elem: union hfsplus_options { // decompose: buffer: {64 65 63 6f 6d 70 6f 73 65} (length 0x9) // } // comma: const = 0x2c (1 bytes) // } // fs_opt_elem[hfsplus_options] { // elem: union hfsplus_options { // gid: fs_opt["gid", fmt[hex, gid]] { // name: buffer: {67 69 64} (length 0x3) // eq: const = 0x3d (1 bytes) // val: gid (resource) // } // } // comma: const = 0x2c (1 bytes) // } // fs_opt_elem[hfsplus_options] { // elem: union hfsplus_options { // nobarrier: buffer: {6e 6f 62 61 72 72 69 65 72} (length 0x9) // } // comma: const = 0x2c (1 bytes) // } // fs_opt_elem[hfsplus_options] { // elem: union hfsplus_options { // uid: fs_opt["uid", fmt[hex, uid]] { // name: buffer: {75 69 64} (length 0x3) // eq: const = 0x3d (1 bytes) // val: uid (resource) // } // } // comma: const = 0x2c (1 bytes) // } // } // common: array[fs_opt_elem[fs_options_common]] { // } // null: const = 0x0 (1 bytes) // } // } // chdir: int8 = 0x44 (1 bytes) // size: len = 0x72f (8 bytes) // img: ptr[in, buffer] { // buffer: (compressed buffer with length 0x72f) // } // ] // returns fd_dir memcpy((void*)0x200000000100, "hfsplus\000", 8); memcpy((void*)0x200000000080, "./file0\000", 8); memcpy((void*)0x200000000140, "nobarrier", 9); *(uint8_t*)0x200000000149 = 0x2c; memcpy((void*)0x20000000014a, "nls", 3); *(uint8_t*)0x20000000014d = 0x3d; memcpy((void*)0x20000000014e, "ascii", 5); *(uint8_t*)0x200000000153 = 0x2c; memcpy((void*)0x200000000154, "part", 4); *(uint8_t*)0x200000000158 = 0x3d; sprintf((char*)0x200000000159, "0x%016llx", (long long)0x101); *(uint8_t*)0x20000000016b = 0x2c; memcpy((void*)0x20000000016c, "decompose", 9); *(uint8_t*)0x200000000175 = 0x2c; memcpy((void*)0x200000000176, "gid", 3); *(uint8_t*)0x200000000179 = 0x3d; sprintf((char*)0x20000000017a, "0x%016llx", (long long)0); *(uint8_t*)0x20000000018c = 0x2c; memcpy((void*)0x20000000018d, "nobarrier", 9); *(uint8_t*)0x200000000196 = 0x2c; memcpy((void*)0x200000000197, "uid", 3); *(uint8_t*)0x20000000019a = 0x3d; sprintf((char*)0x20000000019b, "0x%016llx", (long long)0); *(uint8_t*)0x2000000001ad = 0x2c; *(uint8_t*)0x2000000001ae = 0; memcpy( (void*)0x2000000001c0, "\x78\x9c\xec\xdd\x4f\x6c\x1c\x57\x19\x00\xf0\x6f\x76\xd7\x1b\x6f\x2a\xb9" "\xdb\x26\x69\x0b\x42\x8a\xd5\x88\x08\x1a\x48\x6c\x2f\x25\x41\x42\xc2\x54" "\x15\xf2\xa1\x82\x48\x5c\x7a\x35\x89\xd3\x58\x59\xbb\xc1\x76\x91\x13\x21" "\xe2\x00\x85\x23\x9c\x50\x0e\x3d\x14\x21\x73\xe8\x09\xf5\x80\x54\xc4\xa1" "\xa2\x9c\x91\x90\xb8\x22\xdf\x23\xf5\x5e\xf5\xc0\xa2\x99\x9d\xd9\xec\xae" "\xed\xdd\x75\x1d\xdb\xa9\xfb\xfb\x49\xb3\xf3\x66\xe6\xfd\xf9\xe6\xf3\xcc" "\xdb\xf5\x38\xd1\x06\xf0\x85\x35\xf7\x7a\x8c\x6d\x44\x12\x73\x17\x5e\x5b" "\x4f\xb7\xb7\x36\x1b\xcd\xad\xcd\xc6\x52\x51\x8e\x88\x13\x11\x51\x8a\xa8" "\xb4\x57\x91\x2c\x47\x24\x1f\x45\xcc\x46\x7b\x89\x2f\xa5\x3b\xf3\xee\x92" "\xdd\xc6\x79\xf9\xe1\x07\xef\x9c\x7f\xf0\x5e\xa3\xbd\x55\xc9\x97\xac\x7e" "\x69\x50\xbb\x47\x5a\x03\x46\xd8\xc8\x97\x98\x8c\x88\x72\xbe\x8e\xf1\x3d" "\x65\xa2\xb2\x5b\x7f\xd7\xe2\x95\x76\x7f\x5d\xee\xed\xa9\xeb\xa4\x13\x77" "\x9a\xb0\x73\x45\xe2\xe0\xa8\xb5\x3a\x92\xbc\xbc\xb1\x97\xe6\x23\xdc\xb7" "\xc0\x93\xee\x5e\x44\x79\x6c\x87\xfd\xf5\x88\x93\xf9\x5b\x69\xfa\x39\x20" "\xf2\xd9\xa1\x74\xc8\xe1\x3d\x76\x7b\x9a\xe5\x00\x00\x00\xe0\xc9\x54\x1e" "\x56\xe1\xe9\x88\x24\xd6\x63\xe2\x70\xc2\x01\x00\x00\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\xe3\x21\x69\x7f\x67\x60\x92\x2f\xa5\xa2\x3c\x19\x49\xf1\xfd\xff" "\xd5\x7c\x5f\xaa\x5a\x3d\xe2\x78\x07\xfb\xc6\x90\xe3\x6f\xdf\x38\xa4\x40" "\x00\x00\x00\x00\x00\x00\x00\xe0\x40\xbc\x9f\xff\xe1\xfe\xec\x27\xf1\x49" "\xac\xc7\x44\xb1\xbf\x95\x64\x7f\xf3\x7f\x31\xdb\x38\x9d\xbd\x3e\x15\x6f" "\xc5\x6a\x2c\xc4\x4a\x5c\x8c\xf5\x98\x8f\xb5\x58\x8b\x95\x98\x8e\x18\x9b" "\xe8\xea\xb0\xba\x3e\xbf\xb6\xb6\x32\xbd\xbd\xe5\x1f\x22\x6d\xd9\x6a\xb5" "\xee\xe5\x2d\x67\x22\xa2\xbe\xad\xe5\xcc\x2e\x81\x96\x1e\xf3\x89\x03\x00" "\x00\x00\x00\x00\x00\xc0\xf1\xf4\xcb\x98\x8b\x89\xa3\x0e\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\xba\x25\x11\xe5\xf6\x2a\x5b\x4e\x17\xe5" "\x7a\x94\x2a\x11\x31\x1e\x11\xd5\xb4\xde\x46\xc4\xdf\x8b\xf2\xe7\xd9\x87" "\x47\x1d\x00\x00\x00\x00\x1c\xbc\x5a\xbe\x9e\x48\xfe\xd7\x2e\xb4\x92\xec" "\x77\xfe\xe7\xb2\xdf\xfb\xc7\xe3\xad\x58\x8e\xb5\x58\x8c\xb5\x68\xc6\x42" "\x5c\xcf\x9e\x05\xb4\x7f\xeb\x2f\xfd\x7b\xa3\xd1\xdc\xda\x6c\x2c\xa5\xcb" "\xf6\x8e\xbf\xff\xf1\x9e\xe2\xc8\x7a\x8c\x88\x72\xdc\xdf\x65\xe4\xa9\xac" "\xc6\x99\x4e\x8b\xb9\xf8\x41\xfc\x38\x2e\xc4\x64\x5c\x8d\x95\x58\x8c\x9f" "\xc5\x7c\xac\xc5\x42\x4c\x46\x2d\x3d\x89\x98\x8f\x24\xea\xb5\xf6\xd3\x8b" "\x7a\x11\xe7\xce\xf1\xce\xf6\x6c\x5d\xed\x94\x5a\xed\xb3\x3d\xdb\x17\xeb" "\x0b\x69\x24\x95\x5a\xdc\x88\xc5\x2c\xb6\x8b\x71\xad\x1a\xed\xc7\x26\xd9" "\x39\xa4\x63\xbe\xd0\x35\xda\x5f\xab\x11\x7d\x23\xde\x4f\xb3\x93\x7c\x2f" "\x37\x62\x8e\xae\x77\xfd\xbc\x7e\x9f\x3f\x97\x29\x22\x7d\x7a\xc4\x3e\x0e" "\x46\x3d\x3b\xf3\xb1\x4e\x46\xa6\xd2\xdc\xe7\xd9\x78\x66\x70\xee\x07\x5e" "\x27\x3f\x1d\x3a\xd2\x74\x94\x3a\xcf\xa0\x4e\xe7\x23\x7c\xb8\xb5\x99\x6e" "\xf6\x8f\x54\xe4\xfc\x27\x7b\xc9\xf9\xc9\xf6\x6a\x3c\x7d\xf9\x4d\x6f\xce" "\x1f\xb7\x01\x8f\xd2\xc6\x76\xd8\xd7\x9f\x89\x99\x28\xe5\x57\x5f\xc4\x73" "\xbd\x39\xbf\xfd\xd5\x07\xcf\xf6\x36\xfe\xfa\x7f\xfe\x71\xf5\x66\x69\xf9" "\xd6\xcd\x1b\xab\x17\x0e\xf0\x94\xf6\x63\x72\x58\x85\x4e\x52\xfa\x33\xd1" "\xe8\xca\xc4\xf3\x83\xaf\xbe\x3c\x13\xcd\x34\x13\x1b\x23\x65\x62\x36\x76" "\xfa\x79\x8c\x8f\xd0\xf2\x10\x54\xf3\x6c\x64\x53\xd1\x88\xb3\xe5\xab\x59" "\x69\x3e\x5e\xec\xba\x04\xdf\x8c\xeb\xb1\x10\x97\x63\x2a\xa6\xe3\x4a\x4c" "\xc5\x77\x62\x26\x1a\x9d\x2b\x2c\x5d\xce\xf4\xe4\xb5\xd2\x58\xea\xcd\x49" "\x76\xaf\x95\xb6\xcf\x6f\xb5\x01\xc1\x9f\xfb\x5a\x57\xa5\xdf\x0e\xa9\x7c" "\xb8\xd2\xbc\x3c\xd3\x95\xd7\xee\x99\xae\x9e\x1d\xcb\xf7\xcc\xfe\x2e\xa6" "\xba\xae\xbe\x67\x07\x5f\x7d\xf7\x3f\x7e\xf5\x47\xed\xd2\x88\x33\x52\x3a" "\xfe\x97\xf3\x72\x3a\xc6\xaf\x3a\xef\x38\x4f\x82\x9e\x4c\xe4\x73\x73\x11" "\xdd\xa9\xc1\x99\xf8\x63\x2b\x7d\x5d\x6d\x2e\xdf\x5a\xb9\x39\x7f\x7b\xc4" "\xf1\xce\xe7\xeb\xf4\xb6\x7d\xbb\x77\x6e\xfe\xd3\xe8\x51\xf7\xbf\xbb\xef" "\x47\x11\x41\x7a\xbd\xa4\x33\x6e\x25\xdb\xca\x72\x52\x2b\xae\x97\xf4\xd8" "\xa9\x4e\xdd\xde\x7c\x55\xf3\xbf\xb8\xb4\xdb\xe5\xd7\xd9\xa9\x47\xc7\xce" "\x74\x8e\xd5\x63\x22\x16\xe3\x87\xbb\xde\xa9\xd5\xfc\x33\x5c\x4f\x4f\xf9" "\xfb\x44\x7a\xec\xf9\xee\x63\xff\x7d\x34\x73\x56\xf3\xcf\x37\xc5\xb1\x9e" "\x4f\x39\xf1\x66\x34\xb3\x4f\x21\x7d\x86\x4e\xd5\x00\x1c\xb2\x93\x2f\x9d" "\xac\xd6\x1e\xd6\xfe\x55\x7b\xb7\xf6\xeb\xda\xcd\xda\x6b\xe3\xaf\x9c\xb8" "\x72\xe2\x2b\xd5\x18\xfb\x67\xe5\x6f\xe5\xbf\x94\xfe\x5c\xfa\x6e\xf2\x52" "\xbc\x1b\xbf\x88\x89\xa3\x8e\x14\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x8e\x83\xd5\x3b\x77" "\x6f\xcd\x37\x9b\x0b\x2b\x9d\x42\x8c\xf7\xef\xe9\x2a\x94\x76\x3f\xb4\x7b" "\xa1\xba\xeb\x58\x83\x0b\x51\x1a\x5a\x67\xf3\xa9\xd1\x3a\x8c\x7a\xc4\xe0" "\xb1\x92\xbc\x50\xfd\x0c\x27\x78\xcc\x0a\xb5\xe8\xdb\x53\x7c\xbf\xd1\x7e" "\x7b\x7e\x3f\x22\xb2\x42\xb9\x28\xf4\xd4\xa9\xee\x3b\xf8\x64\xe8\x35\x56" "\x8a\x7d\x0e\x91\xe6\xe1\xb1\xe4\xb9\xd5\x6a\x27\x35\xdb\xd3\x2a\xef\xa1" "\x79\xa5\x68\xb5\x73\x9d\x4a\xac\x8e\xc7\xad\xf9\xa4\xd2\x77\xc7\x7d\xda" "\x6a\xb5\x4e\x74\xee\x82\xf1\xec\x47\xf0\x69\xab\xd5\x5d\xa7\x16\x5d\xb7" "\x0c\x70\xcc\x5d\x5a\x5b\xba\x7d\x69\xf5\xce\xdd\x6f\x2e\x2e\xcd\xbf\xb1" "\xf0\xc6\xc2\xf2\xcc\x95\xcb\x57\x2e\x37\xbe\x3d\xfd\xad\x4b\x37\x16\x9b" "\x0b\x53\xed\xd7\xa3\x8e\x12\x38\x08\xab\x77\xee\x96\x77\xd8\xbd\xd3\x37" "\x0f\x03\x00\x00\x00\x00\x00\x00\x00\x00\x00\x4f\x88\xfc\x5f\xff\xaf\x7d" "\xe6\xff\xcc\x50\x19\x52\xa7\xba\xb2\xba\xf3\xc8\x67\x0f\xfb\x54\x01\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\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\xcf\xa9\xb9\xd7\x63\x6c\x23\x92\x98\x9e\xba\x38\x95\x6e\x6f\x6d" "\x36\x9a\xe9\x12\x51\xef\xae\x56\x2a\x56\xd5\x48\x7e\x1e\x91\x7c\x14\x31" "\x1b\xed\xa5\xa7\x62\xb2\xdb\x38\x2f\x3f\xfc\xe0\x9d\xf3\x0f\xde\x6b\xb4" "\xb7\x2a\xf9\x92\xd5\x2f\x0d\x6a\x37\x9a\x8d\x7c\x89\xc9\x88\x28\xe7\xeb" "\xe1\x4e\xec\xd0\xcd\xf6\xfe\xae\x75\xf5\xb7\xd1\xd7\xa2\xd5\x1a\x65\x9c" "\xa4\x73\x86\x69\xc2\xce\x15\x89\x83\xa3\xf6\xff\x00\x00\x00\xff\xff\x19" "\xac\xf3\xa7", 1839); syz_mount_image(/*fs=*/0x200000000100, /*dir=*/0x200000000080, /*flags=MS_NOEXEC|MS_DIRSYNC*/ 0x88, /*opts=*/0x200000000140, /*chdir=*/0x44, /*size=*/0x72f, /*img=*/0x2000000001c0); // ioctl$FE_GET_PROPERTY arguments: [ // fd: fd_dvb_frontend (resource) // cmd: const = 0x80106f53 (4 bytes) // arg: ptr[inout, dtv_properties] { // dtv_properties { // num: int32 = 0x4 (4 bytes) // pad = 0x0 (4 bytes) // props: ptr[in, array[dtv_property]] { // array[dtv_property] { // dtv_property { // cmd: dtv_property_cmd = 0xa (4 bytes) // reserved: buffer: {00 00 00 00 00 00 00 00 00 00 00 00} // (length 0xc) u: union dtv_property_u { // data: int32 = 0x3a6 (4 bytes) // } // result: int32 = 0x8 (4 bytes) // } // dtv_property { // cmd: dtv_property_cmd = 0x25 (4 bytes) // reserved: buffer: {00 00 00 00 00 00 00 00 00 00 00 00} // (length 0xc) u: union dtv_property_u { // buffer: dtv_property_u_buffer { // data: buffer: {1a 1c e1 ba 1b 49 7d b1 00 00 04 00 00 00 // 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00} // (length 0x20) len: len = 0x20 (4 bytes) reserved1: buffer: // {00 00 00 00 00 00 00 00 00 00 00 00} (length 0xc) // reserved2: const = 0x0 (8 bytes) // } // } // result: int32 = 0x33 (4 bytes) // } // dtv_property { // cmd: dtv_property_cmd = 0x2b (4 bytes) // reserved: buffer: {00 00 00 00 00 00 00 00 00 00 00 00} // (length 0xc) u: union dtv_property_u { // data: int32 = 0x7c7 (4 bytes) // } // result: int32 = 0x9b10 (4 bytes) // } // dtv_property { // cmd: dtv_property_cmd = 0x3e (4 bytes) // reserved: buffer: {00 00 00 00 00 00 00 00 00 00 00 00} // (length 0xc) u: union dtv_property_u { // st: dtv_fe_stats { // len: len = 0x4 (1 bytes) // stat: array[dtv_stats] { // dtv_stats { // scale: fecap_scale = 0x2 (1 bytes) // u: union dtv_stats_u { // svalue: int64 = 0x80000000d (8 bytes) // } // } // dtv_stats { // scale: fecap_scale = 0x1 (1 bytes) // u: union dtv_stats_u { // svalue: int64 = 0x7 (8 bytes) // } // } // dtv_stats { // scale: fecap_scale = 0x1 (1 bytes) // u: union dtv_stats_u { // uvalue: int64 = 0xb (8 bytes) // } // } // dtv_stats { // scale: fecap_scale = 0x2 (1 bytes) // u: union dtv_stats_u { // uvalue: int64 = 0x100000001 (8 bytes) // } // } // } // } // } // result: int32 = 0x2 (4 bytes) // } // } // } // } // } // ] *(uint32_t*)0x200000000400 = 4; *(uint64_t*)0x200000000408 = 0x2000000006c0; *(uint32_t*)0x2000000006c0 = 0xa; memset((void*)0x2000000006c4, 0, 12); *(uint32_t*)0x2000000006d0 = 0x3a6; *(uint32_t*)0x200000000708 = 8; *(uint32_t*)0x20000000070c = 0x25; memset((void*)0x200000000710, 0, 12); memcpy((void*)0x20000000071c, "\x1a\x1c\xe1\xba\x1b\x49\x7d\xb1\x00\x00\x04\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", 32); *(uint32_t*)0x20000000073c = 0x20; memset((void*)0x200000000740, 0, 12); *(uint64_t*)0x20000000074c = 0; *(uint32_t*)0x200000000754 = 0x33; *(uint32_t*)0x200000000758 = 0x2b; memset((void*)0x20000000075c, 0, 12); *(uint32_t*)0x200000000768 = 0x7c7; *(uint32_t*)0x2000000007a0 = 0x9b10; *(uint32_t*)0x2000000007a4 = 0x3e; memset((void*)0x2000000007a8, 0, 12); *(uint8_t*)0x2000000007b4 = 4; *(uint8_t*)0x2000000007b5 = 2; *(uint64_t*)0x2000000007b6 = 0x80000000d; *(uint8_t*)0x2000000007be = 1; *(uint64_t*)0x2000000007bf = 7; *(uint8_t*)0x2000000007c7 = 1; *(uint64_t*)0x2000000007c8 = 0xb; *(uint8_t*)0x2000000007d0 = 2; *(uint64_t*)0x2000000007d1 = 0x100000001; *(uint32_t*)0x2000000007ec = 2; syscall(__NR_ioctl, /*fd=*/r[1], /*cmd=*/0x80106f53, /*arg=*/0x200000000400ul); } int main(void) { syscall(__NR_mmap, /*addr=*/0x1ffffffff000ul, /*len=*/0x1000, /*prot=*/0ul, /*flags=MAP_FIXED|MAP_ANONYMOUS|MAP_PRIVATE*/ 0x32ul, /*fd=*/(intptr_t)-1, /*offset=*/0ul); syscall(__NR_mmap, /*addr=*/0x200000000000ul, /*len=*/0x1000000, /*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=*/0x1000, /*prot=*/0ul, /*flags=MAP_FIXED|MAP_ANONYMOUS|MAP_PRIVATE*/ 0x32ul, /*fd=*/(intptr_t)-1, /*offset=*/0ul); const char* reason; (void)reason; loop(); return 0; }