// https://syzkaller.appspot.com/bug?id=53d473bece9d22fc805eb07850a1aef7c9533e56 // 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)) { } // mknodat$md arguments: [ // dirfd: const = 0xffffffffffffff9c (8 bytes) // file: ptr[in, buffer] { // buffer: {2e 2f 6d 64 30 00} (length 0x6) // } // mode: const = 0x6180 (8 bytes) // dev: proc = 0x0 (4 bytes) // ] memcpy((void*)0x200000000200, "./md0\000", 6); syscall(__NR_mknodat, /*dirfd=*/0xffffffffffffff9cul, /*file=*/0x200000000200ul, /*mode=*/0x6180ul, /*dev=*/0x900); // openat$md_node arguments: [ // fd: const = 0xffffffffffffff9c (8 bytes) // file: ptr[in, buffer] { // buffer: {2e 2f 6d 64 30 00} (length 0x6) // } // flags: md_open_flags = 0x2 (4 bytes) // mode: const = 0x0 (2 bytes) // ] // returns fd_md memcpy((void*)0x200000000240, "./md0\000", 6); res = syscall(__NR_openat, /*fd=*/0xffffffffffffff9cul, /*file=*/0x200000000240ul, /*flags=O_RDWR*/ 2, /*mode=*/0); if (res != -1) r[0] = res; // ioctl$SET_ARRAY_INFO arguments: [ // fd: fd_md (resource) // cmd: const = 0x40480923 (4 bytes) // arg: ptr[in, mdu_array_info_t] { // mdu_array_info_t { // major_version: int32 = 0x0 (4 bytes) // minor_version: md_minor_versions = 0x5a (4 bytes) // patch_version: const = 0x0 (4 bytes) // ctime: int32 = 0x0 (4 bytes) // level: md_levels = 0x1 (4 bytes) // size: int32 = 0x20800 (4 bytes) // nr_disks: const = 0x0 (4 bytes) // raid_disks: int32 = 0x8002 (4 bytes) // md_minor: const = 0x0 (4 bytes) // not_persistent: int32 = 0x2000 (4 bytes) // utime: const = 0x0 (4 bytes) // state: md_array_state = 0x0 (4 bytes) // active_disks: const = 0x0 (4 bytes) // working_disks: const = 0x0 (4 bytes) // failed_disks: const = 0x0 (4 bytes) // spare_disks: const = 0x0 (4 bytes) // layout: md_layouts = 0x9 (4 bytes) // chunk_size: md_chunk_sizes = 0x6000 (4 bytes) // } // } // ] *(uint32_t*)0x200000000000 = 0; *(uint32_t*)0x200000000004 = 0x5a; *(uint32_t*)0x200000000008 = 0; *(uint32_t*)0x20000000000c = 0; *(uint32_t*)0x200000000010 = 1; *(uint32_t*)0x200000000014 = 0x20800; *(uint32_t*)0x200000000018 = 0; *(uint32_t*)0x20000000001c = 0x8002; *(uint32_t*)0x200000000020 = 0; *(uint32_t*)0x200000000024 = 0x2000; *(uint32_t*)0x200000000028 = 0; *(uint32_t*)0x20000000002c = 0; *(uint32_t*)0x200000000030 = 0; *(uint32_t*)0x200000000034 = 0; *(uint32_t*)0x200000000038 = 0; *(uint32_t*)0x20000000003c = 0; *(uint32_t*)0x200000000040 = 9; *(uint32_t*)0x200000000044 = 0x6000; syscall(__NR_ioctl, /*fd=*/r[0], /*cmd=*/0x40480923, /*arg=*/0x200000000000ul); // ioctl$ADD_NEW_DISK arguments: [ // fd: fd_md (resource) // cmd: const = 0x40140921 (4 bytes) // arg: ptr[in, mdu_disk_info_t] { // mdu_disk_info_t { // number: int32 = 0x0 (4 bytes) // dev: md_member_dev { // major: const = 0x1 (4 bytes) // minor: proc = 0x0 (4 bytes) // } // raid_disk: int32 = 0x0 (4 bytes) // state: md_disk_state = 0x6 (4 bytes) // } // } // ] *(uint32_t*)0x200000000300 = 0; *(uint32_t*)0x200000000304 = 1; *(uint32_t*)0x200000000308 = 0; *(uint32_t*)0x20000000030c = 0; *(uint32_t*)0x200000000310 = 6; syscall(__NR_ioctl, /*fd=*/r[0], /*cmd=*/0x40140921, /*arg=*/0x200000000300ul); // ioctl$ADD_NEW_DISK arguments: [ // fd: fd_md (resource) // cmd: const = 0x40140921 (4 bytes) // arg: ptr[in, mdu_disk_info_t] { // mdu_disk_info_t { // number: int32 = 0x4 (4 bytes) // dev: md_member_dev { // major: const = 0x1 (4 bytes) // minor: proc = 0x1 (4 bytes) // } // raid_disk: int32 = 0x2 (4 bytes) // state: md_disk_state = 0x6 (4 bytes) // } // } // ] *(uint32_t*)0x200000000340 = 4; *(uint32_t*)0x200000000344 = 1; *(uint32_t*)0x200000000348 = 1; *(uint32_t*)0x20000000034c = 2; *(uint32_t*)0x200000000350 = 6; syscall(__NR_ioctl, /*fd=*/r[0], /*cmd=*/0x40140921, /*arg=*/0x200000000340ul); // ioctl$RUN_ARRAY arguments: [ // fd: fd_md (resource) // cmd: const = 0x400c0930 (4 bytes) // arg: nil // ] syscall(__NR_ioctl, /*fd=*/r[0], /*cmd=*/0x400c0930, /*arg=*/0ul); return 0; }