// https://syzkaller.appspot.com/bug?id=f2f5f9a83698f105b8deebd8480ecb9ee839fdf8 // 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 #ifndef __NR_bpf #define __NR_bpf 321 #endif #ifndef __NR_memfd_create #define __NR_memfd_create 319 #endif static unsigned long long procid; #define BITMASK(bf_off, bf_len) (((1ull << (bf_len)) - 1) << (bf_off)) #define STORE_BY_BITMASK(type, htobe, addr, val, bf_off, bf_len) \ *(type*)(addr) = \ htobe((htobe(*(type*)(addr)) & ~BITMASK((bf_off), (bf_len))) | \ (((type)(val) << (bf_off)) & BITMASK((bf_off), (bf_len)))) //% 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_RDWR); 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) { res = chdir(target); if (res == -1) { err = errno; } } error_clear_loop: if (need_loop_device) reset_loop_device(loopname); errno = err; return res; } 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; 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 = 0x3000046 (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 { // delalloc: buffer: {64 65 6c 61 6c 6c 6f 63} (length 0x8) // } // comma: const = 0x2c (1 bytes) // } // fs_opt_elem[ext4_options] { // elem: union ext4_options { // data_err_abort: buffer: {64 61 74 61 5f 65 72 72 3d 61 62 6f // 72 74} (length 0xe) // } // comma: const = 0x2c (1 bytes) // } // fs_opt_elem[ext4_options] { // elem: union ext4_options { // barrier_val: fs_opt["barrier", fmt[hex, int32]] { // name: buffer: {62 61 72 72 69 65 72} (length 0x7) // eq: const = 0x3d (1 bytes) // val: int32 = 0x2 (18 bytes) // } // } // comma: const = 0x2c (1 bytes) // } // fs_opt_elem[ext4_options] { // elem: union ext4_options { // dioread_lock: buffer: {64 69 6f 72 65 61 64 5f 6c 6f 63 6b} // (length 0xc) // } // comma: const = 0x2c (1 bytes) // } // fs_opt_elem[ext4_options] { // elem: union ext4_options { // data_err_ignore: buffer: {64 61 74 61 5f 65 72 72 3d 69 67 6e // 6f 72 65} (length 0xf) // } // comma: const = 0x2c (1 bytes) // } // fs_opt_elem[ext4_options] { // elem: union ext4_options { // max_dir_size_kb: fs_opt["max_dir_size_kb", fmt[hex, int32]] { // name: buffer: {6d 61 78 5f 64 69 72 5f 73 69 7a 65 5f 6b 62} // (length 0xf) eq: const = 0x3d (1 bytes) val: int32 = // 0x4007b1 (18 bytes) // } // } // comma: const = 0x2c (1 bytes) // } // fs_opt_elem[ext4_options] { // elem: union ext4_options { // data_err_ignore: buffer: {64 61 74 61 5f 65 72 72 3d 69 67 6e // 6f 72 65} (length 0xf) // } // comma: const = 0x2c (1 bytes) // } // fs_opt_elem[ext4_options] { // elem: union ext4_options { // auto_da_alloc: buffer: {61 75 74 6f 5f 64 61 5f 61 6c 6c 6f // 63} (length 0xd) // } // comma: const = 0x2c (1 bytes) // } // fs_opt_elem[ext4_options] { // elem: union ext4_options { // abort: buffer: {61 62 6f 72 74} (length 0x5) // } // comma: const = 0x2c (1 bytes) // } // fs_opt_elem[ext4_options] { // elem: union ext4_options { // user_xattr: buffer: {75 73 65 72 5f 78 61 74 74 72} (length // 0xa) // } // comma: const = 0x2c (1 bytes) // } // fs_opt_elem[ext4_options] { // elem: union ext4_options { // bh: buffer: {62 68} (length 0x2) // } // comma: const = 0x2c (1 bytes) // } // fs_opt_elem[ext4_options] { // elem: union ext4_options { // errors_remount: buffer: {65 72 72 6f 72 73 3d 72 65 6d 6f 75 // 6e 74 2d 72 6f} (length 0x11) // } // comma: const = 0x2c (1 bytes) // } // } // common: array[fs_opt_elem[fs_options_common]] { // } // null: const = 0x0 (1 bytes) // } // } // chdir: int8 = 0x1 (1 bytes) // size: len = 0x55f (8 bytes) // img: ptr[in, buffer] { // buffer: (compressed buffer with length 0x55f) // } // ] // returns fd_dir memcpy((void*)0x200000000040, "ext4\000", 5); memcpy((void*)0x200000000000, "./file1\000", 8); memcpy((void*)0x200000000b00, "delalloc", 8); *(uint8_t*)0x200000000b08 = 0x2c; memcpy((void*)0x200000000b09, "data_err=abort", 14); *(uint8_t*)0x200000000b17 = 0x2c; memcpy((void*)0x200000000b18, "barrier", 7); *(uint8_t*)0x200000000b1f = 0x3d; sprintf((char*)0x200000000b20, "0x%016llx", (long long)2); *(uint8_t*)0x200000000b32 = 0x2c; memcpy((void*)0x200000000b33, "dioread_lock", 12); *(uint8_t*)0x200000000b3f = 0x2c; memcpy((void*)0x200000000b40, "data_err=ignore", 15); *(uint8_t*)0x200000000b4f = 0x2c; memcpy((void*)0x200000000b50, "max_dir_size_kb", 15); *(uint8_t*)0x200000000b5f = 0x3d; sprintf((char*)0x200000000b60, "0x%016llx", (long long)0x4007b1); *(uint8_t*)0x200000000b72 = 0x2c; memcpy((void*)0x200000000b73, "data_err=ignore", 15); *(uint8_t*)0x200000000b82 = 0x2c; memcpy((void*)0x200000000b83, "auto_da_alloc", 13); *(uint8_t*)0x200000000b90 = 0x2c; memcpy((void*)0x200000000b91, "abort", 5); *(uint8_t*)0x200000000b96 = 0x2c; memcpy((void*)0x200000000b97, "user_xattr", 10); *(uint8_t*)0x200000000ba1 = 0x2c; memcpy((void*)0x200000000ba2, "bh", 2); *(uint8_t*)0x200000000ba4 = 0x2c; memcpy((void*)0x200000000ba5, "errors=remount-ro", 17); *(uint8_t*)0x200000000bb6 = 0x2c; *(uint8_t*)0x200000000bb7 = 0; memcpy( (void*)0x200000000580, "\x78\x9c\xec\xdd\xdf\x6b\x53\xe7\x1b\x00\xf0\xe7\xa4\xad\xbf\xbf\x5f\x2b" "\x88\x6c\x63\x8c\x82\x17\x73\x38\x53\xdb\xee\x87\x83\x5d\xb8\xcb\xb1\xc9" "\x84\xed\xde\x85\xf6\x58\xa4\xa9\x91\x26\x15\xdb\x09\xd3\x8b\x79\xb3\x9b" "\x21\x83\x31\x26\x8c\xdd\x6f\xf7\xbb\x94\xfd\x03\xfb\x2b\x84\x4d\x90\x21" "\x65\xbb\xd8\x4d\xc6\x49\x4f\x6a\xb4\x49\x13\x6b\xb4\xd1\x7c\x3e\x70\xe4" "\x7d\x73\x4e\xfa\x9e\x27\xef\x79\x5e\xdf\x93\x37\x21\x01\x0c\xad\x89\xec" "\x9f\x42\xc4\xcb\x11\xf1\x4d\x12\x71\x30\x22\x92\x7c\xdf\x68\xe4\x3b\x27" "\xd6\x8f\x5b\xbb\x7f\x75\x36\xdb\x92\xa8\xd7\x3f\xfd\x2b\x69\x1c\x97\xd5" "\x9b\x7f\xab\xf9\xbc\xfd\x79\xe5\xa5\x88\xf8\xed\xab\x88\xe3\x85\xcd\xed" "\x56\x57\x56\x17\x4a\xe5\x72\xba\x94\xd7\x27\x6b\x8b\x97\x26\xab\x2b\xab" "\x27\x2e\x2c\x96\xe6\xd3\xf9\xf4\xe2\xf4\xcc\xcc\xa9\xb7\x67\xa6\xdf\x7b" "\xf7\x9d\xbe\xc5\xfa\xc6\xd9\x7f\xbe\xff\xe4\xf6\x87\xa7\xbe\x3e\xba\xf6" "\xdd\x2f\x77\x0f\xdd\x4c\xe2\x74\x1c\xc8\xf7\xb5\xc6\xf1\x04\xae\xb5\x56" "\x26\x62\x22\x7f\x4d\xc6\xe2\xf4\x23\x07\x4e\xf5\xa1\xb1\x41\x92\xec\xf4" "\x09\xb0\x2d\x23\x79\x9e\x8f\x45\x36\x06\x1c\x8c\x91\x3c\xeb\x81\x17\xdf" "\x97\x11\x51\x07\x86\x54\x22\xff\x61\x48\x35\xe7\x01\xcd\x7b\xfb\x3e\xdd" "\x07\x3f\x37\xee\x7d\xb0\x7e\x03\xb4\x39\xfe\xd1\xf5\xf7\x46\x62\x4f\xe3" "\xde\x68\xdf\x5a\xf2\xd0\x9d\x51\x76\xbf\x3b\xde\x87\xf6\xb3\x36\x7e\xfd" "\xf3\xd6\xcd\x6c\x8b\xfe\xbd\x0f\x01\xd0\xd5\xb5\xeb\x11\x71\x72\x74\x74" "\xf3\xf8\x97\xe4\xe3\xdf\xf6\x9d\xec\xe1\x98\x47\xdb\x30\xfe\xc1\xb3\x73" "\x3b\x9b\xff\xbc\xd9\x6e\xfe\x53\xd8\x98\xff\x44\x9b\xf9\xcf\xfe\x36\xb9" "\xbb\x1d\xdd\xf3\xbf\x70\xb7\x0f\xcd\x74\x94\xcd\xff\xde\x6f\x3b\xff\xdd" "\x58\xb4\x1a\x1f\xc9\x6b\xff\x6b\xcc\xf9\xc6\x92\xf3\x17\xca\x69\x36\xb6" "\xfd\x3f\x22\x8e\xc5\xd8\xee\xac\xbe\xd5\x7a\xce\xa9\xb5\x3b\xf5\x4e\xfb" "\x5a\xe7\x7f\xd9\x96\xb5\xdf\x9c\x0b\xe6\xe7\x71\x77\x74\xf7\xc3\xcf\x99" "\x2b\xd5\x4a\x4f\x12\x73\xab\x7b\xd7\x23\x5e\x69\x3b\xff\x4d\x36\xfa\x3f" "\x69\xd3\xff\xd9\xeb\x71\xb6\xc7\x36\x8e\xa4\xb7\x5e\xeb\xb4\xaf\x7b\xfc" "\x4f\x57\xfd\xa7\x88\xd7\xdb\xf6\xff\x83\x15\xad\x64\xeb\xf5\xc9\xc9\xc6" "\xf5\x30\xd9\xbc\x2a\x36\xfb\xfb\xc6\x91\xdf\x3b\xb5\xbf\xd3\xf1\x67\xfd" "\xbf\x6f\xeb\xf8\xc7\x93\xd6\xf5\xda\xea\xe3\xb7\xf1\xe3\x9e\x7f\xd3\x4e" "\xfb\x1e\x8a\x3f\x7a\xbf\xfe\x77\x25\x9f\x35\xca\xbb\xf2\xc7\xae\x94\x6a" "\xb5\xa5\xa9\x88\x5d\xc9\xc7\x9b\x1f\x9f\x7e\xf0\xdc\x66\xbd\x79\x7c\x16" "\xff\xb1\xa3\x5b\x8f\x7f\xed\xae\xff\xbd\x11\xf1\x79\x8f\xf1\xdf\x38\xfc" "\xf3\xab\x3d\xc5\xdf\xad\xff\x9f\xc2\x22\x6b\x16\xff\xdc\x63\xf5\xff\xe3" "\x17\xee\x7c\xf4\xc5\x0f\xdb\x8f\x3f\xeb\xff\xb7\x1a\xa5\x63\xf9\x23\xbd" "\x8c\x7f\xbd\x9e\xe0\x93\xbc\x76\x00\x00\x00\x00\x00\x00\x30\x68\x0a\x11" "\x71\x20\x92\x42\x71\xa3\x5c\x28\x14\x8b\xeb\x9f\xef\x38\x1c\xfb\x0a\xe5" "\x4a\xb5\x76\xfc\x7c\x65\xf9\xe2\x5c\x34\xbe\x2b\x3b\x1e\x63\x85\xe6\x4a" "\xf7\xc1\x96\xcf\x43\x4c\xe5\x9f\x87\x6d\xd6\xa7\x1f\xa9\xcf\x44\xc4\xa1" "\x88\xf8\x76\x64\x6f\xa3\x5e\x9c\xad\x94\xe7\x76\x3a\x78\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x18\x10\xfb\x3b\x7c\xff\x3f" "\xf3\xc7\xc8\x4e\x9f\x1d\xf0\xd4\xf9\xc9\x6f\x18\x5e\x5d\xf3\xbf\x1f\xbf" "\xf4\x04\x0c\x24\xff\xff\xc3\xf0\x92\xff\x30\xbc\xe4\x3f\x0c\x2f\xf9\x0f" "\xc3\x4b\xfe\xc3\xf0\x92\xff\x30\xbc\xe4\x3f\x0c\x2f\xf9\x0f\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x7d\x75\xf6\xcc\x99\x6c\xab\xaf\xdd\xbf\x3a\x9b\xd5\xe7\x2e\xaf\x2c\x2f" "\x54\x2e\x9f\x98\x4b\xab\x0b\xc5\xc5\xe5\xd9\xe2\x6c\x65\xe9\x52\x71\xbe" "\x52\x99\x2f\xa7\xc5\xd9\xca\x62\xb7\xbf\x57\xae\x54\x2e\x4d\x4d\xc7\xf2" "\x95\xc9\x5a\x5a\xad\x4d\x56\x57\x56\xcf\x2d\x56\x96\x2f\xd6\xce\x5d\x58" "\x2c\xcd\xa7\xe7\xd2\xb1\x67\x12\x15\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x3c\x5f\xaa\x2b\xab\x0b\xa5\x72\x39\x5d\x52\x50" "\xd8\x56\x61\x74\x30\x4e\x63\x75\x21\x62\x20\x4e\xe3\x45\x29\xec\xf4\xc8" "\x04\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0f\xfc\x17\x00" "\x00\xff\xff\xf0\xd2\x36\xe5", 1375); syz_mount_image( /*fs=*/0x200000000040, /*dir=*/0x200000000000, /*flags=MS_LAZYTIME|MS_STRICTATIME|MS_NOSUID|MS_NODEV|MS_MANDLOCK*/ 0x3000046, /*opts=*/0x200000000b00, /*chdir=*/1, /*size=*/0x55f, /*img=*/0x200000000580); // lsetxattr$trusted_overlay_upper arguments: [ // path: ptr[in, buffer] { // buffer: {2e 2f 66 69 6c 65 31 00} (length 0x8) // } // name: ptr[in, buffer] { // buffer: {74 72 75 73 74 65 64 2e 6f 76 65 72 6c 61 79 2e 75 70 70 65 // 72 00} (length 0x16) // } // val: ptr[inout, array[ANYUNION]] { // array[ANYUNION] { // } // } // size: len = 0x361 (8 bytes) // flags: setxattr_flags = 0x0 (8 bytes) // ] memcpy((void*)0x2000000001c0, "./file1\000", 8); memcpy((void*)0x200000000180, "trusted.overlay.upper\000", 22); syscall(__NR_lsetxattr, /*path=*/0x2000000001c0ul, /*name=*/0x200000000180ul, /*val=*/0x2000000001c0ul, /*size=*/0x361ul, /*flags=*/0ul); // lsetxattr$security_ima arguments: [ // path: ptr[in, buffer] { // buffer: {2e 2f 66 69 6c 65 31 00} (length 0x8) // } // name: ptr[in, buffer] { // buffer: {73 65 63 75 72 69 74 79 2e 69 6d 61 00} (length 0xd) // } // val: ptr[inout, array[ANYUNION]] { // array[ANYUNION] { // } // } // size: len = 0x9 (8 bytes) // flags: setxattr_flags = 0x1 (8 bytes) // ] memcpy((void*)0x200000000080, "./file1\000", 8); memcpy((void*)0x2000000000c0, "security.ima\000", 13); syscall(__NR_lsetxattr, /*path=*/0x200000000080ul, /*name=*/0x2000000000c0ul, /*val=*/0x200000000200ul, /*size=*/9ul, /*flags=XATTR_CREATE*/ 1ul); // lsetxattr$system_posix_acl arguments: [ // path: ptr[in, buffer] { // buffer: {2e 2f 66 69 6c 65 31 00} (length 0x8) // } // name: ptr[in, buffer] { // buffer: {73 79 73 74 65 6d 2e 70 6f 73 69 78 5f 61 63 6c 5f 61 63 63 // 65 73 73 00} (length 0x18) // } // val: ptr[inout, array[ANYUNION]] { // array[ANYUNION] { // union ANYUNION { // ANYBLOB: buffer: {02 00 00 00 01 00 00 00 00 00 00 00 04 00 00 00 // 00 00 00 00 10 00 00 00 00 00 00 00 20} (length 0x1d) // } // } // } // size: len = 0x24 (8 bytes) // flags: setxattr_flags = 0x0 (8 bytes) // ] memcpy((void*)0x200000000000, "./file1\000", 8); memcpy((void*)0x2000000003c0, "system.posix_acl_access\000", 24); memcpy((void*)0x200000000140, "\x02\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x04\x00\x00\x00\x00" "\x00\x00\x00\x10\x00\x00\x00\x00\x00\x00\x00\x20", 29); syscall(__NR_lsetxattr, /*path=*/0x200000000000ul, /*name=*/0x2000000003c0ul, /*val=*/0x200000000140ul, /*size=*/0x24ul, /*flags=*/0ul); // bpf$PROG_LOAD arguments: [ // cmd: const = 0x5 (8 bytes) // arg: ptr[in, bpf_prog_t[flags[bpf_prog_type, int32], // bpf_prog_attach_types, bpf_btf_id[opt], fd_bpf_prog[opt]]] { // bpf_prog_t[flags[bpf_prog_type, int32], bpf_prog_attach_types, // bpf_btf_id[opt], fd_bpf_prog[opt]] { // type: bpf_prog_type = 0x11 (4 bytes) // ninsn: bytesize8 = 0x18 (4 bytes) // insns: ptr[in, bpf_instructions] { // union bpf_instructions { // ringbuf: bpf_program_ringbuf { // initr0: bpf_insn_init_r0 { // code: const = 0x18 (1 bytes) // dst: const = 0x0 (0 bytes) // src: const = 0x0 (1 bytes) // off: const = 0x0 (2 bytes) // imm: int32 = 0x0 (4 bytes) // code2: const = 0x0 (1 bytes) // regs2: const = 0x0 (1 bytes) // off2: const = 0x0 (2 bytes) // imm2: int32 = 0x0 (4 bytes) // } // reserve: bpf_insn_ringbuf_reserve { // insn1: bpf_insn_map_fd_t[const[BPF_REG_1, int8:4], // ringbuf_map_fd] { // code: const = 0x18 (1 bytes) // dst: const = 0x1 (0 bytes) // src: const = 0x1 (1 bytes) // off: const = 0x0 (2 bytes) // imm: ringbuf_map_fd (resource) // code2: const = 0x0 (1 bytes) // regs2: const = 0x0 (1 bytes) // off2: const = 0x0 (2 bytes) // imm2: const = 0x0 (4 bytes) // } // insn2: bpf_insn_alu_t[BPF_ALU64, BPF_K0, BPF_MOV0, // const[BPF_REG_2, int8:4], const[0, int8:4], const[0, int16], // const[20, int32]] { // code_class: int8 = 0x7 (0 bytes) // code_s: int8 = 0x0 (0 bytes) // code_op: int8 = 0xb (1 bytes) // dst: const = 0x2 (0 bytes) // src: const = 0x0 (1 bytes) // off: const = 0x0 (2 bytes) // imm: const = 0x14 (4 bytes) // } // insn3: bpf_insn_alu_t[BPF_ALU64, BPF_K0, BPF_MOV0, // const[BPF_REG_3, int8:4], const[0, int8:4], const[0, int16], // const[0, int32]] { // code_class: int8 = 0x7 (0 bytes) // code_s: int8 = 0x0 (0 bytes) // code_op: int8 = 0xb (1 bytes) // dst: const = 0x3 (0 bytes) // src: const = 0x0 (1 bytes) // off: const = 0x0 (2 bytes) // imm: const = 0x0 (4 bytes) // } // insn4: // bpf_insn_call_helper_t[const[BPF_FUNC_ringbuf_reserve, // int32]] { // code: const = 0x85 (1 bytes) // regs: const = 0x0 (1 bytes) // off: const = 0x0 (2 bytes) // func: const = 0x83 (4 bytes) // } // insn5: bpf_insn_alu_t[BPF_ALU64, BPF_X0, BPF_MOV0, // const[BPF_REG_9, int8:4], const[BPF_REG_0, int8:4], const[0, // int16], const[0, int32]] { // code_class: int8 = 0x7 (0 bytes) // code_s: int8 = 0x1 (0 bytes) // code_op: int8 = 0xb (1 bytes) // dst: const = 0x9 (0 bytes) // src: const = 0x0 (1 bytes) // off: const = 0x0 (2 bytes) // imm: const = 0x0 (4 bytes) // } // } // null_check: bpf_insn_null_check[BPF_REG_9] { // cond_jump: bpf_insn_not_null_jmp[BPF_REG_9] { // code_class: const = 0x5 (0 bytes) // code_s: const = 0x0 (0 bytes) // code_op: const = 0x5 (1 bytes) // dst: const = 0x9 (0 bytes) // src: const = 0x0 (1 bytes) // off: const = 0x1 (2 bytes) // imm: const = 0x0 (4 bytes) // } // exit: bpf_insn_exit { // code: const = 0x95 (1 bytes) // regs: const = 0x0 (1 bytes) // off: const = 0x0 (2 bytes) // imm: const = 0x0 (4 bytes) // } // } // body: array[bpf_insn] { // union bpf_insn { // ringbuf_output: bpf_insn_ringbuf_output { // insn1: bpf_insn_map_fd_t[const[BPF_REG_1, int8:4], // tail_call_map] { // code: const = 0x18 (1 bytes) // dst: const = 0x1 (0 bytes) // src: const = 0x1 (1 bytes) // off: const = 0x0 (2 bytes) // imm: tail_call_map (resource) // code2: const = 0x0 (1 bytes) // regs2: const = 0x0 (1 bytes) // off2: const = 0x0 (2 bytes) // imm2: const = 0x0 (4 bytes) // } // insn2: bpf_insn_alu_t[BPF_ALU64, BPF_K0, BPF_MOV0, // const[BPF_REG_8, int8:4], const[0, int8:4], const[0, // int16], int32] { // code_class: int8 = 0x7 (0 bytes) // code_s: int8 = 0x0 (0 bytes) // code_op: int8 = 0xb (1 bytes) // dst: const = 0x8 (0 bytes) // src: const = 0x0 (1 bytes) // off: const = 0x0 (2 bytes) // imm: int32 = 0x0 (4 bytes) // } // insn3: bpf_insn_ldst_t[BPF_STX, BPF_DW0, BPF_MEM0, // const[BPF_REG_10, int8:4], const[BPF_REG_8, int8:4], // const[-8, int16], const[0, int32]] { // code_class: int8 = 0x3 (0 bytes) // code_size: int8 = 0x3 (0 bytes) // code_mode: int8 = 0x3 (1 bytes) // dst: const = 0xa (0 bytes) // src: const = 0x8 (1 bytes) // off: const = 0xfff8 (2 bytes) // imm: const = 0x0 (4 bytes) // } // insn4: bpf_insn_alu_t[BPF_ALU64, BPF_X0, BPF_MOV0, // const[BPF_REG_2, int8:4], const[BPF_REG_10, int8:4], // const[0, int16], const[0, int32]] { // code_class: int8 = 0x7 (0 bytes) // code_s: int8 = 0x1 (0 bytes) // code_op: int8 = 0xb (1 bytes) // dst: const = 0x2 (0 bytes) // src: const = 0xa (1 bytes) // off: const = 0x0 (2 bytes) // imm: const = 0x0 (4 bytes) // } // insn5: bpf_insn_alu_t[BPF_ALU64, BPF_K0, BPF_ADD0, // const[BPF_REG_2, int8:4], const[0, int8:4], const[0, // int16], const[-8, int32]] { // code_class: int8 = 0x7 (0 bytes) // code_s: int8 = 0x0 (0 bytes) // code_op: int8 = 0x0 (1 bytes) // dst: const = 0x2 (0 bytes) // src: const = 0x0 (1 bytes) // off: const = 0x0 (2 bytes) // imm: const = 0xfffffff8 (4 bytes) // } // insn6: bpf_insn_alu_t[BPF_ALU64, BPF_K0, BPF_MOV0, // const[BPF_REG_3, int8:4], const[0, int8:4], const[0, // int16], const[8, int32]] { // code_class: int8 = 0x7 (0 bytes) // code_s: int8 = 0x0 (0 bytes) // code_op: int8 = 0xb (1 bytes) // dst: const = 0x3 (0 bytes) // src: const = 0x0 (1 bytes) // off: const = 0x0 (2 bytes) // imm: const = 0x8 (4 bytes) // } // insn7: bpf_insn_alu_t[BPF_ALU64, BPF_K0, BPF_MOV0, // const[BPF_REG_4, int8:4], const[0, int8:4], const[0, // int16], flags[bpf_ringbuf_wakeup_flags, int32]] { // code_class: int8 = 0x7 (0 bytes) // code_s: int8 = 0x0 (0 bytes) // code_op: int8 = 0xb (1 bytes) // dst: const = 0x4 (0 bytes) // src: const = 0x0 (1 bytes) // off: const = 0x0 (2 bytes) // imm: bpf_ringbuf_wakeup_flags = 0x2 (4 bytes) // } // insn8: // bpf_insn_call_helper_t[const[BPF_FUNC_ringbuf_output, // int32]] { // code: const = 0x85 (1 bytes) // regs: const = 0x0 (1 bytes) // off: const = 0x0 (2 bytes) // func: const = 0x82 (4 bytes) // } // } // } // } // free: bpf_insn_ringbuf_free { // insn1: bpf_insn_alu_t[BPF_ALU64, BPF_X0, BPF_MOV0, // const[BPF_REG_1, int8:4], const[BPF_REG_9, int8:4], const[0, // int16], const[0, int32]] { // code_class: int8 = 0x7 (0 bytes) // code_s: int8 = 0x1 (0 bytes) // code_op: int8 = 0xb (1 bytes) // dst: const = 0x1 (0 bytes) // src: const = 0x9 (1 bytes) // off: const = 0x0 (2 bytes) // imm: const = 0x0 (4 bytes) // } // insn2: bpf_insn_alu_t[BPF_ALU64, BPF_K0, BPF_MOV0, // const[BPF_REG_2, int8:4], const[0, int8:4], const[0, int16], // flags[bpf_ringbuf_wakeup_flags, int32]] { // code_class: int8 = 0x7 (0 bytes) // code_s: int8 = 0x0 (0 bytes) // code_op: int8 = 0xb (1 bytes) // dst: const = 0x2 (0 bytes) // src: const = 0x0 (1 bytes) // off: const = 0x0 (2 bytes) // imm: bpf_ringbuf_wakeup_flags = 0x2 (4 bytes) // } // insn3: // bpf_insn_call_helper_t[flags[bpf_helpers_ringbuf_free, // int32]] { // code: const = 0x85 (1 bytes) // regs: const = 0x0 (1 bytes) // off: const = 0x0 (2 bytes) // func: bpf_helpers_ringbuf_free = 0x84 (4 bytes) // } // insn4: bpf_insn_alu_t[BPF_ALU64, BPF_K0, BPF_MOV0, // const[BPF_REG_0, int8:4], const[0, int8:4], const[0, int16], // const[0, int32]] { // code_class: int8 = 0x7 (0 bytes) // code_s: int8 = 0x0 (0 bytes) // code_op: int8 = 0xb (1 bytes) // dst: const = 0x0 (0 bytes) // src: const = 0x0 (1 bytes) // off: const = 0x0 (2 bytes) // imm: const = 0x0 (4 bytes) // } // } // exit: bpf_insn_exit { // code: const = 0x95 (1 bytes) // regs: const = 0x0 (1 bytes) // off: const = 0x0 (2 bytes) // imm: const = 0x0 (4 bytes) // } // } // } // } // license: nil // loglev: int32 = 0x0 (4 bytes) // logsize: len = 0x0 (4 bytes) // log: nil // kern_version: bpf_kern_version = 0x0 (4 bytes) // flags: bpf_prog_load_flags = 0x0 (4 bytes) // prog_name: buffer: {00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00} // (length 0x10) prog_ifindex: ifindex (resource) expected_attach_type: // union bpf_prog_attach_types { // fallback: bpf_attach_types = 0x13 (4 bytes) // } // btf_fd: fd_btf (resource) // func_info_rec_size: const = 0x0 (4 bytes) // func_info: nil // func_info_cnt: len = 0x0 (4 bytes) // line_info_rec_size: const = 0x0 (4 bytes) // line_info: nil // line_info_cnt: len = 0x0 (4 bytes) // attach_btf_id: bpf_btf_id (resource) // attach_prog_fd: fd_bpf_prog (resource) // core_relo_cnt: len = 0x0 (4 bytes) // fd_array: nil // core_relos: nil // core_relo_rec_size: const = 0x0 (4 bytes) // log_true_size: int32 = 0x0 (4 bytes) // prog_token_fd: union _bpf_prog_t[flags[bpf_prog_type, int32], // bpf_prog_attach_types, bpf_btf_id[opt], // fd_bpf_prog[opt]]_prog_token_fd_wrapper { // void: buffer: {} (length 0x0) // } // pad: union _bpf_prog_t[flags[bpf_prog_type, int32], // bpf_prog_attach_types, bpf_btf_id[opt], // fd_bpf_prog[opt]]_pad_wrapper { // value: const = 0x0 (4 bytes) // } // } // } // size: len = 0x94 (8 bytes) // ] // returns fd_bpf_prog *(uint32_t*)0x200000000500 = 0x11; *(uint32_t*)0x200000000504 = 0x18; *(uint64_t*)0x200000000508 = 0x200000000400; *(uint8_t*)0x200000000400 = 0x18; STORE_BY_BITMASK(uint8_t, , 0x200000000401, 0, 0, 4); STORE_BY_BITMASK(uint8_t, , 0x200000000401, 0, 4, 4); *(uint16_t*)0x200000000402 = 0; *(uint32_t*)0x200000000404 = 0; *(uint8_t*)0x200000000408 = 0; *(uint8_t*)0x200000000409 = 0; *(uint16_t*)0x20000000040a = 0; *(uint32_t*)0x20000000040c = 0; *(uint8_t*)0x200000000410 = 0x18; STORE_BY_BITMASK(uint8_t, , 0x200000000411, 1, 0, 4); STORE_BY_BITMASK(uint8_t, , 0x200000000411, 1, 4, 4); *(uint16_t*)0x200000000412 = 0; *(uint32_t*)0x200000000414 = -1; *(uint8_t*)0x200000000418 = 0; *(uint8_t*)0x200000000419 = 0; *(uint16_t*)0x20000000041a = 0; *(uint32_t*)0x20000000041c = 0; STORE_BY_BITMASK(uint8_t, , 0x200000000420, 7, 0, 3); STORE_BY_BITMASK(uint8_t, , 0x200000000420, 0, 3, 1); STORE_BY_BITMASK(uint8_t, , 0x200000000420, 0xb, 4, 4); STORE_BY_BITMASK(uint8_t, , 0x200000000421, 2, 0, 4); STORE_BY_BITMASK(uint8_t, , 0x200000000421, 0, 4, 4); *(uint16_t*)0x200000000422 = 0; *(uint32_t*)0x200000000424 = 0x14; STORE_BY_BITMASK(uint8_t, , 0x200000000428, 7, 0, 3); STORE_BY_BITMASK(uint8_t, , 0x200000000428, 0, 3, 1); STORE_BY_BITMASK(uint8_t, , 0x200000000428, 0xb, 4, 4); STORE_BY_BITMASK(uint8_t, , 0x200000000429, 3, 0, 4); STORE_BY_BITMASK(uint8_t, , 0x200000000429, 0, 4, 4); *(uint16_t*)0x20000000042a = 0; *(uint32_t*)0x20000000042c = 0; *(uint8_t*)0x200000000430 = 0x85; *(uint8_t*)0x200000000431 = 0; *(uint16_t*)0x200000000432 = 0; *(uint32_t*)0x200000000434 = 0x83; STORE_BY_BITMASK(uint8_t, , 0x200000000438, 7, 0, 3); STORE_BY_BITMASK(uint8_t, , 0x200000000438, 1, 3, 1); STORE_BY_BITMASK(uint8_t, , 0x200000000438, 0xb, 4, 4); STORE_BY_BITMASK(uint8_t, , 0x200000000439, 9, 0, 4); STORE_BY_BITMASK(uint8_t, , 0x200000000439, 0, 4, 4); *(uint16_t*)0x20000000043a = 0; *(uint32_t*)0x20000000043c = 0; STORE_BY_BITMASK(uint8_t, , 0x200000000440, 5, 0, 3); STORE_BY_BITMASK(uint8_t, , 0x200000000440, 0, 3, 1); STORE_BY_BITMASK(uint8_t, , 0x200000000440, 5, 4, 4); STORE_BY_BITMASK(uint8_t, , 0x200000000441, 9, 0, 4); STORE_BY_BITMASK(uint8_t, , 0x200000000441, 0, 4, 4); *(uint16_t*)0x200000000442 = 1; *(uint32_t*)0x200000000444 = 0; *(uint8_t*)0x200000000448 = 0x95; *(uint8_t*)0x200000000449 = 0; *(uint16_t*)0x20000000044a = 0; *(uint32_t*)0x20000000044c = 0; *(uint8_t*)0x200000000450 = 0x18; STORE_BY_BITMASK(uint8_t, , 0x200000000451, 1, 0, 4); STORE_BY_BITMASK(uint8_t, , 0x200000000451, 1, 4, 4); *(uint16_t*)0x200000000452 = 0; *(uint32_t*)0x200000000454 = -1; *(uint8_t*)0x200000000458 = 0; *(uint8_t*)0x200000000459 = 0; *(uint16_t*)0x20000000045a = 0; *(uint32_t*)0x20000000045c = 0; STORE_BY_BITMASK(uint8_t, , 0x200000000460, 7, 0, 3); STORE_BY_BITMASK(uint8_t, , 0x200000000460, 0, 3, 1); STORE_BY_BITMASK(uint8_t, , 0x200000000460, 0xb, 4, 4); STORE_BY_BITMASK(uint8_t, , 0x200000000461, 8, 0, 4); STORE_BY_BITMASK(uint8_t, , 0x200000000461, 0, 4, 4); *(uint16_t*)0x200000000462 = 0; *(uint32_t*)0x200000000464 = 0; STORE_BY_BITMASK(uint8_t, , 0x200000000468, 3, 0, 3); STORE_BY_BITMASK(uint8_t, , 0x200000000468, 3, 3, 2); STORE_BY_BITMASK(uint8_t, , 0x200000000468, 3, 5, 3); STORE_BY_BITMASK(uint8_t, , 0x200000000469, 0xa, 0, 4); STORE_BY_BITMASK(uint8_t, , 0x200000000469, 8, 4, 4); *(uint16_t*)0x20000000046a = 0xfff8; *(uint32_t*)0x20000000046c = 0; STORE_BY_BITMASK(uint8_t, , 0x200000000470, 7, 0, 3); STORE_BY_BITMASK(uint8_t, , 0x200000000470, 1, 3, 1); STORE_BY_BITMASK(uint8_t, , 0x200000000470, 0xb, 4, 4); STORE_BY_BITMASK(uint8_t, , 0x200000000471, 2, 0, 4); STORE_BY_BITMASK(uint8_t, , 0x200000000471, 0xa, 4, 4); *(uint16_t*)0x200000000472 = 0; *(uint32_t*)0x200000000474 = 0; STORE_BY_BITMASK(uint8_t, , 0x200000000478, 7, 0, 3); STORE_BY_BITMASK(uint8_t, , 0x200000000478, 0, 3, 1); STORE_BY_BITMASK(uint8_t, , 0x200000000478, 0, 4, 4); STORE_BY_BITMASK(uint8_t, , 0x200000000479, 2, 0, 4); STORE_BY_BITMASK(uint8_t, , 0x200000000479, 0, 4, 4); *(uint16_t*)0x20000000047a = 0; *(uint32_t*)0x20000000047c = 0xfffffff8; STORE_BY_BITMASK(uint8_t, , 0x200000000480, 7, 0, 3); STORE_BY_BITMASK(uint8_t, , 0x200000000480, 0, 3, 1); STORE_BY_BITMASK(uint8_t, , 0x200000000480, 0xb, 4, 4); STORE_BY_BITMASK(uint8_t, , 0x200000000481, 3, 0, 4); STORE_BY_BITMASK(uint8_t, , 0x200000000481, 0, 4, 4); *(uint16_t*)0x200000000482 = 0; *(uint32_t*)0x200000000484 = 8; STORE_BY_BITMASK(uint8_t, , 0x200000000488, 7, 0, 3); STORE_BY_BITMASK(uint8_t, , 0x200000000488, 0, 3, 1); STORE_BY_BITMASK(uint8_t, , 0x200000000488, 0xb, 4, 4); STORE_BY_BITMASK(uint8_t, , 0x200000000489, 4, 0, 4); STORE_BY_BITMASK(uint8_t, , 0x200000000489, 0, 4, 4); *(uint16_t*)0x20000000048a = 0; *(uint32_t*)0x20000000048c = 2; *(uint8_t*)0x200000000490 = 0x85; *(uint8_t*)0x200000000491 = 0; *(uint16_t*)0x200000000492 = 0; *(uint32_t*)0x200000000494 = 0x82; STORE_BY_BITMASK(uint8_t, , 0x200000000498, 7, 0, 3); STORE_BY_BITMASK(uint8_t, , 0x200000000498, 1, 3, 1); STORE_BY_BITMASK(uint8_t, , 0x200000000498, 0xb, 4, 4); STORE_BY_BITMASK(uint8_t, , 0x200000000499, 1, 0, 4); STORE_BY_BITMASK(uint8_t, , 0x200000000499, 9, 4, 4); *(uint16_t*)0x20000000049a = 0; *(uint32_t*)0x20000000049c = 0; STORE_BY_BITMASK(uint8_t, , 0x2000000004a0, 7, 0, 3); STORE_BY_BITMASK(uint8_t, , 0x2000000004a0, 0, 3, 1); STORE_BY_BITMASK(uint8_t, , 0x2000000004a0, 0xb, 4, 4); STORE_BY_BITMASK(uint8_t, , 0x2000000004a1, 2, 0, 4); STORE_BY_BITMASK(uint8_t, , 0x2000000004a1, 0, 4, 4); *(uint16_t*)0x2000000004a2 = 0; *(uint32_t*)0x2000000004a4 = 2; *(uint8_t*)0x2000000004a8 = 0x85; *(uint8_t*)0x2000000004a9 = 0; *(uint16_t*)0x2000000004aa = 0; *(uint32_t*)0x2000000004ac = 0x84; STORE_BY_BITMASK(uint8_t, , 0x2000000004b0, 7, 0, 3); STORE_BY_BITMASK(uint8_t, , 0x2000000004b0, 0, 3, 1); STORE_BY_BITMASK(uint8_t, , 0x2000000004b0, 0xb, 4, 4); STORE_BY_BITMASK(uint8_t, , 0x2000000004b1, 0, 0, 4); STORE_BY_BITMASK(uint8_t, , 0x2000000004b1, 0, 4, 4); *(uint16_t*)0x2000000004b2 = 0; *(uint32_t*)0x2000000004b4 = 0; *(uint8_t*)0x2000000004b8 = 0x95; *(uint8_t*)0x2000000004b9 = 0; *(uint16_t*)0x2000000004ba = 0; *(uint32_t*)0x2000000004bc = 0; *(uint64_t*)0x200000000510 = 0; *(uint32_t*)0x200000000518 = 0; *(uint32_t*)0x20000000051c = 0; *(uint64_t*)0x200000000520 = 0; *(uint32_t*)0x200000000528 = 0; *(uint32_t*)0x20000000052c = 0; memset((void*)0x200000000530, 0, 16); *(uint32_t*)0x200000000540 = 0; *(uint32_t*)0x200000000544 = 0x13; *(uint32_t*)0x200000000548 = -1; *(uint32_t*)0x20000000054c = 0; *(uint64_t*)0x200000000550 = 0; *(uint32_t*)0x200000000558 = 0; *(uint32_t*)0x20000000055c = 0; *(uint64_t*)0x200000000560 = 0; *(uint32_t*)0x200000000568 = 0; *(uint32_t*)0x20000000056c = 0; *(uint32_t*)0x200000000570 = 0; *(uint32_t*)0x200000000574 = 0; *(uint64_t*)0x200000000578 = 0; *(uint64_t*)0x200000000580 = 0; *(uint32_t*)0x200000000588 = 0; *(uint32_t*)0x20000000058c = 0; *(uint32_t*)0x200000000590 = 0; syscall(__NR_bpf, /*cmd=*/5ul, /*arg=*/0x200000000500ul, /*size=*/0x94ul); // lsetxattr$trusted_overlay_upper arguments: [ // path: ptr[in, buffer] { // buffer: {2e 2f 66 69 6c 65 31 00} (length 0x8) // } // name: ptr[in, buffer] { // buffer: {74 72 75 73 74 65 64 2e 6f 76 65 72 6c 61 79 2e 75 70 70 65 // 72 00} (length 0x16) // } // val: ptr[inout, array[ANYUNION]] { // array[ANYUNION] { // } // } // size: len = 0xfe37 (8 bytes) // flags: setxattr_flags = 0x0 (8 bytes) // ] memcpy((void*)0x200000000100, "./file1\000", 8); memcpy((void*)0x2000000000c0, "trusted.overlay.upper\000", 22); syscall(__NR_lsetxattr, /*path=*/0x200000000100ul, /*name=*/0x2000000000c0ul, /*val=*/0x200000000480ul, /*size=*/0xfe37ul, /*flags=*/0ul); return 0; }