// https://syzkaller.appspot.com/bug?id=8c73f3470322d6ae758d6feced0518977a3a20d1 // autogenerated by syzkaller (https://github.com/google/syzkaller) #define _GNU_SOURCE #include #include #include #include #include #include #include #include #include uint64_t r[1] = {0xffffffffffffffff}; 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; intptr_t res = 0; if (write(1, "executing program\n", sizeof("executing program\n") - 1)) { } // mkdirat arguments: [ // fd: fd_dir (resource) // path: ptr[in, buffer] { // buffer: {2e 2f 73 79 73 00} (length 0x6) // } // mode: open_mode = 0x1ed (8 bytes) // ] memcpy((void*)0x200000000000, "./sys\000", 6); syscall( __NR_mkdirat, /*fd=*/0xffffff9c, /*path=*/0x200000000000ul, /*mode=S_IXOTH|S_IROTH|S_IXGRP|S_IRGRP|S_IXUSR|S_IWUSR|S_IRUSR*/ 0x1edul); // mount arguments: [ // src: nil // dst: ptr[in, buffer] { // buffer: {2e 2f 73 79 73 00} (length 0x6) // } // type: ptr[in, buffer] { // buffer: {73 79 73 66 73 00} (length 0x6) // } // flags: mount_flags = 0x0 (8 bytes) // data: nil // ] memcpy((void*)0x200000000000, "./sys\000", 6); memcpy((void*)0x200000000040, "sysfs\000", 6); syscall(__NR_mount, /*src=*/0ul, /*dst=*/0x200000000000ul, /*type=*/0x200000000040ul, /*flags=*/0ul, /*data=*/0ul); // openat arguments: [ // fd: fd_dir (resource) // file: ptr[in, buffer] { // buffer: {2e 2f 73 79 73 2f 62 75 73 2f 70 6c 61 74 66 6f 72 6d 2f 64 // 72 69 76 65 72 73 2f 75 73 62 2d 63 6f 6e 6e 2d 67 70 69 6f 2f 75 65 // 76 65 6e 74 00} (length 0x30) // } // flags: open_flags = 0x1 (4 bytes) // mode: open_mode = 0x0 (2 bytes) // ] // returns fd memcpy((void*)0x200000000200, "./sys/bus/platform/drivers/usb-conn-gpio/uevent\000", 48); res = syscall(__NR_openat, /*fd=*/0xffffff9c, /*file=*/0x200000000200ul, /*flags=O_WRONLY*/ 1, /*mode=*/0); if (res != -1) r[0] = res; // write arguments: [ // fd: fd (resource) // buf: ptr[in, buffer] { // buffer: {61 64 64 00 f0 ab 47 95 18 54 3d 9d c9 f5 63 a1 78 cd ed 96 // fb 2a f4 d5 39 35 e8 87 d0 f1 6c 85 7b b4 ac f6 2a 6a d8 1e 0e 06 c6 // 0e f2 9a 3a 96 38 e2 b6 a5 75 05 54 44 e8 b3 52 15 0f 0f 6d 33 00 4e // af 39 5f df 07 b9 41 f7 aa 29 22 5b 9a cf 59 29 48 ae 95 17 8b 58 ef // a0 b7 e5 4c 72 cf a1 21 4c bb e9 b5 c1 5f 8b 28 c9 b5 d9 12 46 b9 08 // 41 03 3c 6c 67 74 b3 6b e4 52 24 53 1d c7 7a 3a 19 af 0a 30 68 d4 c7 // 5f d3 6e 23 5c 6a f6 5a 1b 21 e8 39 03 80 59 97 42 27 56 44 dd 51 bf // 97 8f 6e 34 08 3c 45 b1 c3 67 44 a6 35 91 3e ba 9c b7 da 7d 38 29 25 // ac 97 00 30 f4 2e 4d b9 98 c9 64 a1 3f 89 4b eb f0 bd e5 7d 18 f6 81 // d7 93 98 e2 3b b9 c9 85 04 d6 16 00 b8 60 ec 75 00 20 e9 0a ff 70 63 // a4 5c d1 98 1a 9e 47 e3 df a7 97 14 9f 46 d9 41 76 19 07 e7 ac 15 e3 // 12 cb f5 65 26 41 dd 4b a4 90 cd db 37 42 36 ec 70 5f 9f 12 8f 97 31 // 96 92 79 98 5c cd e9 59 cd 01 ad 99 aa a7 69 d9 a5 bb 80 1b f7 a0 f2 // 98 dd b3 94 b8 52 65 e2 e2 a5 4f dd 9a 17 54 c6 9c a1 d1 a9 b4 e9 1d // fa 4d cc b1 6a 92 3f 46 26 cf 57 4b e0 1c 60 17 03 a8 ff ca a2 4f 64 // 43 85 4c ee 2a e4 64 b8 a4 56 0c b9 31 2a b1 59 f3 fe 78 bb d5 e3 6a // f7 5f d0 dc 89 26 99 c3 a2 f5 42 18 7a d3 85 8e ee 6e 9b 9b eb 62 c1 // 15 2c d9 03 17 3b a5} (length 0x18b) // } // count: len = 0x18b (8 bytes) // ] memcpy( (void*)0x200000000ac0, "\x61\x64\x64\x00\xf0\xab\x47\x95\x18\x54\x3d\x9d\xc9\xf5\x63\xa1\x78\xcd" "\xed\x96\xfb\x2a\xf4\xd5\x39\x35\xe8\x87\xd0\xf1\x6c\x85\x7b\xb4\xac\xf6" "\x2a\x6a\xd8\x1e\x0e\x06\xc6\x0e\xf2\x9a\x3a\x96\x38\xe2\xb6\xa5\x75\x05" "\x54\x44\xe8\xb3\x52\x15\x0f\x0f\x6d\x33\x00\x4e\xaf\x39\x5f\xdf\x07\xb9" "\x41\xf7\xaa\x29\x22\x5b\x9a\xcf\x59\x29\x48\xae\x95\x17\x8b\x58\xef\xa0" "\xb7\xe5\x4c\x72\xcf\xa1\x21\x4c\xbb\xe9\xb5\xc1\x5f\x8b\x28\xc9\xb5\xd9" "\x12\x46\xb9\x08\x41\x03\x3c\x6c\x67\x74\xb3\x6b\xe4\x52\x24\x53\x1d\xc7" "\x7a\x3a\x19\xaf\x0a\x30\x68\xd4\xc7\x5f\xd3\x6e\x23\x5c\x6a\xf6\x5a\x1b" "\x21\xe8\x39\x03\x80\x59\x97\x42\x27\x56\x44\xdd\x51\xbf\x97\x8f\x6e\x34" "\x08\x3c\x45\xb1\xc3\x67\x44\xa6\x35\x91\x3e\xba\x9c\xb7\xda\x7d\x38\x29" "\x25\xac\x97\x00\x30\xf4\x2e\x4d\xb9\x98\xc9\x64\xa1\x3f\x89\x4b\xeb\xf0" "\xbd\xe5\x7d\x18\xf6\x81\xd7\x93\x98\xe2\x3b\xb9\xc9\x85\x04\xd6\x16\x00" "\xb8\x60\xec\x75\x00\x20\xe9\x0a\xff\x70\x63\xa4\x5c\xd1\x98\x1a\x9e\x47" "\xe3\xdf\xa7\x97\x14\x9f\x46\xd9\x41\x76\x19\x07\xe7\xac\x15\xe3\x12\xcb" "\xf5\x65\x26\x41\xdd\x4b\xa4\x90\xcd\xdb\x37\x42\x36\xec\x70\x5f\x9f\x12" "\x8f\x97\x31\x96\x92\x79\x98\x5c\xcd\xe9\x59\xcd\x01\xad\x99\xaa\xa7\x69" "\xd9\xa5\xbb\x80\x1b\xf7\xa0\xf2\x98\xdd\xb3\x94\xb8\x52\x65\xe2\xe2\xa5" "\x4f\xdd\x9a\x17\x54\xc6\x9c\xa1\xd1\xa9\xb4\xe9\x1d\xfa\x4d\xcc\xb1\x6a" "\x92\x3f\x46\x26\xcf\x57\x4b\xe0\x1c\x60\x17\x03\xa8\xff\xca\xa2\x4f\x64" "\x43\x85\x4c\xee\x2a\xe4\x64\xb8\xa4\x56\x0c\xb9\x31\x2a\xb1\x59\xf3\xfe" "\x78\xbb\xd5\xe3\x6a\xf7\x5f\xd0\xdc\x89\x26\x99\xc3\xa2\xf5\x42\x18\x7a" "\xd3\x85\x8e\xee\x6e\x9b\x9b\xeb\x62\xc1\x15\x2c\xd9\x03\x17\x3b\xa5", 395); syscall(__NR_write, /*fd=*/r[0], /*buf=*/0x200000000ac0ul, /*count=*/0x18bul); return 0; }