// https://syzkaller.appspot.com/bug?id=bf3ad150355f4910301875ebf126f262aef834fb // 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 #ifndef __NR_memfd_create #define __NR_memfd_create 319 #endif static unsigned long long procid; 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; } uint64_t r[1] = {0xffffffffffffffff}; 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; intptr_t res = 0; if (write(1, "executing program\n", sizeof("executing program\n") - 1)) { } // syz_mount_image$hfs arguments: [ // fs: ptr[in, buffer] { // buffer: {68 66 73 00} (length 0x4) // } // dir: ptr[in, buffer] { // buffer: {2e 2f 66 69 6c 65 31 00} (length 0x8) // } // flags: mount_flags = 0x1000802 (8 bytes) // opts: ptr[inout, array[ANYUNION]] { // array[ANYUNION] { // union ANYUNION { // ANYBLOB: buffer: {71 75 69 65 74 2c 63 6f 64 65 70 61 67 65 3d 63 // 70 38 36 30 2c 69 6f 63 68 61 72 73 65 74 3d 63 70 38 36 31 2c 00 // 80 8f ea d0 42 bd 35 dc 78 f7 f0 63 33 a5 e7 16 5b 82 71 e4 1a ee // 85 e5 9c bb 6c 2d f3 d4 e4 c1 6b 06 c7 3f 2e 3b 34 8a 7f ba 46 e2 // 86 37 8a 15 ee 51 6b ac 8d 48 13 c9 c3 d9 ce e1 dd b9 5d 1b bc f5 // 04 e0 65 b3 74 9a 1c bd 84 1e 68 5a 55 85 18 cf 0d b1 0b 55 88 59 // 46 e6 78 d0 a7 18 77 03 7a 09 00 00 00 07 00 84 88 79 ef 16 04 ca // dc 1f ac a3 aa 01 00 76 75 0d 55 9c 4e 12 4d 4c b7 29 3e 73 93 b7 // 72 86 fa 8c 6d c4 92 3f be 25 e1 34 f2 9e 28 d1 c4 21 32 0a 3b ff // aa 17 fc d6 b5 17 8e 32 2c c4 71 33 b3 81 1e 3d 3b c3 49 98 dc 7e // d0 29 83 4a d5 91 d9 d5 6c 41 06 3d 8d 91 3a 9f e8 e9 54 a4 e4 ca // 99 ce b5 73 7e 57 19 3c 5f 47 fd 63 b1 6c 8b 34 f2 76 db ac 0e 5e // bd 00 94 db f6 5c 78 82 4a 8e e2 c9 6e ff 86 c6 30 90 78 df 2c b1 // ca 10 51 ad 09 1a db fe e5 12 6d 8a 59 fa 54 38 73 4b c3 e8 cc 7b // 7e dc 10 71 6a 0a 9b 71 19 52 cd f9 65 86 e0 6f ba ce 21 dc 04 bd // b4 a1 a2 07 2c e5 f7} (length 0x14b) // } // union ANYUNION { // ANYRESOCT: ANYRES64 (resource) // } // union ANYUNION { // ANYRES32: ANYRES32 (resource) // } // union ANYUNION { // ANYRES32: ANYRES32 (resource) // } // union ANYUNION { // ANYRESHEX: ANYRES64 (resource) // } // union ANYUNION { // ANYRES8: ANYRES8 (resource) // } // } // } // chdir: int8 = 0x1 (1 bytes) // size: len = 0x305 (8 bytes) // img: ptr[in, buffer] { // buffer: (compressed buffer with length 0x305) // } // ] // returns fd_dir memcpy((void*)0x200000000180, "hfs\000", 4); memcpy((void*)0x2000000000c0, "./file1\000", 8); memcpy( (void*)0x200000000a80, "\x71\x75\x69\x65\x74\x2c\x63\x6f\x64\x65\x70\x61\x67\x65\x3d\x63\x70\x38" "\x36\x30\x2c\x69\x6f\x63\x68\x61\x72\x73\x65\x74\x3d\x63\x70\x38\x36\x31" "\x2c\x00\x80\x8f\xea\xd0\x42\xbd\x35\xdc\x78\xf7\xf0\x63\x33\xa5\xe7\x16" "\x5b\x82\x71\xe4\x1a\xee\x85\xe5\x9c\xbb\x6c\x2d\xf3\xd4\xe4\xc1\x6b\x06" "\xc7\x3f\x2e\x3b\x34\x8a\x7f\xba\x46\xe2\x86\x37\x8a\x15\xee\x51\x6b\xac" "\x8d\x48\x13\xc9\xc3\xd9\xce\xe1\xdd\xb9\x5d\x1b\xbc\xf5\x04\xe0\x65\xb3" "\x74\x9a\x1c\xbd\x84\x1e\x68\x5a\x55\x85\x18\xcf\x0d\xb1\x0b\x55\x88\x59" "\x46\xe6\x78\xd0\xa7\x18\x77\x03\x7a\x09\x00\x00\x00\x07\x00\x84\x88\x79" "\xef\x16\x04\xca\xdc\x1f\xac\xa3\xaa\x01\x00\x76\x75\x0d\x55\x9c\x4e\x12" "\x4d\x4c\xb7\x29\x3e\x73\x93\xb7\x72\x86\xfa\x8c\x6d\xc4\x92\x3f\xbe\x25" "\xe1\x34\xf2\x9e\x28\xd1\xc4\x21\x32\x0a\x3b\xff\xaa\x17\xfc\xd6\xb5\x17" "\x8e\x32\x2c\xc4\x71\x33\xb3\x81\x1e\x3d\x3b\xc3\x49\x98\xdc\x7e\xd0\x29" "\x83\x4a\xd5\x91\xd9\xd5\x6c\x41\x06\x3d\x8d\x91\x3a\x9f\xe8\xe9\x54\xa4" "\xe4\xca\x99\xce\xb5\x73\x7e\x57\x19\x3c\x5f\x47\xfd\x63\xb1\x6c\x8b\x34" "\xf2\x76\xdb\xac\x0e\x5e\xbd\x00\x94\xdb\xf6\x5c\x78\x82\x4a\x8e\xe2\xc9" "\x6e\xff\x86\xc6\x30\x90\x78\xdf\x2c\xb1\xca\x10\x51\xad\x09\x1a\xdb\xfe" "\xe5\x12\x6d\x8a\x59\xfa\x54\x38\x73\x4b\xc3\xe8\xcc\x7b\x7e\xdc\x10\x71" "\x6a\x0a\x9b\x71\x19\x52\xcd\xf9\x65\x86\xe0\x6f\xba\xce\x21\xdc\x04\xbd" "\xb4\xa1\xa2\x07\x2c\xe5\xf7", 331); sprintf((char*)0x200000000bcb, "%023llo", (long long)-1); *(uint32_t*)0x200000000be2 = -1; *(uint32_t*)0x200000000be6 = -1; sprintf((char*)0x200000000bea, "0x%016llx", (long long)0); *(uint8_t*)0x200000000bfc = -1; memcpy( (void*)0x200000000340, "\x78\x9c\xec\xdd\x4d\x6b\x13\x5b\x1c\xc7\xf1\xdf\x99\xa4\x4d\x7a\x9b\xdb" "\x9b\x3e\x5c\x2e\xdc\x65\xb5\xa0\x1b\xd1\xba\x11\x37\x11\xc9\x5b\x10\xc4" "\x85\x68\xdb\x08\xc5\x50\x51\x2b\xa8\x1b\x53\x71\x25\xa2\x7b\xf7\xbe\x05" "\x5f\x84\x1b\xc5\x37\xa0\x2b\x17\xe2\x0b\x68\x37\x8e\x9c\x33\x0f\xc9\x24" "\x93\x99\x34\x24\x1d\x83\xdf\x0f\x88\x93\xc9\xfc\xe7\xfc\xcf\x3c\xfe\x4f" "\xa0\x1c\x01\xf8\x63\x5d\x6d\x7e\x79\x77\xf1\x9b\xfd\x67\xa4\x92\x4a\xd2" "\xcb\xcb\x92\x27\xa9\x2a\x95\x25\xfd\xab\xff\xaa\x8f\xf6\xf6\x77\xf7\xdb" "\xad\x9d\xac\x1d\x95\x5c\x84\x8e\x7c\x19\x05\x91\x66\x60\x9b\xed\xbd\x96" "\xfb\xff\x20\xb9\xda\xc6\xb9\x88\x50\xdd\x7e\x2a\xab\xd6\xbb\x0e\xd3\xe1" "\xfb\xfe\x95\xaf\x7d\xeb\xbe\x7b\x05\x25\x83\xc2\xb8\xbb\x3f\x85\x27\x55" "\xc2\xbb\xd3\x7d\x5f\x3d\xf1\xcc\xb2\x1d\x8c\x19\xd7\x99\x70\x1e\xb3\xc6" "\x1c\xea\x50\x8f\xb5\x54\x74\x1e\x00\x80\x62\xd9\xf7\xff\x41\x50\xf8\xdb" "\xf7\x7c\x2d\xac\xdf\x3d\x4f\xda\x08\x5f\xfb\xbf\xe5\xfb\x7f\x5c\x87\x45" "\x27\x30\x75\x7e\xe6\xb7\x3d\xef\x7f\x37\xca\xf2\x8d\x3d\xbf\xff\xb8\xaf" "\xba\xe3\x3d\x37\x84\xb3\xdf\x7b\xd1\x28\x71\x94\x96\xe7\xfa\x3e\xcf\x2b" "\x28\x24\x13\x05\xa6\x49\x1f\x55\x76\x87\x7c\x2e\x17\x6f\xe1\xce\x6e\xbb" "\x75\x6e\xfb\x5e\x7b\xc7\xd3\x73\x35\x42\x3d\x01\x6b\x71\x0b\x21\x7b\x85" "\xe6\x64\xbb\x9e\x32\x36\xcd\x30\x42\xdf\x4d\x6a\x45\x19\xa4\xe5\xcd\xd9" "\x3e\x6c\x0e\xc9\x7f\x75\xcc\x16\x33\x0c\x0c\xdf\x12\x27\xc4\x7c\x30\x9f" "\xcc\x4d\x53\xd7\x5b\xed\xc4\xf5\x5f\xd9\x37\x36\x5b\x97\x70\xbd\xef\x4c" "\x05\xf9\x9f\x1f\xde\xde\xa2\x8b\xb2\x5b\x29\x7c\x6c\x34\x1a\x0d\xcf\xed" "\x28\xb2\xec\x1a\xf9\x3f\x79\xa6\x72\x7a\x59\x4d\x1f\x91\x28\x3a\xb0\xcb" "\x4a\xfe\x40\x50\xcf\xcb\xd3\x45\xad\xf4\x45\x05\xbd\xbb\x90\x1a\x50\x89" "\xa3\x56\x53\xa3\x36\xa3\x4f\x43\xda\x5a\x4b\x44\xd9\xde\xc4\x57\xf3\xf0" "\x2c\xa7\xcd\xbc\x36\xd7\xcd\xba\x7e\xe8\xbd\x9a\x3d\xf5\xbf\x67\xf3\xdb" "\xd0\xf0\x3b\x33\xf1\x8b\x8e\xd9\x08\x6e\x34\x77\xc4\x83\xfe\xcc\xa7\x37" "\x57\x76\xfb\xac\x0f\xbc\x39\x3a\xba\x51\x4b\xae\x89\x8f\x62\x65\x58\xea" "\x47\xd9\xcf\x34\x8c\x20\x3a\x87\xaf\xb4\xa5\x4b\x5a\x7a\xf8\xe4\xe9\xdd" "\x52\xbb\xdd\x7a\x60\x17\x6e\xa7\x2c\xdc\xaf\xc5\x6b\xe6\x5e\x48\xa9\xdb" "\x14\xbc\xa0\x4e\x77\x4d\x45\xbe\x33\xb0\x71\xf4\x0c\x4c\x84\x2f\x84\x2b" "\xa7\x94\xd8\xd9\x89\xee\xd0\x3e\x3f\x72\x37\xb6\x77\xd9\x89\x1c\xf9\xde" "\x2b\x21\xba\x61\x27\xd6\x84\xbc\xe2\x2f\xad\xac\x6b\xa3\xf9\xb1\xef\x42" "\x9a\xd8\x82\x5f\x99\xf0\x0e\x7f\xfa\x63\x44\xfd\x7d\xc2\x0f\x25\x14\xa5" "\x7b\xd2\x8b\xce\x04\x05\xb1\x75\x97\x09\xc6\x7f\xae\x92\x0f\xeb\x7d\x57" "\xaf\xd9\x6a\xe1\x5a\x65\x78\x9d\x1e\x15\x64\x69\x25\x9b\xab\xde\xc3\x3d" "\xfa\xb6\xc6\x8e\x47\x40\xd5\x44\xfc\x8a\x5b\xfa\x2b\x59\x46\xe7\x8c\x0d" "\x16\xc3\x3a\x26\x65\x1c\xd7\xd1\x68\x63\xae\x53\x67\xa4\xd3\xa3\xb7\x58" "\x0f\xf3\x9c\x0d\xfe\xb3\x9c\x0d\x4c\x53\x9f\x75\x8b\xdf\xff\x01\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x66\xcd\xf1\xff\xae\x60" "\xe1\xd8\x51\x45\xf7\x11\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x80\x59\x17\xcf\xff\xab\x68\xfe\x5f\x8d\x36\xff\x6f\xff" "\x54\x2c\xe1\xfc\xbf\x55\xe5\xcc\xff\xbb\x35\x98\xc3\xc0\xfc\xbf\x6f\xf6" "\x64\x3a\x12\xf3\xff\x02\xd3\xf5\x2b\x00\x00\xff\xff\xff\x2c\x77\xb3", 773); res = -1; res = syz_mount_image( /*fs=*/0x200000000180, /*dir=*/0x2000000000c0, /*flags=MS_STRICTATIME|MS_NOSUID|MS_NODIRATIME*/ 0x1000802, /*opts=*/0x200000000a80, /*chdir=*/1, /*size=*/0x305, /*img=*/0x200000000340); if (res != -1) r[0] = res; // openat arguments: [ // fd: fd_dir (resource) // file: ptr[in, buffer] { // buffer: {2e 2f 66 69 6c 65 31 00} (length 0x8) // } // flags: open_flags = 0x1837c3 (4 bytes) // mode: open_mode = 0x43 (2 bytes) // ] // returns fd memcpy((void*)0x200000000000, "./file1\000", 8); syscall(__NR_openat, /*fd=*/0xffffff9c, /*file=*/0x200000000000ul, /*flags=O_TRUNC|O_SYNC|O_NOCTTY|O_EXCL|O_CREAT|O_CLOEXEC|0x2403*/ 0x1837c3, /*mode=S_IXOTH|S_IWOTH|S_IXUSR*/ 0x43); // getsockopt$inet_mptcp_buf arguments: [ // fd: sock_mptcp (resource) // level: const = 0x11c (4 bytes) // optname: mptcp_option_types_buf = 0x4 (4 bytes) // optval: nil // optlen: ptr[inout, len] { // len = 0x0 (4 bytes) // } // ] *(uint32_t*)0x2000000002c0 = 0; syscall(__NR_getsockopt, /*fd=*/r[0], /*level=*/0x11c, /*optname=MPTCP_FULL_INFO*/ 4, /*optval=*/0ul, /*optlen=*/0x2000000002c0ul); // syz_open_dev$tty1 arguments: [ // dev: const = 0xc (8 bytes) // major: const = 0x4 (8 bytes) // minor: intptr = 0x1 (8 bytes) // ] // returns fd_tty syz_open_dev(/*dev=*/0xc, /*major=*/4, /*minor=*/1); // sched_setscheduler arguments: [ // pid: pid (resource) // policy: sched_policy = 0x2 (8 bytes) // prio: ptr[in, int32] { // int32 = 0x8 (4 bytes) // } // ] *(uint32_t*)0x200000000080 = 8; syscall(__NR_sched_setscheduler, /*pid=*/0, /*policy=SCHED_RR*/ 2ul, /*prio=*/0x200000000080ul); // truncate arguments: [ // file: ptr[in, buffer] { // buffer: {2e 2f 66 69 6c 65 31 00} (length 0x8) // } // len: intptr = 0x2fffffd (8 bytes) // ] memcpy((void*)0x200000000940, "./file1\000", 8); syscall(__NR_truncate, /*file=*/0x200000000940ul, /*len=*/0x2fffffdul); return 0; }