// KASAN: use-after-free Read in ip6_xmit
// https://syzkaller.appspot.com/bug?id=3567a0a3f7b3be10a4fcb3fa9dc3cff6c6171a74
// status:invalid
// autogenerated by syzkaller (http://github.com/google/syzkaller)

#define _GNU_SOURCE
#include <endian.h>
#include <stdint.h>
#include <string.h>
#include <sys/syscall.h>
#include <unistd.h>

long r[2];
void loop()
{
  memset(r, -1, sizeof(r));
  syscall(__NR_mmap, 0x20000000, 0xfff000, 3, 0x32, -1, 0);
  r[0] = syscall(__NR_socket, 0xa, 2, 0);
  *(uint16_t*)0x20e6f000 = 0xa;
  *(uint16_t*)0x20e6f002 = htobe16(0x4e22);
  *(uint32_t*)0x20e6f004 = 0;
  *(uint8_t*)0x20e6f008 = 0;
  *(uint8_t*)0x20e6f009 = 0;
  *(uint8_t*)0x20e6f00a = 0;
  *(uint8_t*)0x20e6f00b = 0;
  *(uint8_t*)0x20e6f00c = 0;
  *(uint8_t*)0x20e6f00d = 0;
  *(uint8_t*)0x20e6f00e = 0;
  *(uint8_t*)0x20e6f00f = 0;
  *(uint8_t*)0x20e6f010 = 0;
  *(uint8_t*)0x20e6f011 = 0;
  *(uint8_t*)0x20e6f012 = -1;
  *(uint8_t*)0x20e6f013 = -1;
  *(uint8_t*)0x20e6f014 = 0xac;
  *(uint8_t*)0x20e6f015 = 0x14;
  *(uint8_t*)0x20e6f016 = 0;
  *(uint8_t*)0x20e6f017 = 0xaa;
  *(uint32_t*)0x20e6f018 = 1;
  syscall(__NR_connect, r[0], 0x20e6f000, 0x1c);
  *(uint16_t*)0x20d94fe4 = 0xa;
  *(uint16_t*)0x20d94fe6 = htobe16(0x4e20);
  *(uint32_t*)0x20d94fe8 = 4;
  *(uint8_t*)0x20d94fec = 0xfe;
  *(uint8_t*)0x20d94fed = 0x80;
  *(uint8_t*)0x20d94fee = 0;
  *(uint8_t*)0x20d94fef = 0;
  *(uint8_t*)0x20d94ff0 = 0;
  *(uint8_t*)0x20d94ff1 = 0;
  *(uint8_t*)0x20d94ff2 = 0;
  *(uint8_t*)0x20d94ff3 = 0;
  *(uint8_t*)0x20d94ff4 = 0;
  *(uint8_t*)0x20d94ff5 = 0;
  *(uint8_t*)0x20d94ff6 = 0;
  *(uint8_t*)0x20d94ff7 = 0;
  *(uint8_t*)0x20d94ff8 = 0;
  *(uint8_t*)0x20d94ff9 = 0;
  *(uint8_t*)0x20d94ffa = 0;
  *(uint8_t*)0x20d94ffb = 0xaa;
  *(uint32_t*)0x20d94ffc = 9;
  syscall(__NR_connect, r[0], 0x20d94fe4, 0x1c);
  r[1] = syscall(__NR_socket, 0x18, 1, 1);
  *(uint16_t*)0x205fafd2 = 0x18;
  *(uint32_t*)0x205fafd4 = 1;
  *(uint32_t*)0x205fafd8 = 0;
  *(uint32_t*)0x205fafdc = r[0];
  *(uint16_t*)0x205fafe0 = 2;
  *(uint16_t*)0x205fafe2 = htobe16(0x4e21);
  *(uint32_t*)0x205fafe4 = htobe32(0xe0000002);
  *(uint8_t*)0x205fafe8 = 0;
  *(uint8_t*)0x205fafe9 = 0;
  *(uint8_t*)0x205fafea = 0;
  *(uint8_t*)0x205fafeb = 0;
  *(uint8_t*)0x205fafec = 0;
  *(uint8_t*)0x205fafed = 0;
  *(uint8_t*)0x205fafee = 0;
  *(uint8_t*)0x205fafef = 0;
  *(uint32_t*)0x205faff0 = 4;
  *(uint32_t*)0x205faff4 = 0;
  *(uint32_t*)0x205faff8 = 2;
  *(uint32_t*)0x205faffc = 0;
  syscall(__NR_connect, r[1], 0x205fafd2, 0x2e);
  *(uint64_t*)0x2055b000 = 0x20000000;
  *(uint32_t*)0x2055b008 = 0;
  *(uint64_t*)0x2055b010 = 0x20210fd0;
  *(uint64_t*)0x2055b018 = 3;
  *(uint64_t*)0x2055b020 = 0x20000000;
  *(uint64_t*)0x2055b028 = 0;
  *(uint32_t*)0x2055b030 = 4;
  *(uint32_t*)0x2055b038 = 3;
  *(uint64_t*)0x20210fd0 = 0x209bc000;
  *(uint64_t*)0x20210fd8 = 0;
  *(uint64_t*)0x20210fe0 = 0x20d71000;
  *(uint64_t*)0x20210fe8 = 0;
  *(uint64_t*)0x20210ff0 = 0x20c99000;
  *(uint64_t*)0x20210ff8 = 0;
  syscall(__NR_sendmmsg, r[1], 0x2055b000, 1, 0x20000000);
}

int main()
{
  loop();
  return 0;
}
