// https://syzkaller.appspot.com/bug?id=cdb658d8cbeff62a4d998e94be26bd578507e32c // autogenerated by syzkaller (https://github.com/google/syzkaller) #define _GNU_SOURCE #include #include #include #include #include #include #include #include #include uint64_t r[1] = {0xffffffffffffffff}; int main(void) { syscall(__NR_mmap, /*addr=*/0x1ffffffff000ul, /*len=*/0x1000, /*prot=*/0ul, /*flags=MAP_FIXED|MAP_ANONYMOUS|MAP_PRIVATE*/ 0x32ul, /*fd=*/(intptr_t)-1, /*offset=*/0ul); syscall(__NR_mmap, /*addr=*/0x200000000000ul, /*len=*/0x1000000, /*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=*/0x1000, /*prot=*/0ul, /*flags=MAP_FIXED|MAP_ANONYMOUS|MAP_PRIVATE*/ 0x32ul, /*fd=*/(intptr_t)-1, /*offset=*/0ul); const char* reason; (void)reason; intptr_t res = 0; if (write(1, "executing program\n", sizeof("executing program\n") - 1)) { } // mkdirat arguments: [ // fd: fd_dir (resource) // path: ptr[in, buffer] { // buffer: {2e 2f 6d 6e 74 00} (length 0x6) // } // mode: open_mode = 0x1ff (8 bytes) // ] memcpy((void*)0x200000004000, "./mnt\000", 6); syscall( __NR_mkdirat, /*fd=*/0xffffff9c, /*path=*/0x200000004000ul, /*mode=S_IXOTH|S_IWOTH|S_IROTH|S_IXGRP|S_IWGRP|S_IRGRP|S_IXUSR|S_IWUSR|0x100*/ 0x1fful); // getsockopt$TIPC_DEST_DROPPABLE arguments: [ // fd: sock_tipc (resource) // level: const = 0x10f (4 bytes) // opt: const = 0x81 (4 bytes) // val: ptr[out, int32] { // int32 = 0x0 (4 bytes) // } // len: ptr[inout, bytesize] { // bytesize = 0x4 (4 bytes) // } // ] *(uint32_t*)0x2000000000c0 = 4; syscall(__NR_getsockopt, /*fd=*/(intptr_t)-1, /*level=*/0x10f, /*opt=*/0x81, /*val=*/0x200000000080ul, /*len=*/0x2000000000c0ul); // add_key$user arguments: [ // type: ptr[in, buffer] { // buffer: {75 73 65 72 00} (length 0x5) // } // desc: ptr[in, key_desc] { // key_desc { // prefix: buffer: {73 79 7a} (length 0x3) // id: proc = 0xffffffffffffffff (1 bytes) // z: const = 0x0 (1 bytes) // } // } // payload: ptr[in, buffer] { // buffer: {} (length 0x0) // } // paylen: len = 0xc9 (8 bytes) // keyring: keyring (resource) // ] // returns user_key memcpy((void*)0x2000000003c0, "user\000", 5); memcpy((void*)0x200000000440, "syz", 3); *(uint8_t*)0x200000000443 = 0; *(uint8_t*)0x200000000444 = 0; syscall(__NR_add_key, /*type=*/0x2000000003c0ul, /*desc=*/0x200000000440ul, /*payload=*/0x2000000000c0ul, /*paylen=*/0xc9ul, /*keyring=*/0xfffffffd); // mount arguments: [ // src: ptr[in, blockdev_filename] { // union blockdev_filename { // filename: buffer: {00} (length 0x1) // } // } // dst: ptr[in, buffer] { // buffer: {2e 2f 6d 6e 74 00} (length 0x6) // } // type: ptr[in, buffer] { // buffer: {65 63 72 79 70 74 66 73 00} (length 0x9) // } // flags: mount_flags = 0x0 (8 bytes) // data: ptr[in, buffer] { // buffer: {65 63 72 79 70 74 66 73 5f 73 69 67 3d 73 79 7a 2c 65 63 72 // 79 70 74 66 73 5f 66 6e 65 6b 5f 73 69 67 3d 73 79 7a 2c 65 63 72 79 // 70 74 66 73 5f 63 69 70 68 65 72 3d 61 65 73 2c 65 63 72 79 70 74 66 // 73 5f 6b 65 79 5f 62 79 74 65 73 3d 31 36 00} (length 0x51) // } // ] memset((void*)0x200000000400, 0, 1); memcpy((void*)0x200000000000, "./mnt\000", 6); memcpy((void*)0x200000000480, "ecryptfs\000", 9); memcpy((void*)0x200000000500, "ecryptfs_sig=syz,ecryptfs_fnek_sig=syz,ecryptfs_cipher=aes,ecryptfs_" "key_bytes=16\000", 81); syscall(__NR_mount, /*src=*/0x200000000400ul, /*dst=*/0x200000000000ul, /*type=*/0x200000000480ul, /*flags=*/0ul, /*data=*/0x200000000500ul); // open arguments: [ // file: ptr[in, buffer] { // buffer: {2e 2f 6d 6e 74 00} (length 0x6) // } // flags: open_flags = 0x8000 (8 bytes) // mode: open_mode = 0x129 (8 bytes) // ] // returns fd memcpy((void*)0x2000000001c0, "./mnt\000", 6); res = syscall(__NR_open, /*file=*/0x2000000001c0ul, /*flags=O_LARGEFILE*/ 0x8000ul, /*mode=S_IXOTH|S_IXGRP|S_IRGRP|S_IRUSR*/ 0x129ul); if (res != -1) r[0] = res; // socket$nl_netfilter arguments: [ // domain: const = 0x10 (8 bytes) // type: const = 0x3 (8 bytes) // proto: const = 0xc (4 bytes) // ] // returns sock_nl_netfilter syscall(__NR_socket, /*domain=*/0x10ul, /*type=*/3ul, /*proto=*/0xc); // mkdirat arguments: [ // fd: fd_dir (resource) // path: ptr[in, buffer] { // buffer: {2e 2f 6d 6e 74 00} (length 0x6) // } // mode: open_mode = 0x343806076c12c449 (8 bytes) // ] memcpy((void*)0x200000000240, "./mnt\000", 6); syscall( __NR_mkdirat, /*fd=*/r[0], /*path=*/0x200000000240ul, /*mode=S_IXOTH|S_IXGRP|S_IXUSR|0x343806076c12c400*/ 0x343806076c12c449ul); return 0; }