// https://syzkaller.appspot.com/bug?id=9d5401918f3bee146505d56912b0c57dbc0743d9 // autogenerated by syzkaller (https://github.com/google/syzkaller) #define _GNU_SOURCE #include #include #include #include #include #include #include #include #include #ifndef __NR_bpf #define __NR_bpf 321 #endif 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; if (write(1, "executing program\n", sizeof("executing program\n") - 1)) { } // 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 = 0x1 (4 bytes) // ninsn: bytesize8 = 0x4 (4 bytes) // insns: ptr[inout, array[ANYUNION]] { // array[ANYUNION] { // union ANYUNION { // ANYBLOB: buffer: {18 00 00 00 81 00 00 00 00 00 00 00 09 00 00 // 00 85 00 00 00 8d 00 00 00 99 8b 6f 17 90 a4 ef 18 93 c6 3c c0 // 95 00 00 00 00 00 00 00 5b 2e d9 be 9c 41 2c 10 9d 47 c6 2a c8 // 82 41 98 d2 a9 87 51 91 24 6b 2b 16 93 f0 a5 17 45 2d c9 40 0d // d5 7e 21 49 54 52 64 8b be ea d8 cb b2 8c 21 33 89 51 00 f2 fb // f2 ab b9 95 13 bb 54 20 49 93 d4 c6 bf 0c 6d 02 0e 8b e9 a7 64 // a7 fe df b8 0d ef 04 42 a3 55 94 2b 8e 98 13 78 8f 99 ea 02 fc // 3a 58 4d 1a e1 cd 48 f0 ff e5 0f 16 d0 14 92 52 56 c8 b7 04 8d // 2d 0d bf 5b 8f c4 13 2c 7c 36 b7 c7 f5 f2 d5 df 22 e3 7b de f5 // 94 ce ef 3f 56 4e 17 34 e1 01 2b 7c be e7 2d 87 b9 7a bf ca 1b // 9c fd ea 30 26 3f 77 a3 34 ed 9d 2d 8f fc c0 bc d7 ba 91 cb 4f // fb b8 ca 0f b5 ff 42 87 b0 c8 67 fc f6 6f 03 03 76 47 93 b6 e2 // ba a5 a0 41 5f 74 e0 2e 73 ed 7f 12 83 e2 f7 52 07 f4 c5 a0 69 // 9f b8 2d 4e fe fb 72 93 95 fe fc 9b 7b 2f db 03 3c 5c ab d9 ee // 2d 03 bc c4 c5 6e 3c 94 46 48 39 39 73 2c 53 c1 5d a3 55 24 7c // 1d fc 02 4c c3 79 ab 4e 41 ae 13 74 8d cc e4 f6 c4 bb 2f cb e9 // 50 0f 80 70 21} (length 0x14f) // } // } // } // license: ptr[in, buffer] { // buffer: {73 79 7a 6b 61 6c 6c 65 72 00} (length 0xa) // } // loglev: int32 = 0x2 (4 bytes) // logsize: len = 0x0 (4 bytes) // log: nil // kern_version: bpf_kern_version = 0x0 (4 bytes) // flags: bpf_prog_load_flags = 0x20 (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 = 0xb (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 = 0x8 (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*)0x200000000180 = 1; *(uint32_t*)0x200000000184 = 4; *(uint64_t*)0x200000000188 = 0x200000000240; memcpy( (void*)0x200000000240, "\x18\x00\x00\x00\x81\x00\x00\x00\x00\x00\x00\x00\x09\x00\x00\x00\x85\x00" "\x00\x00\x8d\x00\x00\x00\x99\x8b\x6f\x17\x90\xa4\xef\x18\x93\xc6\x3c\xc0" "\x95\x00\x00\x00\x00\x00\x00\x00\x5b\x2e\xd9\xbe\x9c\x41\x2c\x10\x9d\x47" "\xc6\x2a\xc8\x82\x41\x98\xd2\xa9\x87\x51\x91\x24\x6b\x2b\x16\x93\xf0\xa5" "\x17\x45\x2d\xc9\x40\x0d\xd5\x7e\x21\x49\x54\x52\x64\x8b\xbe\xea\xd8\xcb" "\xb2\x8c\x21\x33\x89\x51\x00\xf2\xfb\xf2\xab\xb9\x95\x13\xbb\x54\x20\x49" "\x93\xd4\xc6\xbf\x0c\x6d\x02\x0e\x8b\xe9\xa7\x64\xa7\xfe\xdf\xb8\x0d\xef" "\x04\x42\xa3\x55\x94\x2b\x8e\x98\x13\x78\x8f\x99\xea\x02\xfc\x3a\x58\x4d" "\x1a\xe1\xcd\x48\xf0\xff\xe5\x0f\x16\xd0\x14\x92\x52\x56\xc8\xb7\x04\x8d" "\x2d\x0d\xbf\x5b\x8f\xc4\x13\x2c\x7c\x36\xb7\xc7\xf5\xf2\xd5\xdf\x22\xe3" "\x7b\xde\xf5\x94\xce\xef\x3f\x56\x4e\x17\x34\xe1\x01\x2b\x7c\xbe\xe7\x2d" "\x87\xb9\x7a\xbf\xca\x1b\x9c\xfd\xea\x30\x26\x3f\x77\xa3\x34\xed\x9d\x2d" "\x8f\xfc\xc0\xbc\xd7\xba\x91\xcb\x4f\xfb\xb8\xca\x0f\xb5\xff\x42\x87\xb0" "\xc8\x67\xfc\xf6\x6f\x03\x03\x76\x47\x93\xb6\xe2\xba\xa5\xa0\x41\x5f\x74" "\xe0\x2e\x73\xed\x7f\x12\x83\xe2\xf7\x52\x07\xf4\xc5\xa0\x69\x9f\xb8\x2d" "\x4e\xfe\xfb\x72\x93\x95\xfe\xfc\x9b\x7b\x2f\xdb\x03\x3c\x5c\xab\xd9\xee" "\x2d\x03\xbc\xc4\xc5\x6e\x3c\x94\x46\x48\x39\x39\x73\x2c\x53\xc1\x5d\xa3" "\x55\x24\x7c\x1d\xfc\x02\x4c\xc3\x79\xab\x4e\x41\xae\x13\x74\x8d\xcc\xe4" "\xf6\xc4\xbb\x2f\xcb\xe9\x50\x0f\x80\x70\x21", 335); *(uint64_t*)0x200000000190 = 0x200000000080; memcpy((void*)0x200000000080, "syzkaller\000", 10); *(uint32_t*)0x200000000198 = 2; *(uint32_t*)0x20000000019c = 0; *(uint64_t*)0x2000000001a0 = 0; *(uint32_t*)0x2000000001a8 = 0; *(uint32_t*)0x2000000001ac = 0x20; memset((void*)0x2000000001b0, 0, 16); *(uint32_t*)0x2000000001c0 = 0; *(uint32_t*)0x2000000001c4 = 0xb; *(uint32_t*)0x2000000001c8 = 0; *(uint32_t*)0x2000000001cc = 0; *(uint64_t*)0x2000000001d0 = 0; *(uint32_t*)0x2000000001d8 = 0; *(uint32_t*)0x2000000001dc = 0; *(uint64_t*)0x2000000001e0 = 0; *(uint32_t*)0x2000000001e8 = 0; *(uint32_t*)0x2000000001ec = 0; *(uint32_t*)0x2000000001f0 = 0; *(uint32_t*)0x2000000001f4 = 0; *(uint64_t*)0x2000000001f8 = 0; *(uint64_t*)0x200000000200 = 0; *(uint32_t*)0x200000000208 = 0; *(uint32_t*)0x20000000020c = 8; *(uint32_t*)0x200000000210 = 0; syscall(__NR_bpf, /*cmd=*/5ul, /*arg=*/0x200000000180ul, /*size=*/0x94ul); return 0; }