// https://syzkaller.appspot.com/bug?id=8220a8f376ad410bb013c26c6b28f8c03bebb936 // autogenerated by syzkaller (https://github.com/google/syzkaller) #define _GNU_SOURCE #include #include #include #include #include #include #include #include #ifndef __NR_ioctl #define __NR_ioctl 29 #endif #ifndef __NR_mmap #define __NR_mmap 222 #endif #ifndef __NR_openat #define __NR_openat 56 #endif #ifndef __NR_prlimit64 #define __NR_prlimit64 261 #endif #ifndef __NR_sched_setscheduler #define __NR_sched_setscheduler 119 #endif #ifndef __NR_write #define __NR_write 64 #endif uint64_t r[1] = {0xffffffffffffffff}; int main(void) { syscall(__NR_mmap, /*addr=*/0x1ffff000ul, /*len=*/0x1000ul, /*prot=*/0ul, /*flags=MAP_FIXED|MAP_ANONYMOUS|MAP_PRIVATE*/ 0x32ul, /*fd=*/(intptr_t)-1, /*offset=*/0ul); syscall(__NR_mmap, /*addr=*/0x20000000ul, /*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=*/0x21000000ul, /*len=*/0x1000ul, /*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)) { } // prlimit64 arguments: [ // pid: pid (resource) // res: rlimit_type = 0xe (8 bytes) // new: nil // old: nil // ] syscall(__NR_prlimit64, /*pid=*/0, /*res=RLIMIT_RTPRIO*/ 0xeul, /*new=*/0ul, /*old=*/0ul); // sched_setscheduler arguments: [ // pid: pid (resource) // policy: sched_policy = 0x2 (8 bytes) // prio: ptr[in, int32] { // int32 = 0x3 (4 bytes) // } // ] *(uint32_t*)0x20000640 = 3; syscall(__NR_sched_setscheduler, /*pid=*/0, /*policy=SCHED_RR*/ 2ul, /*prio=*/0x20000640ul); // openat$cgroup_ro arguments: [ // fd: fd_cgroup (resource) // file: ptr[in, buffer] { // buffer: {63 70 75 2e 73 74 61 74 00} (length 0x9) // } // flags: const = 0x275a (4 bytes) // mode: const = 0x0 (2 bytes) // ] // returns fd memcpy((void*)0x20000080, "cpu.stat\000", 9); res = syscall(__NR_openat, /*fd=*/0xffffff9c, /*file=*/0x20000080ul, /*flags=*/0x275a, /*mode=*/0); if (res != -1) r[0] = res; // write$UHID_CREATE2 arguments: [ // fd: fd_uhid (resource) // data: nil // len: len = 0x118 (8 bytes) // ] syscall(__NR_write, /*fd=*/r[0], /*data=*/0ul, /*len=*/0x118ul); // mmap arguments: [ // addr: VMA[0x3000] // len: len = 0x3000 (8 bytes) // prot: mmap_prot = 0x5 (8 bytes) // flags: mmap_flags = 0x12 (8 bytes) // fd: fd (resource) // offset: intptr = 0x0 (8 bytes) // ] syscall(__NR_mmap, /*addr=*/0x20000000ul, /*len=*/0x3000ul, /*prot=PROT_READ|PROT_EXEC*/ 5ul, /*flags=MAP_FIXED|MAP_PRIVATE*/ 0x12ul, /*fd=*/r[0], /*offset=*/0ul); // ioctl$BTRFS_IOC_SEND arguments: [ // fd: fd (resource) // cmd: const = 0xd0009411 (4 bytes) // arg: nil // ] syscall(__NR_ioctl, /*fd=*/(intptr_t)-1, /*cmd=*/0xd0009411, /*arg=*/0ul); return 0; }