| // WARNING: bad unlock balance in ucma_event_handler |
| // https://syzkaller.appspot.com/bug?id=d5222b3e1659e0aea19df562c79f216515740daa |
| // status:open |
| // 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> |
| |
| static void execute_one(); |
| extern unsigned long long procid; |
| |
| void loop() |
| { |
| while (1) { |
| execute_one(); |
| } |
| } |
| |
| uint64_t r[3] = {0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff}; |
| void execute_one() |
| { |
| long res = 0; |
| memcpy((void*)0x20000300, "/dev/infiniband/rdma_cm", 24); |
| res = syscall(__NR_openat, 0xffffffffffffff9c, 0x20000300, 2, 0); |
| if (res != -1) |
| r[0] = res; |
| memcpy((void*)0x20000040, "/dev/infiniband/rdma_cm", 24); |
| res = syscall(__NR_openat, 0xffffffffffffff9c, 0x20000040, 2, 0); |
| if (res != -1) |
| r[1] = res; |
| *(uint32_t*)0x200000c0 = 0; |
| *(uint16_t*)0x200000c4 = 0x18; |
| *(uint16_t*)0x200000c6 = 0xfa00; |
| *(uint64_t*)0x200000c8 = 3; |
| *(uint64_t*)0x200000d0 = 0x20000080; |
| *(uint16_t*)0x200000d8 = 2; |
| *(uint8_t*)0x200000da = 0; |
| *(uint8_t*)0x200000db = 0; |
| *(uint8_t*)0x200000dc = 0; |
| *(uint8_t*)0x200000dd = 0; |
| *(uint8_t*)0x200000de = 0; |
| *(uint8_t*)0x200000df = 0; |
| res = syscall(__NR_write, r[0], 0x200000c0, 0x20); |
| if (res != -1) |
| r[2] = *(uint32_t*)0x20000080; |
| *(uint32_t*)0x200003c0 = 3; |
| *(uint16_t*)0x200003c4 = 0x40; |
| *(uint16_t*)0x200003c6 = 0xfa00; |
| *(uint16_t*)0x200003c8 = 0xa; |
| *(uint16_t*)0x200003ca = htobe16(0); |
| *(uint32_t*)0x200003cc = 0; |
| *(uint64_t*)0x200003d0 = htobe64(0); |
| *(uint64_t*)0x200003d8 = htobe64(1); |
| *(uint32_t*)0x200003e0 = 0; |
| *(uint16_t*)0x200003e4 = 0xa; |
| *(uint16_t*)0x200003e6 = htobe16(0); |
| *(uint32_t*)0x200003e8 = 0; |
| *(uint8_t*)0x200003ec = -1; |
| *(uint8_t*)0x200003ed = 1; |
| *(uint8_t*)0x200003ee = 0; |
| *(uint8_t*)0x200003ef = 0; |
| *(uint8_t*)0x200003f0 = 0; |
| *(uint8_t*)0x200003f1 = 0; |
| *(uint8_t*)0x200003f2 = 0; |
| *(uint8_t*)0x200003f3 = 0; |
| *(uint8_t*)0x200003f4 = 0; |
| *(uint8_t*)0x200003f5 = 0; |
| *(uint8_t*)0x200003f6 = 0; |
| *(uint8_t*)0x200003f7 = 0; |
| *(uint8_t*)0x200003f8 = 0; |
| *(uint8_t*)0x200003f9 = 0; |
| *(uint8_t*)0x200003fa = 0; |
| *(uint8_t*)0x200003fb = 1; |
| *(uint32_t*)0x200003fc = 0; |
| *(uint32_t*)0x20000400 = r[2]; |
| *(uint32_t*)0x20000404 = 0; |
| syscall(__NR_write, r[0], 0x200003c0, 0x48); |
| memcpy((void*)0x20000140, "\x12\x00\x00\x00\x10\x00\x00\xfa", 8); |
| *(uint64_t*)0x20000148 = 0x20000000; |
| *(uint32_t*)0x20000150 = r[2]; |
| *(uint32_t*)0x20000154 = r[0]; |
| syscall(__NR_write, r[1], 0x20000140, 0x18); |
| } |
| |
| int main() |
| { |
| syscall(__NR_mmap, 0x20000000, 0x1000000, 3, 0x32, -1, 0); |
| for (;;) { |
| loop(); |
| } |
| } |