// https://syzkaller.appspot.com/bug?id=da60588fafd041c978558ab70108a68dddac5379 // autogenerated by syzkaller (https://github.com/google/syzkaller) #define _GNU_SOURCE #include #include #include #include #include #include #include #include #ifndef __NR_bpf #define __NR_bpf 321 #endif uint64_t r[1] = {0xffffffffffffffff}; 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; intptr_t res = 0; if (write(1, "executing program\n", sizeof("executing program\n") - 1)) { } // openat$cgroup_ro arguments: [ // fd: fd_cgroup (resource) // file: ptr[in, buffer] { // buffer: {62 6c 6b 69 6f 2e 62 66 71 2e 74 69 6d 65 00} (length 0xf) // } // flags: const = 0x26e1 (4 bytes) // mode: const = 0x0 (2 bytes) // ] // returns fd memcpy((void*)0x200000000140, "blkio.bfq.time\000", 15); res = syscall(__NR_openat, /*fd=*/0xffffff9c, /*file=*/0x200000000140ul, /*flags=*/0x26e1, /*mode=*/0); if (res != -1) r[0] = res; // close arguments: [ // fd: fd (resource) // ] syscall(__NR_close, /*fd=*/r[0]); // 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 = 0x3 (4 bytes) // ninsn: bytesize8 = 0x16 (4 bytes) // insns: ptr[inout, array[ANYUNION]] { // array[ANYUNION] { // union ANYUNION { // ANYBLOB: buffer: {81 12 4c 00 00 00 00 00 61 13 50 00 00 00 00 // 00 bf 20 00 00 00 00 00 00 07 00 00 00 08 00 00 00 2d 03 01 00 // 00 00 00 00 95 00 00 00 00 00 00 00 69 26 00 00 00 00 00 00 bf // 67 00 00 00 00 00 00 15 06 00 00 0f ff 07 00 67 06 00 00 20 00 // 00 00 6a 02 00 00 0e e6 00 00 bf 05 00 00 00 00 00 00 3d 35 00 // 00 00 00 00 00 65 07 00 00 02 00 00 00 07 07 00 00 4a 00 00 00 // 0f 75 00 00 00 00 00 00 bf 54 00 00 00 00 00 00 07 04 00 00 04 // 00 f9 ff 2d 53 01 00 00 00 00 00 84 04 00 00 00 00 00 00 05 00 // 00 00 00 00 00 00 95 00 00 00 00 00 00 00 db 13 d5 d8 b7 41 f2 // cd aa bc 83 83 ca f5 6b 8c 2b 84 a8 d0 95 35 a1 57 f9 00 5b d3 // 8a dd aa 65 b9 25 cd 3d ed 25 b8 b9 e2 a0 95 d2 c5 1e f4 5c 55 // 88 ec 78 c7 f3 29 46 b1 7c ec fe 54 c5 3a b5 30 c5 8b 67 85 1b // 7e 0e 82 45 2a 08 3b 98 a6 aa 76 64 01 04 7d 15 02 03 b0 41 7e // de f3 32 23 3b 08 1d f1 89 61 d6 82 2d 13 3b f7 2a 4d e1 cc 08 // 00 00 45 37 fc 21 15 76 84 6a c6 29 d1 d9 32 65 ba 47 45 80 04 // 7a 9d c8 8d e3 58 ce 79 57 31 89 1a 20 31 de 4e 09 74 0c c8 55 // 25 d2 99 1e d4 78 5a 97 73 a4 33 e0 db 9c 1a 7d 4a b9 d6 58 ce // 9c fd b4 db 3b ed 62 bc b2 bc 91 dd cd fa c2 e6 d4 42 1c 49 fb // 66 41 cb f5 69 14 e7 67 02 f6 73 b5 86 c7 67 03 00 90 a3 96 70 // 93 b0 00 e3 80 6f 82 5f 1d 0d a2 a3 04 e0 65 43 b5 6d 35 23 5d // 78 b7 a7 fe 91 29 71 aa b8 76 02 2e 96 f5 14 3b 62 34 f5 a6 b7 // 01 69 0b 07 fb 66 4a 44 e2 2b 72 e8 43 e7 cf 55 f3 94 cf 75 d1 // cd 3e e7 9a 25 fb 98 cc 45 b3 fd e4 3e 42 e1 50 d4 a2 fd dd 9a // 97 67 74} (length 0x1e0) // } // } // } // license: ptr[in, buffer] { // buffer: {47 50 4c 00} (length 0x4) // } // 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 { // sched_cls: sched_cls_attach_types = 0x0 (4 bytes) // } // btf_fd: fd_btf (resource) // func_info_rec_size: const = 0x8 (4 bytes) // func_info: nil // func_info_cnt: len = 0x1c (4 bytes) // line_info_rec_size: const = 0x10 (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 = 0x10 (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 = 0x48 (8 bytes) // ] // returns fd_bpf_prog *(uint32_t*)0x2000000054c0 = 3; *(uint32_t*)0x2000000054c4 = 0x16; *(uint64_t*)0x2000000054c8 = 0x200000000340; memcpy( (void*)0x200000000340, "\x81\x12\x4c\x00\x00\x00\x00\x00\x61\x13\x50\x00\x00\x00\x00\x00\xbf\x20" "\x00\x00\x00\x00\x00\x00\x07\x00\x00\x00\x08\x00\x00\x00\x2d\x03\x01\x00" "\x00\x00\x00\x00\x95\x00\x00\x00\x00\x00\x00\x00\x69\x26\x00\x00\x00\x00" "\x00\x00\xbf\x67\x00\x00\x00\x00\x00\x00\x15\x06\x00\x00\x0f\xff\x07\x00" "\x67\x06\x00\x00\x20\x00\x00\x00\x6a\x02\x00\x00\x0e\xe6\x00\x00\xbf\x05" "\x00\x00\x00\x00\x00\x00\x3d\x35\x00\x00\x00\x00\x00\x00\x65\x07\x00\x00" "\x02\x00\x00\x00\x07\x07\x00\x00\x4a\x00\x00\x00\x0f\x75\x00\x00\x00\x00" "\x00\x00\xbf\x54\x00\x00\x00\x00\x00\x00\x07\x04\x00\x00\x04\x00\xf9\xff" "\x2d\x53\x01\x00\x00\x00\x00\x00\x84\x04\x00\x00\x00\x00\x00\x00\x05\x00" "\x00\x00\x00\x00\x00\x00\x95\x00\x00\x00\x00\x00\x00\x00\xdb\x13\xd5\xd8" "\xb7\x41\xf2\xcd\xaa\xbc\x83\x83\xca\xf5\x6b\x8c\x2b\x84\xa8\xd0\x95\x35" "\xa1\x57\xf9\x00\x5b\xd3\x8a\xdd\xaa\x65\xb9\x25\xcd\x3d\xed\x25\xb8\xb9" "\xe2\xa0\x95\xd2\xc5\x1e\xf4\x5c\x55\x88\xec\x78\xc7\xf3\x29\x46\xb1\x7c" "\xec\xfe\x54\xc5\x3a\xb5\x30\xc5\x8b\x67\x85\x1b\x7e\x0e\x82\x45\x2a\x08" "\x3b\x98\xa6\xaa\x76\x64\x01\x04\x7d\x15\x02\x03\xb0\x41\x7e\xde\xf3\x32" "\x23\x3b\x08\x1d\xf1\x89\x61\xd6\x82\x2d\x13\x3b\xf7\x2a\x4d\xe1\xcc\x08" "\x00\x00\x45\x37\xfc\x21\x15\x76\x84\x6a\xc6\x29\xd1\xd9\x32\x65\xba\x47" "\x45\x80\x04\x7a\x9d\xc8\x8d\xe3\x58\xce\x79\x57\x31\x89\x1a\x20\x31\xde" "\x4e\x09\x74\x0c\xc8\x55\x25\xd2\x99\x1e\xd4\x78\x5a\x97\x73\xa4\x33\xe0" "\xdb\x9c\x1a\x7d\x4a\xb9\xd6\x58\xce\x9c\xfd\xb4\xdb\x3b\xed\x62\xbc\xb2" "\xbc\x91\xdd\xcd\xfa\xc2\xe6\xd4\x42\x1c\x49\xfb\x66\x41\xcb\xf5\x69\x14" "\xe7\x67\x02\xf6\x73\xb5\x86\xc7\x67\x03\x00\x90\xa3\x96\x70\x93\xb0\x00" "\xe3\x80\x6f\x82\x5f\x1d\x0d\xa2\xa3\x04\xe0\x65\x43\xb5\x6d\x35\x23\x5d" "\x78\xb7\xa7\xfe\x91\x29\x71\xaa\xb8\x76\x02\x2e\x96\xf5\x14\x3b\x62\x34" "\xf5\xa6\xb7\x01\x69\x0b\x07\xfb\x66\x4a\x44\xe2\x2b\x72\xe8\x43\xe7\xcf" "\x55\xf3\x94\xcf\x75\xd1\xcd\x3e\xe7\x9a\x25\xfb\x98\xcc\x45\xb3\xfd\xe4" "\x3e\x42\xe1\x50\xd4\xa2\xfd\xdd\x9a\x97\x67\x74", 480); *(uint64_t*)0x2000000054d0 = 0x200000000100; memcpy((void*)0x200000000100, "GPL\000", 4); *(uint32_t*)0x2000000054d8 = 0; *(uint32_t*)0x2000000054dc = 0; *(uint64_t*)0x2000000054e0 = 0; *(uint32_t*)0x2000000054e8 = 0; *(uint32_t*)0x2000000054ec = 0; memset((void*)0x2000000054f0, 0, 16); *(uint32_t*)0x200000005500 = 0; *(uint32_t*)0x200000005504 = 0; *(uint32_t*)0x200000005508 = -1; *(uint32_t*)0x20000000550c = 8; *(uint64_t*)0x200000005510 = 0; *(uint32_t*)0x200000005518 = 0x1c; *(uint32_t*)0x20000000551c = 0x10; *(uint64_t*)0x200000005520 = 0; *(uint32_t*)0x200000005528 = 0; *(uint32_t*)0x20000000552c = 0; *(uint32_t*)0x200000005530 = -1; *(uint32_t*)0x200000005534 = 0; *(uint64_t*)0x200000005538 = 0; *(uint64_t*)0x200000005540 = 0; *(uint32_t*)0x200000005548 = 0x10; *(uint32_t*)0x20000000554c = 0; *(uint32_t*)0x200000005550 = 0; syscall(__NR_bpf, /*cmd=*/5ul, /*arg=*/0x2000000054c0ul, /*size=*/0x48ul); // bpf$BPF_PROG_TEST_RUN arguments: [ // cmd: const = 0xa (8 bytes) // arg: ptr[in, bpf_test_prog_arg] { // bpf_test_prog_arg { // prog: fd_bpf_prog (resource) // retval: const = 0x18000000000002a0 (4 bytes) // insizedata: len = 0xe (4 bytes) // outsizedata: len = 0x0 (4 bytes) // indata: ptr[in, buffer] { // buffer: {b9 ff 03 07 68 04 26 8c 98 9e 14 f0 88 a8} (length 0xe) // } // outdata: nil // repeat: int32 = 0x4068 (4 bytes) // dur: const = 0x60000000 (4 bytes) // insizectx: len = 0x0 (4 bytes) // outsizectx: len = 0x0 (4 bytes) // inctx: nil // outctx: nil // flags: bpf_prog_test_run_flags = 0x0 (4 bytes) // cpu: const = 0x0 (4 bytes) // batch_size: int32 = 0x0 (4 bytes) // pad = 0x0 (4 bytes) // } // } // size: len = 0x4c (8 bytes) // ] *(uint32_t*)0x2000000011c0 = r[0]; *(uint32_t*)0x2000000011c4 = 0x2a0; *(uint32_t*)0x2000000011c8 = 0xe; *(uint32_t*)0x2000000011cc = 0; *(uint64_t*)0x2000000011d0 = 0x200000001240; memcpy((void*)0x200000001240, "\xb9\xff\x03\x07\x68\x04\x26\x8c\x98\x9e\x14\xf0\x88\xa8", 14); *(uint64_t*)0x2000000011d8 = 0; *(uint32_t*)0x2000000011e0 = 0x4068; *(uint32_t*)0x2000000011e4 = 0x60000000; *(uint32_t*)0x2000000011e8 = 0; *(uint32_t*)0x2000000011ec = 0; *(uint64_t*)0x2000000011f0 = 0; *(uint64_t*)0x2000000011f8 = 0; *(uint32_t*)0x200000001200 = 0; *(uint32_t*)0x200000001204 = 0; *(uint32_t*)0x200000001208 = 0; syscall(__NR_bpf, /*cmd=*/0xaul, /*arg=*/0x2000000011c0ul, /*size=*/0x4cul); return 0; }