// https://syzkaller.appspot.com/bug?id=9303859d61a0e9fa9292f094287096b092897868 // autogenerated by syzkaller (https://github.com/google/syzkaller) #define _GNU_SOURCE #include #include #include #include #include #include #include #include #include uint64_t r[3] = {0xffffffffffffffff, 0xffffffffffffffff, 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)) { } // openat$rtc arguments: [ // fd: const = 0xffffffffffffff9c (8 bytes) // file: ptr[in, buffer] { // buffer: {2f 64 65 76 2f 72 74 63 30 00} (length 0xa) // } // flags: open_flags = 0x140 (4 bytes) // mode: const = 0x0 (2 bytes) // ] // returns fd_rtc memcpy((void*)0x200000000200, "/dev/rtc0\000", 10); res = syscall(__NR_openat, /*fd=*/0xffffffffffffff9cul, /*file=*/0x200000000200ul, /*flags=O_NOCTTY|O_CREAT*/ 0x140, /*mode=*/0); if (res != -1) r[0] = res; // sched_setscheduler arguments: [ // pid: pid (resource) // policy: sched_policy = 0x1 (8 bytes) // prio: nil // ] syscall(__NR_sched_setscheduler, /*pid=*/0, /*policy=SCHED_FIFO*/ 1ul, /*prio=*/0ul); // mkdirat arguments: [ // fd: fd_dir (resource) // path: ptr[in, buffer] { // buffer: {2e 2f 73 79 73 00} (length 0x6) // } // mode: open_mode = 0x1ff (8 bytes) // ] memcpy((void*)0x200000000040, "./sys\000", 6); syscall( __NR_mkdirat, /*fd=*/0xffffff9c, /*path=*/0x200000000040ul, /*mode=S_IXOTH|S_IWOTH|S_IROTH|S_IXGRP|S_IWGRP|S_IRGRP|S_IXUSR|S_IWUSR|0x100*/ 0x1fful); // mount arguments: [ // src: nil // dst: ptr[in, buffer] { // buffer: {2e 2f 73 79 73 00} (length 0x6) // } // type: ptr[in, buffer] { // buffer: {73 79 73 66 73 00} (length 0x6) // } // flags: mount_flags = 0x0 (8 bytes) // data: nil // ] memcpy((void*)0x2000000000c0, "./sys\000", 6); memcpy((void*)0x200000000100, "sysfs\000", 6); syscall(__NR_mount, /*src=*/0ul, /*dst=*/0x2000000000c0ul, /*type=*/0x200000000100ul, /*flags=*/0ul, /*data=*/0ul); // openat arguments: [ // fd: fd_dir (resource) // file: ptr[in, buffer] { // buffer: {2e 2f 73 79 73 2f 62 75 73 2f 70 6e 70 2f 64 65 76 69 63 65 // 73 2f 30 30 3a 30 30 2f 64 72 69 76 65 72 00} (length 0x23) // } // flags: open_flags = 0x0 (4 bytes) // mode: open_mode = 0x0 (2 bytes) // ] // returns fd memcpy((void*)0x200000000140, "./sys/bus/pnp/devices/00:00/driver\000", 35); res = syscall(__NR_openat, /*fd=*/0xffffff9c, /*file=*/0x200000000140ul, /*flags=*/0, /*mode=*/0); if (res != -1) r[1] = res; // openat arguments: [ // fd: fd_dir (resource) // file: ptr[in, buffer] { // buffer: {75 6e 62 69 6e 64 00} (length 0x7) // } // flags: open_flags = 0x1 (4 bytes) // mode: open_mode = 0x0 (2 bytes) // ] // returns fd memcpy((void*)0x200000000180, "unbind\000", 7); res = syscall(__NR_openat, /*fd=*/r[1], /*file=*/0x200000000180ul, /*flags=O_WRONLY*/ 1, /*mode=*/0); if (res != -1) r[2] = res; // write arguments: [ // fd: fd (resource) // buf: ptr[in, buffer] { // buffer: {30 30 3a 30 30 00} (length 0x6) // } // count: len = 0x6 (8 bytes) // ] memcpy((void*)0x2000000001c0, "00:00\000", 6); syscall(__NR_write, /*fd=*/r[2], /*buf=*/0x2000000001c0ul, /*count=*/6ul); // ioctl$KVM_CREATE_VCPU arguments: [ // fd: fd_kvmvm (resource) // cmd: const = 0xae41 (4 bytes) // id: intptr = 0x0 (8 bytes) // ] // returns fd_kvmcpu syscall(__NR_ioctl, /*fd=*/(intptr_t)-1, /*cmd=*/0xae41, /*id=*/0ul); // ioctl$F2FS_IOC_GET_FEATURES arguments: [ // fd: fd (resource) // cmd: const = 0x8004f50c (4 bytes) // arg: nil // ] syscall(__NR_ioctl, /*fd=*/r[0], /*cmd=*/0x8004f50c, /*arg=*/0ul); return 0; }