// https://syzkaller.appspot.com/bug?id=dd363e7f1b3b438453a11b28953ffe739a190a4c // 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_bpf #define __NR_bpf 321 #endif #ifndef __NR_memfd_create #define __NR_memfd_create 319 #endif static unsigned long long procid; //% 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 32 00} (length 0x8) // } // flags: mount_flags = 0x3000812 (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 e5 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 98 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 22 a5 76 75 0d 55 9c 4e 12 4d 4c b7 29 3e 73 93 b7 // 72 86 fa 8c 6d c4 49 ed a0 a0 3d 34 23 82 e8 4d 6d 3c 29 ab 95 cc // 92 3f be 25 e1 34 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 e2 d5 0a 23 98 e7 3f f2 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 56 db ac 0e 5e bd // 00 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 2c f0} (length 0x153) // } // union ANYUNION { // ANYRESOCT: ANYRES64 (resource) // } // union ANYUNION { // ANYRES16: ANYRES16 (resource) // } // union ANYUNION { // ANYRES32: ANYRES32 (resource) // } // union ANYUNION { // ANYRESHEX: ANYRES64 (resource) // } // union ANYUNION { // ANYRES64: ANYRES64 (resource) // } // } // } // chdir: int8 = 0x11 (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, "./file2\000", 8); memcpy( (void*)0x200000000b00, "\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\xe5\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\x98\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\x22\xa5\x76\x75\x0d\x55\x9c\x4e\x12" "\x4d\x4c\xb7\x29\x3e\x73\x93\xb7\x72\x86\xfa\x8c\x6d\xc4\x49\xed\xa0\xa0" "\x3d\x34\x23\x82\xe8\x4d\x6d\x3c\x29\xab\x95\xcc\x92\x3f\xbe\x25\xe1\x34" "\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\xe2\xd5\x0a\x23\x98\xe7\x3f\xf2\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\x56\xdb\xac\x0e\x5e\xbd\x00\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\x2c\xf0", 339); sprintf((char*)0x200000000c53, "%023llo", (long long)-1); *(uint16_t*)0x200000000c6a = 0; *(uint32_t*)0x200000000c6c = 0; sprintf((char*)0x200000000c70, "0x%016llx", (long long)0); *(uint64_t*)0x200000000c82 = -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); syz_mount_image( /*fs=*/0x200000000180, /*dir=*/0x2000000000c0, /*flags=MS_LAZYTIME|MS_SYNCHRONOUS|MS_STRICTATIME|MS_NOSUID|MS_NODIRATIME*/ 0x3000812, /*opts=*/0x200000000b00, /*chdir=*/0x11, /*size=*/0x305, /*img=*/0x200000000340); // prlimit64 arguments: [ // pid: pid (resource) // res: rlimit_type = 0xe (8 bytes) // new: ptr[in, rlimit] { // rlimit { // soft: intptr = 0x8 (8 bytes) // hard: intptr = 0x8b (8 bytes) // } // } // old: nil // ] *(uint64_t*)0x200000000140 = 8; *(uint64_t*)0x200000000148 = 0x8b; syscall(__NR_prlimit64, /*pid=*/0, /*res=RLIMIT_RTPRIO*/ 0xeul, /*new=*/0x200000000140ul, /*old=*/0ul); // sched_setscheduler arguments: [ // pid: pid (resource) // policy: sched_policy = 0x2 (8 bytes) // prio: ptr[in, int32] { // int32 = 0x8 (4 bytes) // } // ] *(uint32_t*)0x200000000080 = 8; syscall(__NR_sched_setscheduler, /*pid=*/0, /*policy=SCHED_RR*/ 2ul, /*prio=*/0x200000000080ul); // connect$unix arguments: [ // fd: sock_unix (resource) // addr: nil // addrlen: len = 0x0 (8 bytes) // ] syscall(__NR_connect, /*fd=*/(intptr_t)-1, /*addr=*/0ul, /*addrlen=*/0ul); // sendmmsg$unix arguments: [ // fd: sock_unix (resource) // mmsg: nil // vlen: len = 0x0 (8 bytes) // f: send_flags = 0x0 (8 bytes) // ] syscall(__NR_sendmmsg, /*fd=*/(intptr_t)-1, /*mmsg=*/0ul, /*vlen=*/0ul, /*f=*/0ul); // bpf$PROG_LOAD arguments: [ // cmd: const = 0x5 (8 bytes) // arg: nil // size: len = 0x0 (8 bytes) // ] // returns fd_bpf_prog syscall(__NR_bpf, /*cmd=*/5ul, /*arg=*/0ul, /*size=*/0ul); // bpf$BPF_RAW_TRACEPOINT_OPEN arguments: [ // cmd: const = 0x11 (8 bytes) // arg: nil // size: len = 0x0 (8 bytes) // ] // returns fd_perf_base syscall(__NR_bpf, /*cmd=*/0x11ul, /*arg=*/0ul, /*size=*/0ul); // recvmmsg arguments: [ // fd: sock (resource) // mmsg: nil // vlen: len = 0x0 (8 bytes) // f: recv_flags = 0x2 (8 bytes) // timeout: nil // ] syscall(__NR_recvmmsg, /*fd=*/(intptr_t)-1, /*mmsg=*/0ul, /*vlen=*/0ul, /*f=MSG_PEEK*/ 2ul, /*timeout=*/0ul); // openat arguments: [ // fd: fd_dir (resource) // file: ptr[in, buffer] { // buffer: {2e 2f 66 69 6c 65 31 00} (length 0x8) // } // flags: open_flags = 0x107b42 (4 bytes) // mode: open_mode = 0x32 (2 bytes) // ] // returns fd memcpy((void*)0x200000000440, "./file1\000", 8); res = syscall( __NR_openat, /*fd=*/0xffffff9c, /*file=*/0x200000000440ul, /*flags=O_TRUNC|O_SYNC|O_NONBLOCK|O_NOCTTY|O_DIRECT|O_CREAT|0x2002*/ 0x107b42, /*mode=S_IWOTH|S_IWGRP|S_IRGRP*/ 0x32); if (res != -1) r[0] = res; // ftruncate arguments: [ // fd: fd (resource) // len: intptr = 0x6000000 (8 bytes) // ] syscall(__NR_ftruncate, /*fd=*/r[0], /*len=*/0x6000000ul); // 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 = 0x1000023 (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 = 0x1 (1 bytes) // size: len = 0x490 (8 bytes) // img: ptr[in, buffer] { // buffer: (compressed buffer with length 0x490) // } // ] // returns fd_dir memcpy((void*)0x2000000004c0, "ext4\000", 5); memcpy((void*)0x200000000000, "./file0\000", 8); *(uint8_t*)0x200000000540 = 0; memcpy( (void*)0x200000000580, "\x78\x9c\xec\xdd\x41\x6b\x5c\xd5\x1e\x00\xf0\xff\x9d\x24\x7d\x69\x9b\xbe" "\xa4\xef\xbd\x45\x5f\xc1\x5a\x6c\x25\x2d\xda\x99\xa4\xb1\x6d\x70\x51\x2b" "\x88\xae\x0a\x6a\xdd\xc7\x98\x4c\x42\xc8\x24\x13\x32\x93\xb6\x09\x45\x52" "\xfc\x00\x82\x88\x0a\xae\x5c\xb9\x11\xfc\x00\x82\xf4\x23\x88\x50\xd0\xbd" "\x88\x28\xa2\xad\x2e\x5c\xa8\x23\x33\xb9\xd3\xd6\x38\x93\x04\x4c\x73\x71" "\xe6\xf7\x83\xd3\x7b\xce\x3d\x33\xf3\x3f\xa7\x93\x39\x73\xcf\x3d\x97\xb9" "\x01\x74\xad\xe3\x11\x71\x29\x22\x7a\x22\xe2\x74\x44\x0c\xa6\xfb\x73\x69" "\x8a\xf5\x8d\x54\x7f\xdc\xdd\x3b\x37\xa6\xea\x29\x89\x5a\xed\xca\x0f\x49" "\x24\xe9\xbe\xe6\x6b\x25\xe9\xf6\x60\xfa\xb4\xfe\x88\x78\xf9\x85\x88\xd7" "\x92\xbf\xc6\xad\xac\xae\xcd\x4f\x96\x4a\xc5\xe5\xb4\x5c\xa8\x2e\x2c\x15" "\x2a\xab\x6b\x67\xe6\x16\x26\x67\x8b\xb3\xc5\xc5\xb1\xb1\xd1\xf3\xe3\x17" "\xc6\xcf\x8d\x8f\xec\x5a\x5f\x2f\x3e\xf7\xcd\x3b\x6f\x7e\xf8\xfc\xc5\x4f" "\x9f\xbc\xf6\xd5\xc4\x77\xa7\x5e\xaf\x37\x6b\x20\xad\x7b\xb0\x1f\xbb\x69" "\xa3\xeb\x7d\x8d\xff\x8b\xa6\xde\x88\x58\x7e\x18\xc1\x32\xd0\x93\xf6\xa7" "\x2f\xeb\x86\x00\x00\xb0\x23\xf5\x63\xfc\xff\x44\xc4\x63\x8d\xe3\xff\xc1" "\xe8\x69\x1c\xcd\x01\x00\x00\x00\x9d\xa4\xf6\xcc\x40\xfc\x9a\x44\xd4\x00" "\x00\x00\x80\x8e\x95\x6b\x5c\x03\x9b\xe4\xf2\xe9\xb5\x00\x03\x91\xcb\xe5" "\xf3\x1b\xd7\xf0\xfe\x2f\x0e\xe4\x4a\xe5\x4a\xf5\x89\x99\xf2\xca\xe2\xf4" "\xc6\xb5\xb2\x43\xd1\x97\x9b\x99\x2b\x15\x47\xd2\x6b\x85\x87\xa2\x2f\xa9" "\x97\x47\x1b\xf9\xfb\xe5\xb3\x9b\xca\x63\x11\x71\x38\x22\xde\x1e\xdc\xdf" "\x28\xe7\xa7\xca\xa5\xe9\xac\x4f\x7e\x00\x00\x00\x40\x97\x38\xb8\x69\xfe" "\xff\xf3\xe0\xc6\xfc\x1f\x00\x00\x00\xe8\x30\x43\x59\x37\x00\x00\x00\x00" "\x78\xe8\xcc\xff\x01\x00\x00\xa0\xf3\x99\xff\x03\x00\x00\x40\x47\x7b\xf1" "\xf2\xe5\x7a\xaa\x35\xef\x7f\x3d\x7d\x75\x75\x65\xbe\x7c\xf5\xcc\x74\xb1" "\x32\x9f\x5f\x58\x99\xca\x4f\x95\x97\x97\xf2\xb3\xe5\xf2\x6c\xe3\x37\xfb" "\x16\xb6\x7b\xbd\x52\xb9\xbc\xf4\x54\x2c\xae\x5c\x2f\x54\x8b\x95\x6a\xa1" "\xb2\xba\x36\xb1\x50\x5e\x59\xac\x4e\x34\xee\xeb\x3d\x51\x74\x9f\x68\x00" "\x00\x00\xd8\x7b\x87\x1f\xbd\xf5\x65\x12\x11\xeb\x4f\xef\x6f\xa4\xba\x7d" "\x69\x9d\xb9\x3a\x74\xb6\x5c\xd6\x0d\x00\x32\xd3\x93\x75\x03\x80\xcc\xf4" "\x66\xdd\x00\x20\x33\xe6\xf8\x40\xb2\x4d\x7d\x7f\xbb\x8a\xcf\x76\xbf\x2d" "\x00\x00\xc0\xc3\x31\xfc\x7f\xeb\xff\xd0\xad\xac\xff\x43\xf7\xb2\xfe\x0f" "\xdd\xcb\xfa\x3f\x74\x2f\x73\x7c\xc0\xfa\x3f\x00\x00\x74\xbe\x81\x46\x4a" "\x72\xf9\x74\x2d\x70\x20\x72\xb9\x7c\x3e\xe2\x50\xe3\xb6\x00\x7d\xc9\xcc" "\x5c\xa9\x38\x12\x11\xff\x8e\x88\x2f\x06\xfb\xfe\x55\x2f\x8f\x66\xdd\x68" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\xf8\x87\xa9\xd5\x92\xa8\x01\x00\x00\x00\x1d\x2d\x22\xf7\x6d\x92\xde" "\xff\x6b\x78\xf0\xe4\xc0\xe6\xf3\x03\xfb\x92\x5f\x06\x1b\xdb\x88\xb8\xf6" "\xfe\x95\x77\xaf\x4f\x56\xab\xcb\xa3\xf5\xfd\x3f\xde\xdb\x5f\x7d\x2f\xdd" "\x7f\x36\x8b\x33\x18\x00\x00\x00\xc0\x66\xcd\x79\x7a\x73\x1e\x0f\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xbb" "\xe9\xee\x9d\x1b\x53\xcd\xb4\x97\x71\xbf\x7f\x36\x22\x86\x5a\xc5\xef\x8d" "\xfe\xc6\xb6\x3f\xfa\x22\xe2\xc0\x4f\x49\xf4\x3e\xf0\xbc\x24\x22\x7a\x76" "\x21\xfe\xfa\xcd\x88\x38\xd2\x2a\x7e\x52\x6f\x56\x0c\xa5\xad\xd8\x1c\x3f" "\x17\x11\xfb\x33\x8e\x7f\x70\x17\xe2\x43\x37\xbb\x55\x1f\x7f\x2e\xb5\xfa" "\xfc\xe5\xe2\x78\x63\xdb\xfa\xf3\xd7\x9b\xa6\xbf\xab\xfd\xf8\x97\xbb\x37" "\xfe\xf5\xb4\x19\xff\x0e\xed\x30\xc6\xd1\xdb\x1f\x17\xda\xc6\xbf\x19\x71" "\xb4\xb7\xf5\xf8\xd3\x8c\x9f\xb4\x89\x7f\x62\x87\xf1\x5f\x7d\x65\x6d\xad" "\x5d\x5d\xed\x83\x88\xe1\x96\xdf\x3f\xc9\x9f\x62\x15\xaa\x0b\x4b\x85\xca" "\xea\xda\x99\xb9\x85\xc9\xd9\xe2\x6c\x71\x71\x6c\x6c\xf4\xfc\xf8\x85\xf1" "\x73\xe3\x23\x85\x99\xb9\x52\x31\xfd\xb7\x65\x8c\xb7\x1e\xf9\xe4\xf7\xad" "\xfa\x7f\xa0\x4d\xfc\xa1\x6d\xfa\x7f\x72\x87\xfd\xff\xed\xf6\xf5\x3b\xff" "\xdd\x22\xfe\xa9\x13\xad\xdf\xff\x23\x5b\xc4\xaf\xff\x4d\x3c\x9e\x7e\x0f" "\xd4\xeb\x87\x9b\xf9\xf5\x8d\xfc\x83\x8e\x7d\xf4\xf9\xb1\xad\xfa\x3f\xdd" "\xa6\xff\xdb\xbd\xff\xa7\x76\xd8\xff\xd3\x2f\xbd\xf1\xf5\x0e\x1f\x0a\x00" "\xec\x81\xca\xea\xda\xfc\x64\xa9\x54\x5c\x96\x91\x91\x91\xb9\x97\xc9\x7a" "\x64\x02\x00\x00\x76\xdb\xfd\x83\xfe\xac\x5b\x02\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\xdd\x6b\x2f\x7e\x4e\x2c\xeb\x3e\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\xec\xc4\x1f\x01\x00\x00\xff\xff\xd3\x07\xd4\x03", 1168); syz_mount_image( /*fs=*/0x2000000004c0, /*dir=*/0x200000000000, /*flags=MS_STRICTATIME|MS_REMOUNT|MS_RDONLY|MS_NOSUID*/ 0x1000023, /*opts=*/0x200000000540, /*chdir=*/1, /*size=*/0x490, /*img=*/0x200000000580); // prlimit64 arguments: [ // pid: pid (resource) // res: rlimit_type = 0xe (8 bytes) // new: nil // old: nil // ] syscall(__NR_prlimit64, /*pid=*/0, /*res=RLIMIT_RTPRIO*/ 0xeul, /*new=*/0ul, /*old=*/0ul); // sched_setscheduler arguments: [ // pid: pid (resource) // policy: sched_policy = 0x1 (8 bytes) // prio: nil // ] syscall(__NR_sched_setscheduler, /*pid=*/0, /*policy=SCHED_FIFO*/ 1ul, /*prio=*/0ul); // sched_setscheduler arguments: [ // pid: pid (resource) // policy: sched_policy = 0x2 (8 bytes) // prio: nil // ] syscall(__NR_sched_setscheduler, /*pid=*/0, /*policy=SCHED_RR*/ 2ul, /*prio=*/0ul); return 0; }