// https://syzkaller.appspot.com/bug?id=4f5d16e92b65d3eb55ae4e7bf2c1540f3e4a53f7 // 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 #include #ifndef __NR_memfd_create #define __NR_memfd_create 319 #endif static unsigned long long procid; 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; } //% This code is derived from puff.{c,h}, found in the zlib development. The //% original files come with the following copyright notice: //% Copyright (C) 2002-2013 Mark Adler, all rights reserved //% version 2.3, 21 Jan 2013 //% This software is provided 'as-is', without any express or implied //% warranty. In no event will the author be held liable for any damages //% arising from the use of this software. //% Permission is granted to anyone to use this software for any purpose, //% including commercial applications, and to alter it and redistribute it //% freely, subject to the following restrictions: //% 1. The origin of this software must not be misrepresented; you must not //% claim that you wrote the original software. If you use this software //% in a product, an acknowledgment in the product documentation would be //% appreciated but is not required. //% 2. Altered source versions must be plainly marked as such, and must not be //% misrepresented as being the original software. //% 3. This notice may not be removed or altered from any source distribution. //% Mark Adler madler@alumni.caltech.edu //% BEGIN CODE DERIVED FROM puff.{c,h} #define MAXBITS 15 #define MAXLCODES 286 #define MAXDCODES 30 #define MAXCODES (MAXLCODES + MAXDCODES) #define FIXLCODES 288 struct puff_state { unsigned char* out; unsigned long outlen; unsigned long outcnt; const unsigned char* in; unsigned long inlen; unsigned long incnt; int bitbuf; int bitcnt; jmp_buf env; }; static int puff_bits(struct puff_state* s, int need) { long val = s->bitbuf; while (s->bitcnt < need) { if (s->incnt == s->inlen) longjmp(s->env, 1); val |= (long)(s->in[s->incnt++]) << s->bitcnt; s->bitcnt += 8; } s->bitbuf = (int)(val >> need); s->bitcnt -= need; return (int)(val & ((1L << need) - 1)); } static int puff_stored(struct puff_state* s) { s->bitbuf = 0; s->bitcnt = 0; if (s->incnt + 4 > s->inlen) return 2; unsigned len = s->in[s->incnt++]; len |= s->in[s->incnt++] << 8; if (s->in[s->incnt++] != (~len & 0xff) || s->in[s->incnt++] != ((~len >> 8) & 0xff)) return -2; if (s->incnt + len > s->inlen) return 2; if (s->outcnt + len > s->outlen) return 1; for (; len--; s->outcnt++, s->incnt++) { if (s->in[s->incnt]) s->out[s->outcnt] = s->in[s->incnt]; } return 0; } struct puff_huffman { short* count; short* symbol; }; static int puff_decode(struct puff_state* s, const struct puff_huffman* h) { int first = 0; int index = 0; int bitbuf = s->bitbuf; int left = s->bitcnt; int code = first = index = 0; int len = 1; short* next = h->count + 1; while (1) { while (left--) { code |= bitbuf & 1; bitbuf >>= 1; int count = *next++; if (code - count < first) { s->bitbuf = bitbuf; s->bitcnt = (s->bitcnt - len) & 7; return h->symbol[index + (code - first)]; } index += count; first += count; first <<= 1; code <<= 1; len++; } left = (MAXBITS + 1) - len; if (left == 0) break; if (s->incnt == s->inlen) longjmp(s->env, 1); bitbuf = s->in[s->incnt++]; if (left > 8) left = 8; } return -10; } static int puff_construct(struct puff_huffman* h, const short* length, int n) { int len; for (len = 0; len <= MAXBITS; len++) h->count[len] = 0; int symbol; for (symbol = 0; symbol < n; symbol++) (h->count[length[symbol]])++; if (h->count[0] == n) return 0; int left = 1; for (len = 1; len <= MAXBITS; len++) { left <<= 1; left -= h->count[len]; if (left < 0) return left; } short offs[MAXBITS + 1]; offs[1] = 0; for (len = 1; len < MAXBITS; len++) offs[len + 1] = offs[len] + h->count[len]; for (symbol = 0; symbol < n; symbol++) if (length[symbol] != 0) h->symbol[offs[length[symbol]]++] = symbol; return left; } static int puff_codes(struct puff_state* s, const struct puff_huffman* lencode, const struct puff_huffman* distcode) { static const short lens[29] = {3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 15, 17, 19, 23, 27, 31, 35, 43, 51, 59, 67, 83, 99, 115, 131, 163, 195, 227, 258}; static const short lext[29] = {0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 0}; static const short dists[30] = { 1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49, 65, 97, 129, 193, 257, 385, 513, 769, 1025, 1537, 2049, 3073, 4097, 6145, 8193, 12289, 16385, 24577}; static const short dext[30] = {0, 0, 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13}; int symbol; do { symbol = puff_decode(s, lencode); if (symbol < 0) return symbol; if (symbol < 256) { if (s->outcnt == s->outlen) return 1; if (symbol) s->out[s->outcnt] = symbol; s->outcnt++; } else if (symbol > 256) { symbol -= 257; if (symbol >= 29) return -10; int len = lens[symbol] + puff_bits(s, lext[symbol]); symbol = puff_decode(s, distcode); if (symbol < 0) return symbol; unsigned dist = dists[symbol] + puff_bits(s, dext[symbol]); if (dist > s->outcnt) return -11; if (s->outcnt + len > s->outlen) return 1; while (len--) { if (dist <= s->outcnt && s->out[s->outcnt - dist]) s->out[s->outcnt] = s->out[s->outcnt - dist]; s->outcnt++; } } } while (symbol != 256); return 0; } static int puff_fixed(struct puff_state* s) { static int virgin = 1; static short lencnt[MAXBITS + 1], lensym[FIXLCODES]; static short distcnt[MAXBITS + 1], distsym[MAXDCODES]; static struct puff_huffman lencode, distcode; if (virgin) { lencode.count = lencnt; lencode.symbol = lensym; distcode.count = distcnt; distcode.symbol = distsym; short lengths[FIXLCODES]; int symbol; for (symbol = 0; symbol < 144; symbol++) lengths[symbol] = 8; for (; symbol < 256; symbol++) lengths[symbol] = 9; for (; symbol < 280; symbol++) lengths[symbol] = 7; for (; symbol < FIXLCODES; symbol++) lengths[symbol] = 8; puff_construct(&lencode, lengths, FIXLCODES); for (symbol = 0; symbol < MAXDCODES; symbol++) lengths[symbol] = 5; puff_construct(&distcode, lengths, MAXDCODES); virgin = 0; } return puff_codes(s, &lencode, &distcode); } static int puff_dynamic(struct puff_state* s) { static const short order[19] = {16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15}; int nlen = puff_bits(s, 5) + 257; int ndist = puff_bits(s, 5) + 1; int ncode = puff_bits(s, 4) + 4; if (nlen > MAXLCODES || ndist > MAXDCODES) return -3; short lengths[MAXCODES]; int index; for (index = 0; index < ncode; index++) lengths[order[index]] = puff_bits(s, 3); for (; index < 19; index++) lengths[order[index]] = 0; short lencnt[MAXBITS + 1], lensym[MAXLCODES]; struct puff_huffman lencode = {lencnt, lensym}; int err = puff_construct(&lencode, lengths, 19); if (err != 0) return -4; index = 0; while (index < nlen + ndist) { int symbol; int len; symbol = puff_decode(s, &lencode); if (symbol < 0) return symbol; if (symbol < 16) lengths[index++] = symbol; else { len = 0; if (symbol == 16) { if (index == 0) return -5; len = lengths[index - 1]; symbol = 3 + puff_bits(s, 2); } else if (symbol == 17) symbol = 3 + puff_bits(s, 3); else symbol = 11 + puff_bits(s, 7); if (index + symbol > nlen + ndist) return -6; while (symbol--) lengths[index++] = len; } } if (lengths[256] == 0) return -9; err = puff_construct(&lencode, lengths, nlen); if (err && (err < 0 || nlen != lencode.count[0] + lencode.count[1])) return -7; short distcnt[MAXBITS + 1], distsym[MAXDCODES]; struct puff_huffman distcode = {distcnt, distsym}; err = puff_construct(&distcode, lengths + nlen, ndist); if (err && (err < 0 || ndist != distcode.count[0] + distcode.count[1])) return -8; return puff_codes(s, &lencode, &distcode); } static int puff(unsigned char* dest, unsigned long* destlen, const unsigned char* source, unsigned long sourcelen) { struct puff_state s = { .out = dest, .outlen = *destlen, .outcnt = 0, .in = source, .inlen = sourcelen, .incnt = 0, .bitbuf = 0, .bitcnt = 0, }; int err; if (setjmp(s.env) != 0) err = 2; else { int last; do { last = puff_bits(&s, 1); int type = puff_bits(&s, 2); err = type == 0 ? puff_stored(&s) : (type == 1 ? puff_fixed(&s) : (type == 2 ? puff_dynamic(&s) : -1)); if (err != 0) break; } while (!last); } *destlen = s.outcnt; return err; } //% END CODE DERIVED FROM puff.{c,h} #define ZLIB_HEADER_WIDTH 2 static int puff_zlib_to_file(const unsigned char* source, unsigned long sourcelen, int dest_fd) { if (sourcelen < ZLIB_HEADER_WIDTH) return 0; source += ZLIB_HEADER_WIDTH; sourcelen -= ZLIB_HEADER_WIDTH; const unsigned long max_destlen = 132 << 20; void* ret = mmap(0, max_destlen, PROT_WRITE | PROT_READ, MAP_PRIVATE | MAP_ANON, -1, 0); if (ret == MAP_FAILED) return -1; unsigned char* dest = (unsigned char*)ret; unsigned long destlen = max_destlen; int err = puff(dest, &destlen, source, sourcelen); if (err) { munmap(dest, max_destlen); errno = -err; return -1; } if (write(dest_fd, dest, destlen) != (ssize_t)destlen) { munmap(dest, max_destlen); return -1; } return munmap(dest, max_destlen); } static int setup_loop_device(unsigned char* data, unsigned long size, const char* loopname, int* loopfd_p) { int err = 0, loopfd = -1; int memfd = syscall(__NR_memfd_create, "syzkaller", 0); if (memfd == -1) { err = errno; goto error; } if (puff_zlib_to_file(data, size, memfd)) { err = errno; goto error_close_memfd; } loopfd = open(loopname, O_RDWR); if (loopfd == -1) { err = errno; goto error_close_memfd; } if (ioctl(loopfd, LOOP_SET_FD, memfd)) { if (errno != EBUSY) { err = errno; goto error_close_loop; } ioctl(loopfd, LOOP_CLR_FD, 0); usleep(1000); if (ioctl(loopfd, LOOP_SET_FD, memfd)) { err = errno; goto error_close_loop; } } close(memfd); *loopfd_p = loopfd; return 0; error_close_loop: close(loopfd); error_close_memfd: close(memfd); error: errno = err; return -1; } static void reset_loop_device(const char* loopname) { int loopfd = open(loopname, O_RDONLY); if (loopfd == -1) { return; } if (ioctl(loopfd, LOOP_CLR_FD, 0)) { } close(loopfd); } static long syz_mount_image(volatile long fsarg, volatile long dir, volatile long flags, volatile long optsarg, volatile long change_dir, volatile unsigned long size, volatile long image) { unsigned char* data = (unsigned char*)image; int res = -1, err = 0, need_loop_device = !!size; char* mount_opts = (char*)optsarg; char* target = (char*)dir; char* fs = (char*)fsarg; char* source = NULL; char loopname[64]; if (need_loop_device) { int loopfd; memset(loopname, 0, sizeof(loopname)); snprintf(loopname, sizeof(loopname), "/dev/loop%llu", procid); if (setup_loop_device(data, size, loopname, &loopfd) == -1) return -1; close(loopfd); source = loopname; } mkdir(target, 0777); char opts[256]; memset(opts, 0, sizeof(opts)); if (strlen(mount_opts) > (sizeof(opts) - 32)) { } strncpy(opts, mount_opts, sizeof(opts) - 32); if (strcmp(fs, "iso9660") == 0) { flags |= MS_RDONLY; } else if (strncmp(fs, "ext", 3) == 0) { bool has_remount_ro = false; char* remount_ro_start = strstr(opts, "errors=remount-ro"); if (remount_ro_start != NULL) { char after = *(remount_ro_start + strlen("errors=remount-ro")); char before = remount_ro_start == opts ? '\0' : *(remount_ro_start - 1); has_remount_ro = ((before == '\0' || before == ',') && (after == '\0' || after == ',')); } if (strstr(opts, "errors=panic") || !has_remount_ro) strcat(opts, ",errors=continue"); } else if (strcmp(fs, "xfs") == 0) { strcat(opts, ",nouuid"); } else if (strncmp(fs, "gfs2", 4) == 0 && (strstr(opts, "errors=panic") || strstr(opts, "debug"))) { strcat(opts, ",errors=withdraw"); } res = mount(source, target, fs, flags, opts); if (res == -1) { err = errno; goto error_clear_loop; } res = open(target, O_RDONLY | O_DIRECTORY); if (res == -1) { err = errno; goto error_clear_loop; } if (change_dir) { if (chdir(target) == -1) { err = errno; close(res); res = -1; } } error_clear_loop: if (need_loop_device) reset_loop_device(loopname); errno = err; return res; } static void setup_sysctl() { int cad_pid = fork(); if (cad_pid < 0) exit(1); if (cad_pid == 0) { for (;;) sleep(100); } char tmppid[32]; snprintf(tmppid, sizeof(tmppid), "%d", cad_pid); struct { const char* name; const char* data; } files[] = { {"/sys/kernel/debug/x86/nmi_longest_ns", "10000000000"}, {"/proc/sys/kernel/hung_task_check_interval_secs", "20"}, {"/proc/sys/net/core/bpf_jit_kallsyms", "1"}, {"/proc/sys/net/core/bpf_jit_harden", "0"}, {"/proc/sys/kernel/kptr_restrict", "0"}, {"/proc/sys/kernel/softlockup_all_cpu_backtrace", "1"}, {"/proc/sys/fs/mount-max", "100"}, {"/proc/sys/vm/oom_dump_tasks", "0"}, {"/proc/sys/debug/exception-trace", "0"}, {"/proc/sys/kernel/printk", "7 4 1 3"}, {"/proc/sys/kernel/keys/gc_delay", "1"}, {"/proc/sys/vm/oom_kill_allocating_task", "1"}, {"/sys/kernel/debug/failslab/task-filter", "Y"}, {"/sys/kernel/debug/fail_page_alloc/task-filter", "Y"}, {"/sys/kernel/debug/fail_futex/task-filter", "Y"}, {"/sys/kernel/debug/fail_usercopy/task-filter", "Y"}, {"/sys/kernel/debug/fail_make_request/task-filter", "Y"}, {"/sys/kernel/debug/fail_io_timeout/task-filter", "Y"}, {"/sys/kernel/debug/fail_iommufd/task-filter", "Y"}, {"/proc/sys/kernel/ctrl-alt-del", "0"}, {"/proc/sys/kernel/cad_pid", tmppid}, }; for (size_t i = 0; i < sizeof(files) / sizeof(files[0]); i++) { if (!write_file(files[i].name, files[i].data)) { } } kill(cad_pid, SIGKILL); while (waitpid(cad_pid, NULL, 0) != cad_pid) ; } 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); setup_sysctl(); const char* reason; (void)reason; use_temporary_dir(); if (write(1, "executing program\n", sizeof("executing program\n") - 1)) { } // syz_mount_image$ext4 arguments: [ // fs: ptr[in, buffer] { // buffer: {65 78 74 34 00} (length 0x5) // } // dir: ptr[in, buffer] { // buffer: {2e 2f 66 69 6c 65 31 00} (length 0x8) // } // flags: mount_flags = 0x200000 (8 bytes) // opts: ptr[in, fs_options[ext4_options]] { // fs_options[ext4_options] { // elems: array[fs_opt_elem[ext4_options]] { // fs_opt_elem[ext4_options] { // elem: union ext4_options { // grpjquota: buffer: {67 72 70 6a 71 75 6f 74 61 3d} (length // 0xa) // } // comma: const = 0x2c (1 bytes) // } // } // common: array[fs_opt_elem[fs_options_common]] { // } // null: const = 0x0 (1 bytes) // } // } // chdir: int8 = 0x3 (1 bytes) // size: len = 0x579 (8 bytes) // img: ptr[in, buffer] { // buffer: (compressed buffer with length 0x579) // } // ] // returns fd_dir memcpy((void*)0x200000000040, "ext4\000", 5); memcpy((void*)0x200000000140, "./file1\000", 8); memcpy((void*)0x200000000180, "grpjquota=", 10); *(uint8_t*)0x20000000018a = 0x2c; *(uint8_t*)0x20000000018b = 0; memcpy( (void*)0x200000000540, "\x78\x9c\xec\xdd\xcf\x6b\x14\xe7\x1b\x00\xf0\x67\x36\x89\xbf\xbf\x5f\x23" "\x88\xb4\x3d\x94\x80\x87\x5a\xac\x1b\x93\xf4\x87\x85\x82\xf6\x58\x5a\xa9" "\xd0\xde\xed\x92\x8c\x41\xb2\x71\x25\xbb\x11\x93\x0a\xea\xa1\x5e\x7a\x29" "\x52\x28\xa5\x42\xe9\x1f\xd0\x7b\x8f\xd2\x43\xaf\xfd\x2b\x84\x56\x90\x22" "\xa1\x3d\x14\x4a\xca\x6c\x66\xe3\x6a\x76\x93\x98\xac\xcd\xea\x7c\x3e\x30" "\xfa\xbe\x3b\xb3\x79\xe6\x9d\x77\x9e\x77\xdf\xd9\xd9\x65\x03\x28\xac\x91" "\xec\x9f\x52\xc4\xcb\x11\xf1\x55\x12\x71\xb0\x6d\xdd\x60\xe4\x2b\x47\x56" "\xb6\x5b\x7a\x78\x6d\x32\x5b\x92\x58\x5e\xfe\xe4\x8f\x24\x92\xfc\xb1\xd6" "\xf6\x49\xfe\xff\xfe\xbc\xf2\x52\x44\xfc\xfc\x45\xc4\xf1\xd2\xda\xb8\xf5" "\x85\xc5\x99\x4a\xb5\x9a\xce\xe5\xf5\xd1\xc6\xec\xe5\xd1\xfa\xc2\xe2\x89" "\x8b\xb3\x95\xe9\x74\x3a\xbd\x34\x3e\x31\x71\xea\xad\x89\xf1\x77\xdf\x79" "\xbb\x67\x6d\x7d\xfd\xdc\x5f\xdf\x7e\x7c\xf7\x83\x53\x5f\x1e\x5d\xfa\xe6" "\xc7\xfb\x87\x6e\x27\x71\x26\x0e\xe4\xeb\xda\xdb\xb1\x0d\x37\xda\x2b\x23" "\x31\x92\x1f\x93\xa1\x38\xf3\xc4\x86\x63\x3d\x08\xd6\x4f\x92\x9d\xde\x01" "\xb6\x64\x20\xcf\xf3\xa1\xc8\xc6\x80\x83\x31\x90\x67\x3d\xf0\xe2\xbb\x1e" "\x11\xcb\x40\x41\x25\xf2\x1f\x0a\xaa\x35\x0f\x68\x5d\xdb\xf7\xe8\x3a\xf8" "\xb9\xf1\xe0\xfd\x95\x0b\xa0\xb5\xed\x1f\x5c\x79\x6f\x24\xf6\x34\xaf\x8d" "\xf6\x2d\x25\x8f\x5d\x19\x65\xd7\xbb\xc3\x3d\x88\x9f\xc5\xf8\xe9\xf7\x3b" "\xb7\xb3\x25\x36\x78\x1f\xe2\x7a\x0f\xe2\x01\xb4\xdc\xb8\x19\x11\x27\x07" "\x07\xd7\x8e\x7f\x49\x3e\xfe\x6d\xdd\xc9\xe6\x9b\xc7\xeb\x7b\x32\x46\xd1" "\x5e\x7f\x60\x27\xdd\xcd\xe6\x3f\x6f\x74\x9a\xff\x94\x56\xe7\x3f\xd1\x61" "\xfe\xb3\xbf\x43\xee\x6e\xc5\xc6\xf9\x5f\xba\xdf\x83\x30\x5d\x65\xf3\xbf" "\xf7\x3a\xce\x7f\x57\x87\xae\xe1\x81\xbc\xf6\xbf\xe6\x9c\x6f\x28\xb9\x70" "\xb1\x9a\x9e\x8c\x88\xff\x47\xc4\xb1\x18\xda\x9d\xd5\xd7\xbb\x9f\x73\x6a" "\xe9\xde\x72\xb7\x75\xed\xf3\xbf\x6c\xc9\xe2\xb7\xe6\x82\xf9\x7e\xdc\x1f" "\xdc\xfd\xf8\x73\xa6\x2a\x8d\xca\x76\xda\xdc\xee\xc1\xcd\x88\x57\x1e\xcd" "\x7f\x93\x78\x78\x6d\xd7\xca\x9a\x64\xb5\xff\x93\x0e\xfd\x9f\x1d\x8f\x73" "\x9b\x8c\x71\x24\xbd\xf3\x6a\xb7\x75\x1b\xb7\xbf\xfd\xae\x5a\xef\x67\xc0" "\xcb\x3f\x44\xbc\xd6\xb1\xff\x1f\xdd\xd1\x4a\xd6\xbf\x3f\x39\xda\x3c\x1f" "\x46\x5b\x67\xc5\x5a\x7f\xde\x3a\xf2\x6b\xb7\xf8\x9b\x6a\xff\x33\x94\xf5" "\xff\xbe\xf5\xdb\x3f\x9c\xb4\xdf\xaf\xad\x3f\x7d\x8c\xef\xf7\xfc\x9d\x76" "\x5b\xb7\xd5\xf3\x7f\x57\xf2\x69\xb3\x9c\x9f\xac\x71\xb5\xd2\x68\xcc\x8d" "\x45\xec\x4a\x3e\x5a\xfb\xf8\xf8\xa3\xe7\xb6\xea\xad\xed\xb3\xf6\x1f\x3b" "\xba\xfe\xf8\xf7\x4b\x87\xf3\x7f\x6f\x44\x7c\xb6\xc9\xf6\xdf\x3a\x7c\xab" "\xeb\xa6\xfd\xd0\xff\x53\x4f\xd5\xff\x4f\x5f\xb8\xf7\xe1\xe7\xdf\x75\x8b" "\xbf\xb9\xfe\x7f\xb3\x59\x3a\x96\x3f\xb2\x99\xf1\x6f\xb3\x3b\xb8\x9d\x63" "\x07\x00\x00\x00\x00\x00\x00\xfd\xa6\x14\x11\x07\x22\x29\x95\x57\xcb\xa5" "\x52\xb9\xbc\xf2\xf9\x8e\xc3\xb1\xaf\x54\xad\xd5\x1b\xc7\x2f\xd4\xe6\x2f" "\x4d\x45\xf3\xbb\xb2\xc3\x31\x54\x6a\xdd\xe9\x3e\xd8\xf6\x79\x88\xb1\xfc" "\xf3\xb0\xad\xfa\xf8\x13\xf5\x89\x88\x38\x14\x11\x5f\x0f\xec\x6d\xd6\xcb" "\x93\xb5\xea\xd4\x4e\x37\x1e\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\xfa\xc4\xfe\x2e\xdf\xff\xcf\xfc\x36\xb0\xd3\x7b\x07\x3c" "\x73\x7e\xf2\x1b\x8a\x6b\xc3\xfc\xef\xc5\x2f\x3d\x01\x7d\xc9\xeb\x3f\x14" "\x97\xfc\x87\xe2\x92\xff\x50\x5c\xf2\x1f\x8a\x4b\xfe\x43\x71\xc9\x7f\x28" "\x2e\xf9\x0f\xc5\x25\xff\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\xa0\xa7\xce\x9d\x3d\x9b\x2d\xcb\x4b" "\x0f\xaf\x4d\x66\xf5\xa9\x2b\x0b\xf3\x33\xb5\x2b\x27\xa6\xd2\xfa\x4c\x79" "\x76\x7e\xb2\x3c\x59\x9b\xbb\x5c\x9e\xae\xd5\xa6\xab\x69\x79\xb2\x36\xbb" "\xd1\xdf\xab\xd6\x6a\x97\xc7\xc6\x63\xfe\xea\x68\x23\xad\x37\x46\xeb\x0b" "\x8b\xe7\x67\x6b\xf3\x97\x1a\xe7\x2f\xce\x56\xa6\xd3\xf3\xe9\xd0\x7f\xd2" "\x2a\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x78\xbe" "\xd4\x17\x16\x67\x2a\xd5\x6a\x3a\xa7\xd0\xb5\x70\x3a\xfa\x62\x37\xb6\x5c" "\x48\x36\xea\xe5\xd3\xf9\xc9\xb0\xa5\x10\x83\x3b\xdf\xc0\x74\xee\x9f\x7e" "\x38\xce\x2f\x56\x61\x87\x07\x26\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x68\xf3\x6f\x00\x00\x00\xff\xff\xcb\x03\x35\x39", 1401); syz_mount_image(/*fs=*/0x200000000040, /*dir=*/0x200000000140, /*flags=MS_RELATIME*/ 0x200000, /*opts=*/0x200000000180, /*chdir=*/3, /*size=*/0x579, /*img=*/0x200000000540); // lsetxattr$security_evm arguments: [ // path: ptr[in, buffer] { // buffer: {2e 2f 66 69 6c 65 30 2f 66 69 6c 65 30 00} (length 0xe) // } // name: ptr[in, buffer] { // buffer: {73 65 63 75 72 69 74 79 2e 65 76 6d 00} (length 0xd) // } // val: ptr[in, evm_ima_xattr] { // union evm_ima_xattr { // v1: evm_ima_xattr_data { // type: const = 0x2 (1 bytes) // digest: buffer: {} (length 0x0) // } // } // } // size: len = 0x1 (8 bytes) // flags: setxattr_flags = 0x0 (8 bytes) // ] memcpy((void*)0x200000000000, "./file0/file0\000", 14); memcpy((void*)0x200000000080, "security.evm\000", 13); *(uint8_t*)0x200000000100 = 2; syscall(__NR_lsetxattr, /*path=*/0x200000000000ul, /*name=*/0x200000000080ul, /*val=*/0x200000000100ul, /*size=*/1ul, /*flags=*/0ul); for (int i = 0; i < 64; i++) { syscall(__NR_lsetxattr, /*path=*/0x200000000000ul, /*name=*/0x200000000080ul, /*val=*/0x200000000100ul, /*size=*/1ul, /*flags=*/0ul); } return 0; }