// https://syzkaller.appspot.com/bug?id=170ff42f3fe48272979898e0932d4cfa340d1b9e // autogenerated by syzkaller (https://github.com/google/syzkaller) #define _GNU_SOURCE #include #include #include #include #include #include #include #include uint64_t r[2] = {0xffffffffffffffff, 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*)0x20000200, "./file0\000", 8); syscall(__NR_mknod, /*file=*/0x20000200ul, /*mode=*/0x200ul, /*dev=*/0x700); memcpy((void*)0x200001c0, "./file0\000", 8); memcpy((void*)0x20000180, "cgroup\000", 7); syscall(__NR_mount, /*src=*/0x20000280ul, /*dst=*/0x200001c0ul, /*type=*/0x20000180ul, /*flags=*/0ul, /*data=*/0ul); memcpy((void*)0x20000040, "./file0\000", 8); res = syscall(__NR_openat, /*fd=*/0xffffff9c, /*file=*/0x20000040ul, /*flags=*/0ul, /*mode=*/0ul); if (res != -1) r[0] = res; memcpy((void*)0x20000000, "devices.deny\000", 13); res = syscall(__NR_openat, /*fd=*/r[0], /*file=*/0x20000000ul, /*flags=*/2ul, /*mode=*/0ul); if (res != -1) r[1] = res; memcpy((void*)0x20000080, "\x23\x21\x20\x2e\x2f\x66\x69\x6c\x65\x31\x20\x20\x63\x70\x75\x73\x65" "\x74\x2e\x6d\x65\x6d\x73\x00\x20\x0a\xac\x73\x10\x68\xc1\xb1\xf1\x92" "\x59\x60\x8b\xc2\x56\xb6\xc1\x2e\xb6\x50\x6f\xc1\xdd\x53\xc3\xe0\x97" "\x8a\x2a\x9b\xc5\x58\xa7\xe4\x34\x6c\x4a\xb0\x72\xba\x80\xd2\xa6\x7d" "\x9e\x66\xb9\xde\xcd\x7c\x63\x09\xbe\xee\x6b\x8d\x1b\xd9\x00\x56\x9b" "\x3b\x40\xd3\xf0\xf5\x19\x4a\x36\xe1\x61\xbe\xd0\x74\xd8\xde\x4b\x40" "\xe6\xfd\x0c\x5b\x80\x71\x84\x4d\xa3\xcb\x69\x87\x07\xb7\x6d\x58\xbc" "\x97\xde\xce\xf1\x15\x52\xbf\xfc\x65\x6a\x9f\x68", 131); syscall(__NR_write, /*fd=*/r[1], /*data=*/0x20000080ul, /*len=*/0x83ul); return 0; }