// https://syzkaller.appspot.com/bug?id=45d96c8c21b7ac0cd10880ed63d6c19b05249631 // autogenerated by syzkaller (https://github.com/google/syzkaller) #define _GNU_SOURCE #include #include #include #include #include #include #include #include #ifndef __NR_open_tree #define __NR_open_tree 428 #endif int main(void) { syscall(__NR_mmap, /*addr=*/0x1ffffffff000ul, /*len=*/0x1000ul, /*prot=*/0ul, /*flags=MAP_FIXED|MAP_ANONYMOUS|MAP_PRIVATE*/ 0x32ul, /*fd=*/(intptr_t)-1, /*offset=*/0ul); syscall(__NR_mmap, /*addr=*/0x200000000000ul, /*len=*/0x1000000ul, /*prot=PROT_WRITE|PROT_READ|PROT_EXEC*/ 7ul, /*flags=MAP_FIXED|MAP_ANONYMOUS|MAP_PRIVATE*/ 0x32ul, /*fd=*/(intptr_t)-1, /*offset=*/0ul); syscall(__NR_mmap, /*addr=*/0x200001000000ul, /*len=*/0x1000ul, /*prot=*/0ul, /*flags=MAP_FIXED|MAP_ANONYMOUS|MAP_PRIVATE*/ 0x32ul, /*fd=*/(intptr_t)-1, /*offset=*/0ul); const char* reason; (void)reason; if (write(1, "executing program\n", sizeof("executing program\n") - 1)) { } // open_tree arguments: [ // dfd: fd_dir (resource) // filename: ptr[in, buffer] { // buffer: {00} (length 0x1) // } // flags: open_tree_flags = 0x9902 (8 bytes) // ] // returns fd memset((void*)0x200000000640, 0, 1); syscall( __NR_open_tree, /*dfd=*/0xffffff9c, /*filename=*/0x200000000640ul, /*flags=AT_SYMLINK_NOFOLLOW|AT_RECURSIVE|AT_NO_AUTOMOUNT|AT_EMPTY_PATH|0x2*/ 0x9902ul); return 0; }