// https://syzkaller.appspot.com/bug?id=d4198208cd864aa9a7fe3bf9b94f9346a79c7d69
// 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>

uint64_t r[2] = {0xffffffffffffffff, 0xffffffff};
void loop()
{
  long res;
  memcpy((void*)0x20000000, "/dev/infiniband/rdma_cm", 24);
  res = syscall(__NR_openat, 0xffffffffffffff9c, 0x20000000, 2, 0);
  if (res != -1)
    r[0] = res;
  *(uint32_t*)0x20001800 = 0;
  *(uint16_t*)0x20001804 = 0x18;
  *(uint16_t*)0x20001806 = 0xfa00;
  *(uint64_t*)0x20001808 = 3;
  *(uint64_t*)0x20001810 = 0x200017c0;
  *(uint16_t*)0x20001818 = 0x13f;
  *(uint8_t*)0x2000181a = 0xb;
  *(uint8_t*)0x2000181b = 0;
  *(uint8_t*)0x2000181c = 0;
  *(uint8_t*)0x2000181d = 0;
  *(uint8_t*)0x2000181e = 0;
  *(uint8_t*)0x2000181f = 0;
  res = syscall(__NR_write, r[0], 0x20001800, 0x20);
  if (res != -1)
    r[1] = *(uint32_t*)0x200017c0;
  *(uint32_t*)0x20000240 = 0xb;
  *(uint16_t*)0x20000244 = 0x10;
  *(uint16_t*)0x20000246 = 0xfa00;
  *(uint64_t*)0x20000248 = 0x200005c0;
  *(uint32_t*)0x20000250 = r[1];
  *(uint32_t*)0x20000254 = 0x10001;
  syscall(__NR_write, r[0], 0x20000240, 0x18);
}

int main()
{
  syscall(__NR_mmap, 0x20000000, 0x1000000, 3, 0x32, -1, 0);
  loop();
  return 0;
}