| // possible deadlock in shmem_fallocate |
| // https://syzkaller.appspot.com/bug?id=71c4b526b8fc4c18622bc0235fc9e59bbdf5ef69 |
| // 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[1] = {0xffffffffffffffff}; |
| unsigned long long procid; |
| void execute_one() |
| { |
| long res = 0; |
| memcpy((void*)0x20b4508a, "/dev/ashmem", 12); |
| res = syscall(__NR_openat, 0xffffffffffffff9c, 0x20b4508a, 0, 0); |
| if (res != -1) |
| r[0] = res; |
| syscall(__NR_ioctl, r[0], 0x40087703, 2); |
| syscall(__NR_mmap, 0x206ff000, 0x3000, 0, 0x12, r[0], 0); |
| syscall(__NR_ioctl, r[0], 0x770a, 0); |
| memcpy((void*)0x20000080, "", 1); |
| syscall(__NR_ioctl, r[0], 0x40087708, 0x20000080); |
| } |
| |
| int main() |
| { |
| syscall(__NR_mmap, 0x20000000, 0x1000000, 3, 0x32, -1, 0); |
| for (procid = 0; procid < 8; procid++) { |
| if (fork() == 0) { |
| for (;;) { |
| loop(); |
| } |
| } |
| } |
| sleep(1000000); |
| return 0; |
| } |