// https://syzkaller.appspot.com/bug?id=20c4a7b5a6f4c32158f2b8ea3dd461bc1e9e9a4e
// autogenerated by syzkaller (https://github.com/google/syzkaller)

#define _GNU_SOURCE

#include <endian.h>
#include <errno.h>
#include <fcntl.h>
#include <setjmp.h>
#include <stdbool.h>
#include <stddef.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/ioctl.h>
#include <sys/mman.h>
#include <sys/mount.h>
#include <sys/stat.h>
#include <sys/syscall.h>
#include <sys/types.h>
#include <unistd.h>

#include <linux/loop.h>

#ifndef __NR_memfd_create
#define __NR_memfd_create 279
#endif
#ifndef __NR_mmap
#define __NR_mmap 222
#endif
#ifndef __NR_openat
#define __NR_openat 56
#endif
#ifndef __NR_write
#define __NR_write 64
#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 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;
}

uint64_t r[1] = {0xffffffffffffffff};

int main(void)
{
  syscall(__NR_mmap, /*addr=*/0x1ffff000ul, /*len=*/0x1000ul, /*prot=*/0ul,
          /*flags=*/0x32ul, /*fd=*/-1, /*offset=*/0ul);
  syscall(__NR_mmap, /*addr=*/0x20000000ul, /*len=*/0x1000000ul, /*prot=*/7ul,
          /*flags=*/0x32ul, /*fd=*/-1, /*offset=*/0ul);
  syscall(__NR_mmap, /*addr=*/0x21000000ul, /*len=*/0x1000ul, /*prot=*/0ul,
          /*flags=*/0x32ul, /*fd=*/-1, /*offset=*/0ul);
  intptr_t res = 0;
  memcpy((void*)0x20000040, "nilfs2\000", 7);
  memcpy((void*)0x20000a80, "./file0\000", 8);
  memcpy(
      (void*)0x20000ac0,
      "\x78\x9c\xec\xdd\x4d\x8c\x5b\x47\x1d\x00\xf0\x79\xde\xf5\xa6\xf9\x28\x71"
      "\x4a\x42\x97\x34\xb4\x09\x85\xb6\x7c\x74\xb7\xd9\x2c\xe1\x23\x82\xa4\x6a"
      "\x84\x44\xd4\x54\xdc\x2a\x55\x5c\xa2\x34\x2d\x11\x69\x40\xa4\x12\xb4\xea"
      "\x21\xc9\x89\x1b\xad\xaa\x70\xe5\x43\x9c\x7a\xa9\x00\x21\xd1\x0b\x8a\x7a"
      "\xe2\x52\x89\x46\xaa\x90\x7a\x2a\x1c\x38\x10\x05\xa9\x12\x07\x28\x24\x8b"
      "\xe2\x7d\xe3\xb5\xff\xb1\xf5\xec\x8d\xb3\x5e\xaf\x7f\x3f\x69\x76\xfc\xde"
      "\x8c\x3d\xf3\xde\x3e\x3f\xbf\xaf\x99\x49\xc0\xc4\xaa\x35\xff\x2e\x2e\xce"
      "\x16\x29\x5d\x7a\xeb\xf5\xa3\xff\x78\xe8\xef\x9b\x6f\xce\x39\xdc\xca\xd1"
      "\x68\xfe\x9d\x6e\x9b\xaa\xa7\x94\x8a\x72\x7a\x3a\x7c\xde\x07\x53\xcb\xf1"
      "\xf5\x0f\x5f\x39\xd9\x2d\x2e\xd2\x42\xf3\x6f\x9e\x4e\x4f\x5d\x6b\xbd\x77"
      "\x6b\x4a\xe9\x7c\xda\x9b\x2e\xa7\x46\xda\x7d\xe9\xca\x6b\xef\x2c\x3c\x79"
      "\xfc\xc2\xb1\x8b\xfb\xde\x7d\xe3\xd0\xd5\x3b\xb3\xf4\x00\x00\x30\x59\xbe"
      "\x7d\xf9\xd0\xe2\xae\xbf\xfe\xf9\xbe\x1d\x1f\xbd\x79\xff\x91\xb4\xa9\x35"
      "\x3f\x1f\x9f\x37\xca\xe9\x6d\xe5\x71\xff\x91\xf2\xc0\x3f\x1f\xff\xd7\x52"
      "\xe7\x74\xd1\x16\xda\xcd\x84\x7c\xd3\x65\xa8\x85\x7c\x53\x5d\xf2\xb5\x97"
      "\x53\x0f\xf9\xa6\x7b\x94\x3f\x13\x3e\xb7\xde\x23\xdf\xa6\x8a\xf2\xa7\xda"
      "\xe6\x75\x5b\x6e\x18\x67\x79\x3b\x6e\xa4\xa2\x36\xd7\x31\x5d\xab\xcd\xcd"
      "\x2d\x9f\x93\xa7\xe6\x79\xfd\x4c\x31\x77\xf6\xf4\x99\xe7\xce\x8d\xa8\xa2"
      "\xc0\xd0\xfd\xeb\x81\x94\xd2\xde\x31\x0a\x87\xd7\x41\x1d\x56\x19\x96\xd6"
      "\x41\x1d\xc6\x32\x1c\x59\x07\x75\xd8\xa0\x61\x69\xfb\xa8\xf7\x40\x00\xcb"
      "\xe2\xfd\xc2\x5b\x9c\x2f\x6e\x39\xb7\xbf\x1d\xad\xeb\x14\xd3\xfd\x95\x7f"
      "\xed\xf1\x5a\xf7\xf7\xc3\x10\xf4\xb3\xfd\x2b\x7f\x72\xcb\xff\xf5\x05\x7b"
      "\x1c\x86\x67\xa3\x6e\x4d\x79\xb9\xf2\xf7\x68\x5b\x39\x1d\xef\x23\xc4\xe7"
      "\x97\x7a\x7f\xff\xe2\x9d\x8e\xce\xb9\xf1\x7e\x44\xbd\xcf\x7a\xf6\xba\x8f"
      "\x30\x2e\xf7\x17\x7a\xd5\x73\x6a\x8d\xeb\xb1\x5a\xbd\xea\x1f\xb7\x8b\x8d"
      "\xea\xeb\x65\x9c\xd7\xc3\x37\x42\x7a\xfb\xf7\x27\xfe\x4f\xc7\xe5\x7f\x0c"
      "\x74\xf7\xef\x71\xbb\xfe\x2f\x08\x93\x1e\xd2\xf0\x3e\x6b\x69\xc4\xfb\x1f"
      "\x60\xfd\x8a\xcf\xcd\x2d\x95\x72\x7a\x7c\xae\x2f\xa6\x6f\xaa\x48\xbf\xab"
      "\x22\x7d\x73\x45\xfa\x96\x8a\xf4\xad\x15\xe9\x30\xc9\x7e\xf7\xe2\x4f\xd3"
      "\xab\xc5\xca\x79\x7e\x3c\xa7\x1f\xf4\x7a\x78\xbe\xce\x76\x77\x19\x7f\x6c"
      "\xc0\xfa\xc4\xeb\x91\x83\x96\x7f\xbb\xf7\x06\x6f\xb7\xfc\xf8\x3c\x31\xac"
      "\x67\x7f\x38\xf1\xf4\xa9\xaf\x3c\xfb\xcc\x95\xe5\xe7\xff\x8b\xd6\xf6\x7f"
      "\xa3\xdc\xde\xf3\xe9\x46\xa3\xfc\x6e\x5d\x2e\x33\xe4\xeb\x85\xf1\xba\x7a"
      "\xeb\xd9\xff\x46\x67\x39\xb5\x1e\xf9\xee\x09\xf5\xb9\xbb\x4b\xfe\xe6\xeb"
      "\x9d\x9d\xf9\x8a\x9d\x2b\x9f\x93\xda\xf6\x33\xb7\xd4\x63\xb6\xf3\x7d\xdb"
      "\x7b\xe5\xdb\xd3\x99\xaf\x11\xf2\x6d\x2e\xc3\x5d\xa1\xbe\xf1\xf8\x64\x4b"
      "\x78\x5f\x3e\xfe\xc8\xfb\xd5\xbc\xbe\xa6\xc3\xf2\xd6\xc3\x72\xcc\x84\x7a"
      "\xe4\xfd\xca\x8e\x32\x8e\xf5\x80\xd5\xc8\xdb\x63\xaf\xe7\xff\xf3\xf6\x39"
      "\x9b\xea\xc5\x73\xa7\xcf\x9c\x7a\xac\x9c\xce\xdb\xe9\x9f\xa6\xea\x9b\x6e"
      "\xce\xdf\xbf\xc6\xf5\x06\x6e\x5f\xbf\xed\x7f\x66\x53\x67\xfb\x9f\x6d\xad"
      "\xf9\xf5\x5a\xfb\x7e\x61\xfb\xca\xfc\xa2\x7d\xbf\xd0\x08\xf3\x17\x7a\xcc"
      "\x3f\x50\x4e\xe7\xdf\xb9\xef\x4e\x6d\x6e\xce\x9f\x3b\xf9\xfd\x33\xcf\x0e"
      "\x7b\xe1\x61\xc2\x9d\x7b\xe9\xe5\xef\x9d\x38\x73\xe6\xd4\x0f\xbd\x58\xf5"
      "\x8b\x6f\xae\x8f\x6a\x78\xe1\xc5\x10\x5f\x8c\x7a\xcf\x04\xdc\x69\xf3\x2f"
      "\xbe\xf0\x83\xf9\x73\x2f\xbd\xfc\xe8\xe9\x17\x4e\x3c\x7f\xea\xf9\x53\x67"
      "\x0f\x1c\x3c\x78\x60\x61\xe1\xe0\x57\x0f\x2c\xce\x37\x8f\xeb\xe7\xdb\x8f"
      "\xee\x81\x8d\x64\xe5\x47\x7f\xd4\x35\x01\x00\x00\x00\x00\x00\x00\x00\x00"
      "\x00\xfa\xf5\xa3\x63\x47\xaf\xbc\xf7\xf6\x97\xdf\x5f\x6e\xff\xbf\xd2\xfe"
      "\x2f\xb7\xff\xcf\x4f\xfe\xe6\xf6\xff\x3f\x09\xed\xff\x63\x3b\xf9\xdc\x0e"
      "\x3e\xb7\x03\xdc\xd1\x25\xbd\x99\x27\x74\xb0\x3a\x13\xf2\xd5\xcb\xf0\xf1"
      "\x50\xdf\x9d\xa1\x9c\x5d\xe1\x7d\x9f\x28\xe3\xd6\x38\x7e\x65\xfb\xff\x5c"
      "\x5c\xec\xd7\x35\xd7\xe7\xde\x30\x3f\xf6\xdf\x9b\xf3\x85\xee\x04\x6e\xe9"
      "\x2f\x65\x26\xf4\x41\x12\xc7\x0b\xfc\x74\x19\x5f\x2c\xe3\x5f\x25\x18\xa1"
      "\x62\x73\xf7\xd9\x65\x5c\xd5\xbf\x75\xde\xd6\x73\xff\x14\xfa\xa5\x18\x4f"
      "\xf9\xff\x96\xb7\x86\xdc\x8f\x49\x6e\xff\xdd\xb5\x5f\xa7\xb6\x7f\xf6\x8e"
      "\x35\xa8\x23\xc3\xb7\x16\xcd\x09\x47\xbd\x8c\x40\x77\xff\x1c\xa0\xff\xef"
      "\x62\x7a\x1d\xf4\x7d\x2c\x08\xc2\xd0\xc2\xd2\x52\xaf\x51\x3c\xfa\x1d\xc1"
      "\x06\x60\x38\xd6\x7a\xfc\xbd\x38\xfe\x67\xbe\xee\x99\xe3\xb3\x7f\xfc\xd6"
      "\x5d\x37\x43\xce\x76\xed\xf1\xce\xfd\x65\xec\xbf\x14\x06\xf1\x97\xf7\x3a"
      "\xa7\xd7\xfb\xf8\x93\xca\xdf\x58\xe3\x7f\xb6\xc6\xbf\xeb\x7b\xff\x17\x46"
      "\xcc\x6b\xac\xae\xdc\xff\xfc\xfc\xea\xfb\x6d\xc5\xa6\xdd\xfd\x96\x1f\x97"
      "\x3f\xf7\x03\xbd\x73\xb0\xf2\x3f\x2a\xcb\xcf\x4b\xf3\x70\xea\xaf\xfc\xa5"
      "\x5f\x86\xf2\xe3\x0d\xa1\x3e\xfd\x37\x94\xbf\xa5\xcf\xf2\x6f\x59\xfe\x3d"
      "\x29\x1d\x59\x45\xf9\xff\x2b\xcb\xcf\xab\xed\x91\x07\xfb\x2d\x7f\xb9\xc6"
      "\x45\xad\xb3\x1e\xf1\xba\x71\xbe\xff\x17\xaf\x1b\x67\xd7\xc3\xf2\xe7\xbe"
      "\x3d\x07\x5e\xfe\x55\x0e\xd4\x78\xa3\x2c\x1f\x26\xd9\xb8\x8c\x33\x3b\xa8"
      "\x30\xfe\x6f\xeb\xa0\x7d\xf5\xe3\xff\x96\xce\x0f\x77\xfc\xdf\x5e\xe2\x73"
      "\x18\x5f\x2a\xa7\xf3\x8e\x30\x3f\xe7\x10\xc7\x3b\x19\xb4\xfe\xf9\xf9\x8a"
      "\xfc\x3b\xb0\x2b\x7c\x7e\x51\xf1\xfb\x66\xfc\xdf\xf1\xf6\xb5\x32\x8e\xdf"
      "\x87\xbc\x9d\xc5\xf1\x7f\xf3\xf6\xd8\x28\x7f\xf2\xdb\xa6\x9b\xeb\x32\x4f"
      "\xd7\xbb\xac\xdb\x8d\xba\xaf\x81\x71\xf5\xc1\x18\x8d\xff\x5b\x5b\x07\x75"
      "\x10\x84\x61\x84\xd6\x38\x71\x23\xae\xc7\xd2\xd2\xd2\x9d\xbd\xa0\x55\x61"
      "\xa4\x85\x33\xf2\xf5\x3f\xea\xf3\x84\x51\x97\x3f\xea\xf5\x5f\x25\x8e\xff"
      "\x1b\x8f\xe1\xe3\xf8\xbf\x31\x3d\x8e\xff\x1b\xd3\xe3\xf8\xbf\x31\x3d\x8e"
      "\xaf\x17\xd3\xe3\xf8\xbf\x71\x7d\xc6\xf1\x7f\x63\xfa\xbd\xe1\x73\xe3\xf8"
      "\xc0\xb3\x15\xe9\x9f\xac\x48\xdf\xdd\x3d\xbd\x75\xda\x7e\x5f\xc5\xfb\xf7"
      "\x54\xa4\x7f\xaa\x22\x7d\x5f\x45\xfa\xfd\x15\xe9\x0f\x54\xa4\xdf\x53\x91"
      "\xfe\x60\x45\xfa\x67\x2a\xd2\x3f\x5b\x91\xfe\x50\x45\xfa\x23\x15\xe9\x9f"
      "\xab\x48\xdf\xe8\x72\x7b\x94\x49\x5d\x7e\x98\x64\xb1\x7d\x9e\xef\x3f\x4c"
      "\x8e\x7c\xff\xa7\xd7\xf7\x7f\x67\x45\x3a\x30\xbe\x7e\xf6\xe6\xfe\x27\x9e"
      "\xf9\xed\x77\x1a\xcb\xed\xff\x67\x5a\xd7\x43\xf2\x7d\xbc\xfc\x6c\x51\xbd"
      "\x3c\x77\xfe\x71\x39\x1d\xef\x7b\xa7\xb6\xe9\x9b\x69\x6f\x97\xd3\x7f\x0b"
      "\xe9\xeb\xfd\x7a\x07\x4c\x92\xd8\x7f\x46\xfc\x7d\x7f\xb8\x22\x1d\x18\x5f"
      "\xf9\x39\x2f\xdf\x6f\x98\x40\x45\xf7\x1e\x7b\xfa\xed\xb7\xaa\xd7\x71\x3e"
      "\xe3\xe5\xf3\x65\xfc\x85\x32\xfe\x62\x19\x3f\x5a\xc6\x73\x65\x3c\x5f\xc6"
      "\xfb\xcb\x78\x61\x8d\xea\xc7\x9d\xf1\xc4\x6f\x7e\x7f\xe8\xd5\x62\xe5\x7c"
      "\x7f\x7b\x48\xef\xf7\x79\xf2\xd8\x1e\xa8\xa3\x9f\xa8\x94\xd2\x81\x3e\xeb"
      "\x13\xaf\x0f\x0c\xfa\x3c\x7b\xec\xc7\x6f\x50\xb7\x5b\xfe\x2a\x9b\x83\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\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
      "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
      "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
      "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
      "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
      "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
      "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
      "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
      "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
      "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
      "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
      "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
      "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
      "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
      "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
      "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
      "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
      "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
      "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
      "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
      "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
      "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
      "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
      "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
      "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
      "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
      "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
      "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
      "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
      "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
      "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
      "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
      "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
      "\x00\x00\x00\x00\x00\x8c\x4c\xad\xf9\x77\x71\x71\xb6\x48\xe9\xd2\x5b\xaf"
      "\x1f\x7d\xfa\xf8\xe9\xf9\x9b\x73\x0e\xb7\x72\x34\x9a\x7f\xa7\xdb\xa6\xea"
      "\xad\xf7\xa5\xf4\x58\x19\x4f\x95\xf1\x2f\xca\x17\xd7\x3f\x7c\xe5\x64\x7b"
      "\x7c\xa3\x8c\x8b\xb4\x90\x8a\x54\xb4\xe6\xa7\xa7\xae\xb5\x4a\xda\x9a\x52"
      "\x3a\x9f\xf6\xa6\xcb\xa9\x91\x76\x5f\xba\xf2\xda\x3b\x0b\x4f\x1e\xbf\x70"
      "\xec\xe2\xbe\x77\xdf\x38\x74\xf5\xce\xad\x01\x00\x00\x00\xd8\xf8\xfe\x1f"
      "\x00\x00\xff\xff\x82\x07\x0e\xb9",
      2654);
  syz_mount_image(/*fs=*/0x20000040, /*dir=*/0x20000a80, /*flags=*/0x808,
                  /*opts=*/0x200000c0, /*chdir=*/1, /*size=*/0xa5e,
                  /*img=*/0x20000ac0);
  memcpy((void*)0x20000100, "./file1\000", 8);
  res = syscall(__NR_openat, /*fd=*/0xffffff9c, /*file=*/0x20000100ul,
                /*flags=*/0x141842ul, /*mode=*/0ul);
  if (res != -1)
    r[0] = res;
  memset((void*)0x20000140, 77, 1);
  syscall(__NR_write, /*fd=*/r[0], /*buf=*/0x20000140ul, /*count=*/1ul);
  return 0;
}