// https://syzkaller.appspot.com/bug?id=8202d41c6b74f269fc34b59b31d0f3da323c0711 // autogenerated by syzkaller (https://github.com/google/syzkaller) #define _GNU_SOURCE #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include static unsigned long long procid; static void sleep_ms(uint64_t ms) { usleep(ms * 1000); } static uint64_t current_time_ms(void) { struct timespec ts; if (clock_gettime(CLOCK_MONOTONIC, &ts)) exit(1); return (uint64_t)ts.tv_sec * 1000 + (uint64_t)ts.tv_nsec / 1000000; } static void use_temporary_dir(void) { char tmpdir_template[] = "./syzkaller.XXXXXX"; char* tmpdir = mkdtemp(tmpdir_template); if (!tmpdir) exit(1); if (chmod(tmpdir, 0777)) exit(1); if (chdir(tmpdir)) exit(1); } static bool write_file(const char* file, const char* what, ...) { char buf[1024]; va_list args; va_start(args, what); vsnprintf(buf, sizeof(buf), what, args); va_end(args); buf[sizeof(buf) - 1] = 0; int len = strlen(buf); int fd = open(file, O_WRONLY | O_CLOEXEC); if (fd == -1) return false; if (write(fd, buf, len) != len) { int err = errno; close(fd); errno = err; return false; } close(fd); return true; } const int kInitNetNsFd = 201; static long syz_init_net_socket(volatile long domain, volatile long type, volatile long proto) { return syscall(__NR_socket, domain, type, proto); } #define FS_IOC_SETFLAGS _IOW('f', 2, long) static void remove_dir(const char* dir) { int iter = 0; DIR* dp = 0; const int umount_flags = MNT_FORCE | UMOUNT_NOFOLLOW; retry: while (umount2(dir, umount_flags) == 0) { } dp = opendir(dir); if (dp == NULL) { if (errno == EMFILE) { exit(1); } exit(1); } struct dirent* ep = 0; while ((ep = readdir(dp))) { if (strcmp(ep->d_name, ".") == 0 || strcmp(ep->d_name, "..") == 0) continue; char filename[FILENAME_MAX]; snprintf(filename, sizeof(filename), "%s/%s", dir, ep->d_name); while (umount2(filename, umount_flags) == 0) { } struct stat st; if (lstat(filename, &st)) exit(1); if (S_ISDIR(st.st_mode)) { remove_dir(filename); continue; } int i; for (i = 0;; i++) { if (unlink(filename) == 0) break; if (errno == EPERM) { int fd = open(filename, O_RDONLY); if (fd != -1) { long flags = 0; if (ioctl(fd, FS_IOC_SETFLAGS, &flags) == 0) { } close(fd); continue; } } if (errno == EROFS) { break; } if (errno != EBUSY || i > 100) exit(1); if (umount2(filename, umount_flags)) exit(1); } } closedir(dp); for (int i = 0;; i++) { if (rmdir(dir) == 0) break; if (i < 100) { if (errno == EPERM) { int fd = open(dir, O_RDONLY); if (fd != -1) { long flags = 0; if (ioctl(fd, FS_IOC_SETFLAGS, &flags) == 0) { } close(fd); continue; } } if (errno == EROFS) { break; } if (errno == EBUSY) { if (umount2(dir, umount_flags)) exit(1); continue; } if (errno == ENOTEMPTY) { if (iter < 100) { iter++; goto retry; } } } exit(1); } } static void kill_and_wait(int pid, int* status) { kill(-pid, SIGKILL); kill(pid, SIGKILL); for (int i = 0; i < 100; i++) { if (waitpid(-1, status, WNOHANG | __WALL) == pid) return; usleep(1000); } DIR* dir = opendir("/sys/fs/fuse/connections"); if (dir) { for (;;) { struct dirent* ent = readdir(dir); if (!ent) break; if (strcmp(ent->d_name, ".") == 0 || strcmp(ent->d_name, "..") == 0) continue; char abort[300]; snprintf(abort, sizeof(abort), "/sys/fs/fuse/connections/%s/abort", ent->d_name); int fd = open(abort, O_WRONLY); if (fd == -1) { continue; } if (write(fd, abort, 1) < 0) { } close(fd); } closedir(dir); } else { } while (waitpid(-1, status, __WALL) != pid) { } } static void setup_test() { prctl(PR_SET_PDEATHSIG, SIGKILL, 0, 0, 0); setpgrp(); write_file("/proc/self/oom_score_adj", "1000"); if (symlink("/dev/binderfs", "./binderfs")) { } } static void execute_one(void); #define WAIT_FLAGS __WALL static void loop(void) { int iter = 0; for (;; iter++) { char cwdbuf[32]; sprintf(cwdbuf, "./%d", iter); if (mkdir(cwdbuf, 0777)) exit(1); int pid = fork(); if (pid < 0) exit(1); if (pid == 0) { if (chdir(cwdbuf)) exit(1); setup_test(); execute_one(); exit(0); } int status = 0; uint64_t start = current_time_ms(); for (;;) { sleep_ms(10); if (waitpid(-1, &status, WNOHANG | WAIT_FLAGS) == pid) break; if (current_time_ms() - start < 5000) continue; kill_and_wait(pid, &status); break; } remove_dir(cwdbuf); } } uint64_t r[4] = {0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff}; void execute_one(void) { intptr_t res = 0; if (write(1, "executing program\n", sizeof("executing program\n") - 1)) { } // sendmsg$key arguments: [ // fd: sock_key (resource) // msg: ptr[in, send_msghdr_key] { // send_msghdr_key { // msg_name: const = 0x0 (8 bytes) // msg_namelen: const = 0x0 (4 bytes) // pad = 0x0 (4 bytes) // msg_iov: ptr[in, iovec_sadb_msg] { // iovec_sadb_msg { // addr: ptr[in, sadb_msg] { // sadb_msg { // sadb_msg_version: const = 0x2 (1 bytes) // sadb_msg_type: int8 = 0x0 (1 bytes) // sadb_msg_errno: int8 = 0x0 (1 bytes) // sadb_msg_satype: sadb_satype = 0x5 (1 bytes) // sadb_msg_len: bytesize8 = 0x7 (2 bytes) // sadb_msg_reserved: const = 0x0 (2 bytes) // sadb_msg_seq: int32 = 0x0 (4 bytes) // sadb_msg_pid: int32 = 0x0 (4 bytes) // ext_headers: array[sadb_ext_hdr] { // union sadb_ext_hdr { // sadb_x_filter: sadb_x_filter { // sadb_len: bytesize8 = 0x5 (2 bytes) // sadb_exttype: const = 0x1a (2 bytes) // sadb_x_filter_saddr: union sadb_filter_addr { // in6: union ipv6_addr { // loopback: ipv6_addr_loopback { // a0: const = 0x0 (8 bytes) // a1: const = 0x1 (8 bytes) // } // } // } // sadb_x_filter_daddr: union sadb_filter_addr { // in: union ipv4_addr { // loopback: const = 0x7f000001 (4 bytes) // } // } // sadb_x_filter_family: socket_domain = 0x0 (2 bytes) // sadb_x_filter_splen: sadb_filter_addr_len = 0x0 (1 // bytes) sadb_x_filter_dplen: sadb_filter_addr_len = 0x0 // (1 bytes) // } // } // } // } // } // len: bytesize = 0x38 (8 bytes) // } // } // msg_iovlen: const = 0x1 (8 bytes) // msg_control: const = 0x0 (8 bytes) // msg_controllen: const = 0x0 (8 bytes) // msg_flags: const = 0x0 (4 bytes) // pad = 0x0 (4 bytes) // } // } // f: send_flags = 0x0 (8 bytes) // ] *(uint64_t*)0x2000000001c0 = 0; *(uint32_t*)0x2000000001c8 = 0; *(uint64_t*)0x2000000001d0 = 0x200000000180; *(uint64_t*)0x200000000180 = 0x200000000000; *(uint8_t*)0x200000000000 = 2; *(uint8_t*)0x200000000001 = 0; *(uint8_t*)0x200000000002 = 0; *(uint8_t*)0x200000000003 = 5; *(uint16_t*)0x200000000004 = 7; *(uint16_t*)0x200000000006 = 0; *(uint32_t*)0x200000000008 = 0; *(uint32_t*)0x20000000000c = 0; *(uint16_t*)0x200000000010 = 5; *(uint16_t*)0x200000000012 = 0x1a; *(uint64_t*)0x200000000014 = htobe64(0); *(uint64_t*)0x20000000001c = htobe64(1); *(uint32_t*)0x200000000024 = htobe32(0x7f000001); *(uint16_t*)0x200000000034 = 0; *(uint8_t*)0x200000000036 = 0; *(uint8_t*)0x200000000037 = 0; *(uint64_t*)0x200000000188 = 0x38; *(uint64_t*)0x2000000001d8 = 1; *(uint64_t*)0x2000000001e0 = 0; *(uint64_t*)0x2000000001e8 = 0; *(uint32_t*)0x2000000001f0 = 0; syscall(__NR_sendmsg, /*fd=*/(intptr_t)-1, /*msg=*/0x2000000001c0ul, /*f=*/0ul); // syz_init_net_socket$bt_sco arguments: [ // fam: const = 0x1f (8 bytes) // type: const = 0x5 (8 bytes) // proto: const = 0x2 (8 bytes) // ] // returns sock_bt_sco res = -1; res = syz_init_net_socket(/*fam=*/0x1f, /*type=*/5, /*proto=*/2); if (res != -1) r[0] = res; // setsockopt$ax25_SO_BINDTODEVICE arguments: [ // fd: sock_ax25 (resource) // level: const = 0x101 (4 bytes) // optname: const = 0x19 (4 bytes) // optval: ptr[in, ax25_devname] { // union ax25_devname { // bpq0: buffer: {62 70 71 30 00 00 00 00 00 00 00 00 00 00 00 00} // (length 0x10) // } // } // optlen: len = 0x10 (8 bytes) // ] memcpy((void*)0x200000000000, "bpq0\000\000\000\000\000\000\000\000\000\000\000\000", 16); syscall(__NR_setsockopt, /*fd=*/(intptr_t)-1, /*level=*/0x101, /*optname=*/0x19, /*optval=*/0x200000000000ul, /*optlen=*/0x10ul); // ioctl$sock_netdev_private arguments: [ // fd: sock (resource) // cmd: int32 = 0x8914 (4 bytes) // arg: ptr[in, buffer] { // buffer: {} (length 0x0) // } // ] syscall(__NR_ioctl, /*fd=*/r[0], /*cmd=*/0x8914, /*arg=*/0x200000000000ul); // bind$alg arguments: [ // fd: sock_alg (resource) // addr: ptr[in, sockaddr_alg] { // sockaddr_alg { // family: const = 0x26 (2 bytes) // type: buffer: {68 61 73 68 00 00 00 00 00 00 00 00 00 00} (length // 0xe) feat: af_alg_type = 0x0 (4 bytes) mask: af_alg_type = 0x0 (4 // bytes) name: buffer: {77 70 35 31 32 2d 67 65 6e 65 72 69 63 00 00 // 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 // 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 // 00 00 00} (length 0x40) // } // } // addrlen: len = 0x58 (8 bytes) // ] *(uint16_t*)0x200000000000 = 0x26; memcpy((void*)0x200000000002, "hash\000\000\000\000\000\000\000\000\000\000", 14); *(uint32_t*)0x200000000010 = 0; *(uint32_t*)0x200000000014 = 0; memcpy( (void*)0x200000000018, "wp512-" "generic\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000" "\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000" "\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000", 64); syscall(__NR_bind, /*fd=*/(intptr_t)-1, /*addr=*/0x200000000000ul, /*addrlen=*/0x58ul); // syz_init_net_socket$netrom arguments: [ // domain: const = 0x6 (8 bytes) // type: const = 0x5 (8 bytes) // proto: const = 0x0 (8 bytes) // ] // returns sock_netrom res = -1; res = syz_init_net_socket(/*domain=*/6, /*type=*/5, /*proto=*/0); if (res != -1) r[1] = res; // ioctl$sock_netrom_SIOCADDRT arguments: [ // fd: sock_netrom (resource) // cmd: const = 0x890c (4 bytes) // arg: ptr[in, nr_route_struct] { // nr_route_struct { // type: nr_route_type = 0x1 (4 bytes) // callsign: union ax25_address { // default: ax25_address_default { // b0: const = 0x98 (1 bytes) // b1: const = 0x92 (1 bytes) // b2: const = 0x9c (1 bytes) // b3: const = 0xaa (1 bytes) // b4: const = 0xb0 (1 bytes) // b5: const = 0x40 (1 bytes) // b6: const = 0x2 (1 bytes) // } // } // device: union ax25_devname { // bpq0: buffer: {62 70 71 30 00 00 00 00 00 00 00 00 00 00 00 00} // (length 0x10) // } // pad = 0x0 (1 bytes) // quality: int32 = 0x0 (4 bytes) // mnemonic: buffer: {73 79 7a 30 00 00 00} (length 0x7) // neighbour: union ax25_address { // null: ax25_address_null { // b0: const = 0x40 (1 bytes) // b1: const = 0x40 (1 bytes) // b2: const = 0x40 (1 bytes) // b3: const = 0x40 (1 bytes) // b4: const = 0x40 (1 bytes) // b5: const = 0x40 (1 bytes) // b6: const = 0x0 (1 bytes) // } // } // pad = 0x0 (2 bytes) // obs_count: int32 = 0x0 (4 bytes) // ndigis: int32 = 0x0 (4 bytes) // digipeaters: array[ax25_address] { // union ax25_address { // null: ax25_address_null { // b0: const = 0x40 (1 bytes) // b1: const = 0x40 (1 bytes) // b2: const = 0x40 (1 bytes) // b3: const = 0x40 (1 bytes) // b4: const = 0x40 (1 bytes) // b5: const = 0x40 (1 bytes) // b6: const = 0x0 (1 bytes) // } // } // union ax25_address { // remote: ax25_address_remote { // b0: const = 0xcc (1 bytes) // b1: const = 0xcc (1 bytes) // b2: const = 0xcc (1 bytes) // b3: const = 0xcc (1 bytes) // b4: const = 0xcc (1 bytes) // b5: const = 0xcc (1 bytes) // b6: proc = 0x1 (1 bytes) // } // } // union ax25_address { // rose: rose_address_dev { // b0: const = 0xbb (1 bytes) // b1: const = 0xbb (1 bytes) // b2: const = 0xbb (1 bytes) // b3: const = 0x1 (1 bytes) // b4: proc = 0x0 (1 bytes) // } // } // union ax25_address { // default: ax25_address_default { // b0: const = 0x98 (1 bytes) // b1: const = 0x92 (1 bytes) // b2: const = 0x9c (1 bytes) // b3: const = 0xaa (1 bytes) // b4: const = 0xb0 (1 bytes) // b5: const = 0x40 (1 bytes) // b6: const = 0x2 (1 bytes) // } // } // union ax25_address { // default: ax25_address_default { // b0: const = 0x98 (1 bytes) // b1: const = 0x92 (1 bytes) // b2: const = 0x9c (1 bytes) // b3: const = 0xaa (1 bytes) // b4: const = 0xb0 (1 bytes) // b5: const = 0x40 (1 bytes) // b6: const = 0x2 (1 bytes) // } // } // union ax25_address { // default: ax25_address_default { // b0: const = 0x98 (1 bytes) // b1: const = 0x92 (1 bytes) // b2: const = 0x9c (1 bytes) // b3: const = 0xaa (1 bytes) // b4: const = 0xb0 (1 bytes) // b5: const = 0x40 (1 bytes) // b6: const = 0x2 (1 bytes) // } // } // union ax25_address { // remote: ax25_address_remote { // b0: const = 0xcc (1 bytes) // b1: const = 0xcc (1 bytes) // b2: const = 0xcc (1 bytes) // b3: const = 0xcc (1 bytes) // b4: const = 0xcc (1 bytes) // b5: const = 0xcc (1 bytes) // b6: proc = 0x2 (1 bytes) // } // } // union ax25_address { // null: ax25_address_null { // b0: const = 0x40 (1 bytes) // b1: const = 0x40 (1 bytes) // b2: const = 0x40 (1 bytes) // b3: const = 0x40 (1 bytes) // b4: const = 0x40 (1 bytes) // b5: const = 0x40 (1 bytes) // b6: const = 0x0 (1 bytes) // } // } // } // } // } // ] *(uint32_t*)0x200000000180 = 1; *(uint8_t*)0x200000000184 = 0x98; *(uint8_t*)0x200000000185 = 0x92; *(uint8_t*)0x200000000186 = 0x9c; *(uint8_t*)0x200000000187 = 0xaa; *(uint8_t*)0x200000000188 = 0xb0; *(uint8_t*)0x200000000189 = 0x40; *(uint8_t*)0x20000000018a = 2; memcpy((void*)0x20000000018b, "bpq0\000\000\000\000\000\000\000\000\000\000\000\000", 16); *(uint32_t*)0x20000000019c = 0; memcpy((void*)0x2000000001a0, "syz0\000\000\000", 7); *(uint8_t*)0x2000000001a7 = 0x40; *(uint8_t*)0x2000000001a8 = 0x40; *(uint8_t*)0x2000000001a9 = 0x40; *(uint8_t*)0x2000000001aa = 0x40; *(uint8_t*)0x2000000001ab = 0x40; *(uint8_t*)0x2000000001ac = 0x40; *(uint8_t*)0x2000000001ad = 0; *(uint32_t*)0x2000000001b0 = 0; *(uint32_t*)0x2000000001b4 = 0; *(uint8_t*)0x2000000001b8 = 0x40; *(uint8_t*)0x2000000001b9 = 0x40; *(uint8_t*)0x2000000001ba = 0x40; *(uint8_t*)0x2000000001bb = 0x40; *(uint8_t*)0x2000000001bc = 0x40; *(uint8_t*)0x2000000001bd = 0x40; *(uint8_t*)0x2000000001be = 0; *(uint8_t*)0x2000000001bf = 0xcc; *(uint8_t*)0x2000000001c0 = 0xcc; *(uint8_t*)0x2000000001c1 = 0xcc; *(uint8_t*)0x2000000001c2 = 0xcc; *(uint8_t*)0x2000000001c3 = 0xcc; *(uint8_t*)0x2000000001c4 = 0xcc; *(uint8_t*)0x2000000001c5 = 1 + procid * 4; *(uint8_t*)0x2000000001c6 = 0xbb; *(uint8_t*)0x2000000001c7 = 0xbb; *(uint8_t*)0x2000000001c8 = 0xbb; *(uint8_t*)0x2000000001c9 = 1; *(uint8_t*)0x2000000001ca = 0 + procid * 1; *(uint8_t*)0x2000000001cd = 0x98; *(uint8_t*)0x2000000001ce = 0x92; *(uint8_t*)0x2000000001cf = 0x9c; *(uint8_t*)0x2000000001d0 = 0xaa; *(uint8_t*)0x2000000001d1 = 0xb0; *(uint8_t*)0x2000000001d2 = 0x40; *(uint8_t*)0x2000000001d3 = 2; *(uint8_t*)0x2000000001d4 = 0x98; *(uint8_t*)0x2000000001d5 = 0x92; *(uint8_t*)0x2000000001d6 = 0x9c; *(uint8_t*)0x2000000001d7 = 0xaa; *(uint8_t*)0x2000000001d8 = 0xb0; *(uint8_t*)0x2000000001d9 = 0x40; *(uint8_t*)0x2000000001da = 2; *(uint8_t*)0x2000000001db = 0x98; *(uint8_t*)0x2000000001dc = 0x92; *(uint8_t*)0x2000000001dd = 0x9c; *(uint8_t*)0x2000000001de = 0xaa; *(uint8_t*)0x2000000001df = 0xb0; *(uint8_t*)0x2000000001e0 = 0x40; *(uint8_t*)0x2000000001e1 = 2; *(uint8_t*)0x2000000001e2 = 0xcc; *(uint8_t*)0x2000000001e3 = 0xcc; *(uint8_t*)0x2000000001e4 = 0xcc; *(uint8_t*)0x2000000001e5 = 0xcc; *(uint8_t*)0x2000000001e6 = 0xcc; *(uint8_t*)0x2000000001e7 = 0xcc; *(uint8_t*)0x2000000001e8 = 2 + procid * 4; *(uint8_t*)0x2000000001e9 = 0x40; *(uint8_t*)0x2000000001ea = 0x40; *(uint8_t*)0x2000000001eb = 0x40; *(uint8_t*)0x2000000001ec = 0x40; *(uint8_t*)0x2000000001ed = 0x40; *(uint8_t*)0x2000000001ee = 0x40; *(uint8_t*)0x2000000001ef = 0; syscall(__NR_ioctl, /*fd=*/r[1], /*cmd=*/0x890c, /*arg=*/0x200000000180ul); // syz_init_net_socket$bt_sco arguments: [ // fam: const = 0x1f (8 bytes) // type: const = 0x5 (8 bytes) // proto: const = 0x2 (8 bytes) // ] // returns sock_bt_sco res = -1; res = syz_init_net_socket(/*fam=*/0x1f, /*type=*/5, /*proto=*/2); if (res != -1) r[2] = res; // setsockopt$ax25_SO_BINDTODEVICE arguments: [ // fd: sock_ax25 (resource) // level: const = 0x101 (4 bytes) // optname: const = 0x19 (4 bytes) // optval: ptr[in, ax25_devname] { // union ax25_devname { // bpq0: buffer: {62 70 71 30 00 00 00 00 00 00 00 00 00 00 00 00} // (length 0x10) // } // } // optlen: len = 0x10 (8 bytes) // ] memcpy((void*)0x200000000000, "bpq0\000\000\000\000\000\000\000\000\000\000\000\000", 16); syscall(__NR_setsockopt, /*fd=*/(intptr_t)-1, /*level=*/0x101, /*optname=*/0x19, /*optval=*/0x200000000000ul, /*optlen=*/0x10ul); // ioctl$sock_netdev_private arguments: [ // fd: sock (resource) // cmd: int32 = 0x8914 (4 bytes) // arg: ptr[in, buffer] { // buffer: {} (length 0x0) // } // ] syscall(__NR_ioctl, /*fd=*/r[2], /*cmd=*/0x8914, /*arg=*/0x200000000000ul); // syz_init_net_socket$netrom arguments: [ // domain: const = 0x6 (8 bytes) // type: const = 0x5 (8 bytes) // proto: const = 0x0 (8 bytes) // ] // returns sock_netrom res = -1; res = syz_init_net_socket(/*domain=*/6, /*type=*/5, /*proto=*/0); if (res != -1) r[3] = res; // ioctl$sock_netrom_SIOCADDRT arguments: [ // fd: sock_netrom (resource) // cmd: const = 0x890b (4 bytes) // arg: ptr[in, nr_route_struct] { // nr_route_struct { // type: nr_route_type = 0x1 (4 bytes) // callsign: union ax25_address { // default: ax25_address_default { // b0: const = 0x98 (1 bytes) // b1: const = 0x92 (1 bytes) // b2: const = 0x9c (1 bytes) // b3: const = 0xaa (1 bytes) // b4: const = 0xb0 (1 bytes) // b5: const = 0x40 (1 bytes) // b6: const = 0x2 (1 bytes) // } // } // device: union ax25_devname { // bpq0: buffer: {62 70 71 30 00 00 00 00 00 00 00 00 00 00 00 00} // (length 0x10) // } // pad = 0x0 (1 bytes) // quality: int32 = 0x1 (4 bytes) // mnemonic: buffer: {73 79 7a 30 00 00 00} (length 0x7) // neighbour: union ax25_address { // null: ax25_address_null { // b0: const = 0x40 (1 bytes) // b1: const = 0x40 (1 bytes) // b2: const = 0x40 (1 bytes) // b3: const = 0x40 (1 bytes) // b4: const = 0x40 (1 bytes) // b5: const = 0x40 (1 bytes) // b6: const = 0x0 (1 bytes) // } // } // pad = 0x0 (2 bytes) // obs_count: int32 = 0x0 (4 bytes) // ndigis: int32 = 0x0 (4 bytes) // digipeaters: array[ax25_address] { // union ax25_address { // null: ax25_address_null { // b0: const = 0x40 (1 bytes) // b1: const = 0x40 (1 bytes) // b2: const = 0x40 (1 bytes) // b3: const = 0x40 (1 bytes) // b4: const = 0x40 (1 bytes) // b5: const = 0x40 (1 bytes) // b6: const = 0x0 (1 bytes) // } // } // union ax25_address { // remote: ax25_address_remote { // b0: const = 0xcc (1 bytes) // b1: const = 0xcc (1 bytes) // b2: const = 0xcc (1 bytes) // b3: const = 0xcc (1 bytes) // b4: const = 0xcc (1 bytes) // b5: const = 0xcc (1 bytes) // b6: proc = 0x1 (1 bytes) // } // } // union ax25_address { // rose: rose_address_dev { // b0: const = 0xbb (1 bytes) // b1: const = 0xbb (1 bytes) // b2: const = 0xbb (1 bytes) // b3: const = 0x1 (1 bytes) // b4: proc = 0x0 (1 bytes) // } // } // union ax25_address { // default: ax25_address_default { // b0: const = 0x98 (1 bytes) // b1: const = 0x92 (1 bytes) // b2: const = 0x9c (1 bytes) // b3: const = 0xaa (1 bytes) // b4: const = 0xb0 (1 bytes) // b5: const = 0x40 (1 bytes) // b6: const = 0x2 (1 bytes) // } // } // union ax25_address { // default: ax25_address_default { // b0: const = 0x98 (1 bytes) // b1: const = 0x92 (1 bytes) // b2: const = 0x9c (1 bytes) // b3: const = 0xaa (1 bytes) // b4: const = 0xb0 (1 bytes) // b5: const = 0x40 (1 bytes) // b6: const = 0x2 (1 bytes) // } // } // union ax25_address { // default: ax25_address_default { // b0: const = 0x98 (1 bytes) // b1: const = 0x92 (1 bytes) // b2: const = 0x9c (1 bytes) // b3: const = 0xaa (1 bytes) // b4: const = 0xb0 (1 bytes) // b5: const = 0x40 (1 bytes) // b6: const = 0x2 (1 bytes) // } // } // union ax25_address { // remote: ax25_address_remote { // b0: const = 0xcc (1 bytes) // b1: const = 0xcc (1 bytes) // b2: const = 0xcc (1 bytes) // b3: const = 0xcc (1 bytes) // b4: const = 0xcc (1 bytes) // b5: const = 0xcc (1 bytes) // b6: proc = 0x2 (1 bytes) // } // } // union ax25_address { // null: ax25_address_null { // b0: const = 0x40 (1 bytes) // b1: const = 0x40 (1 bytes) // b2: const = 0x40 (1 bytes) // b3: const = 0x40 (1 bytes) // b4: const = 0x40 (1 bytes) // b5: const = 0x40 (1 bytes) // b6: const = 0x0 (1 bytes) // } // } // } // } // } // ] *(uint32_t*)0x200000000180 = 1; *(uint8_t*)0x200000000184 = 0x98; *(uint8_t*)0x200000000185 = 0x92; *(uint8_t*)0x200000000186 = 0x9c; *(uint8_t*)0x200000000187 = 0xaa; *(uint8_t*)0x200000000188 = 0xb0; *(uint8_t*)0x200000000189 = 0x40; *(uint8_t*)0x20000000018a = 2; memcpy((void*)0x20000000018b, "bpq0\000\000\000\000\000\000\000\000\000\000\000\000", 16); *(uint32_t*)0x20000000019c = 1; memcpy((void*)0x2000000001a0, "syz0\000\000\000", 7); *(uint8_t*)0x2000000001a7 = 0x40; *(uint8_t*)0x2000000001a8 = 0x40; *(uint8_t*)0x2000000001a9 = 0x40; *(uint8_t*)0x2000000001aa = 0x40; *(uint8_t*)0x2000000001ab = 0x40; *(uint8_t*)0x2000000001ac = 0x40; *(uint8_t*)0x2000000001ad = 0; *(uint32_t*)0x2000000001b0 = 0; *(uint32_t*)0x2000000001b4 = 0; *(uint8_t*)0x2000000001b8 = 0x40; *(uint8_t*)0x2000000001b9 = 0x40; *(uint8_t*)0x2000000001ba = 0x40; *(uint8_t*)0x2000000001bb = 0x40; *(uint8_t*)0x2000000001bc = 0x40; *(uint8_t*)0x2000000001bd = 0x40; *(uint8_t*)0x2000000001be = 0; *(uint8_t*)0x2000000001bf = 0xcc; *(uint8_t*)0x2000000001c0 = 0xcc; *(uint8_t*)0x2000000001c1 = 0xcc; *(uint8_t*)0x2000000001c2 = 0xcc; *(uint8_t*)0x2000000001c3 = 0xcc; *(uint8_t*)0x2000000001c4 = 0xcc; *(uint8_t*)0x2000000001c5 = 1 + procid * 4; *(uint8_t*)0x2000000001c6 = 0xbb; *(uint8_t*)0x2000000001c7 = 0xbb; *(uint8_t*)0x2000000001c8 = 0xbb; *(uint8_t*)0x2000000001c9 = 1; *(uint8_t*)0x2000000001ca = 0 + procid * 1; *(uint8_t*)0x2000000001cd = 0x98; *(uint8_t*)0x2000000001ce = 0x92; *(uint8_t*)0x2000000001cf = 0x9c; *(uint8_t*)0x2000000001d0 = 0xaa; *(uint8_t*)0x2000000001d1 = 0xb0; *(uint8_t*)0x2000000001d2 = 0x40; *(uint8_t*)0x2000000001d3 = 2; *(uint8_t*)0x2000000001d4 = 0x98; *(uint8_t*)0x2000000001d5 = 0x92; *(uint8_t*)0x2000000001d6 = 0x9c; *(uint8_t*)0x2000000001d7 = 0xaa; *(uint8_t*)0x2000000001d8 = 0xb0; *(uint8_t*)0x2000000001d9 = 0x40; *(uint8_t*)0x2000000001da = 2; *(uint8_t*)0x2000000001db = 0x98; *(uint8_t*)0x2000000001dc = 0x92; *(uint8_t*)0x2000000001dd = 0x9c; *(uint8_t*)0x2000000001de = 0xaa; *(uint8_t*)0x2000000001df = 0xb0; *(uint8_t*)0x2000000001e0 = 0x40; *(uint8_t*)0x2000000001e1 = 2; *(uint8_t*)0x2000000001e2 = 0xcc; *(uint8_t*)0x2000000001e3 = 0xcc; *(uint8_t*)0x2000000001e4 = 0xcc; *(uint8_t*)0x2000000001e5 = 0xcc; *(uint8_t*)0x2000000001e6 = 0xcc; *(uint8_t*)0x2000000001e7 = 0xcc; *(uint8_t*)0x2000000001e8 = 2 + procid * 4; *(uint8_t*)0x2000000001e9 = 0x40; *(uint8_t*)0x2000000001ea = 0x40; *(uint8_t*)0x2000000001eb = 0x40; *(uint8_t*)0x2000000001ec = 0x40; *(uint8_t*)0x2000000001ed = 0x40; *(uint8_t*)0x2000000001ee = 0x40; *(uint8_t*)0x2000000001ef = 0; syscall(__NR_ioctl, /*fd=*/r[3], /*cmd=*/0x890b, /*arg=*/0x200000000180ul); } 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; for (procid = 0; procid < 5; procid++) { if (fork() == 0) { use_temporary_dir(); loop(); } } sleep(1000000); return 0; }