// https://syzkaller.appspot.com/bug?id=be77af8f4170f3350bed40f1b060851541287f2f // autogenerated by syzkaller (http://github.com/google/syzkaller) #define _GNU_SOURCE #include #include #include #include #include #define BITMASK_LEN(type, bf_len) (type)((1ull << (bf_len)) - 1) #define BITMASK_LEN_OFF(type, bf_off, bf_len) \ (type)(BITMASK_LEN(type, (bf_len)) << (bf_off)) #define STORE_BY_BITMASK(type, addr, val, bf_off, bf_len) \ if ((bf_off) == 0 && (bf_len) == 0) { \ *(type*)(addr) = (type)(val); \ } else { \ type new_val = *(type*)(addr); \ new_val &= ~BITMASK_LEN_OFF(type, (bf_off), (bf_len)); \ new_val |= ((type)(val)&BITMASK_LEN(type, (bf_len))) << (bf_off); \ *(type*)(addr) = new_val; \ } uint64_t r[2] = {0xffffffffffffffff, 0xffffffffffffffff}; void loop() { long res; res = syscall(__NR_socket, 0xa, 2, 0); if (res != -1) r[0] = res; *(uint16_t*)0x20000000 = 0xa; *(uint16_t*)0x20000002 = htobe16(0x4e20); *(uint32_t*)0x20000004 = 0; *(uint8_t*)0x20000008 = 0; *(uint8_t*)0x20000009 = 0; *(uint8_t*)0x2000000a = 0; *(uint8_t*)0x2000000b = 0; *(uint8_t*)0x2000000c = 0; *(uint8_t*)0x2000000d = 0; *(uint8_t*)0x2000000e = 0; *(uint8_t*)0x2000000f = 0; *(uint8_t*)0x20000010 = 0; *(uint8_t*)0x20000011 = 0; *(uint8_t*)0x20000012 = -1; *(uint8_t*)0x20000013 = -1; *(uint32_t*)0x20000014 = htobe32(0x7f000001); *(uint32_t*)0x20000018 = 5; syscall(__NR_connect, r[0], 0x20000000, 0x1c); *(uint16_t*)0x200000c0 = 0xa; *(uint16_t*)0x200000c2 = htobe16(0x4e22); *(uint32_t*)0x200000c4 = 0xdba; *(uint8_t*)0x200000c8 = -1; *(uint8_t*)0x200000c9 = 1; *(uint8_t*)0x200000ca = 0; *(uint8_t*)0x200000cb = 0; *(uint8_t*)0x200000cc = 0; *(uint8_t*)0x200000cd = 0; *(uint8_t*)0x200000ce = 0; *(uint8_t*)0x200000cf = 0; *(uint8_t*)0x200000d0 = 0; *(uint8_t*)0x200000d1 = 0; *(uint8_t*)0x200000d2 = 0; *(uint8_t*)0x200000d3 = 0; *(uint8_t*)0x200000d4 = 0; *(uint8_t*)0x200000d5 = 0; *(uint8_t*)0x200000d6 = 0; *(uint8_t*)0x200000d7 = 1; *(uint32_t*)0x200000d8 = 9; syscall(__NR_connect, r[0], 0x200000c0, 0x1c); res = syscall(__NR_socket, 0x18, 1, 1); if (res != -1) r[1] = res; *(uint16_t*)0x205fafd2 = 0x18; *(uint32_t*)0x205fafd4 = 1; *(uint32_t*)0x205fafd8 = 0; *(uint32_t*)0x205fafdc = r[0]; *(uint16_t*)0x205fafe0 = 2; *(uint16_t*)0x205fafe2 = htobe16(0x4e21); *(uint32_t*)0x205fafe4 = htobe32(0xe0000002); *(uint8_t*)0x205fafe8 = 0; *(uint8_t*)0x205fafe9 = 0; *(uint8_t*)0x205fafea = 0; *(uint8_t*)0x205fafeb = 0; *(uint8_t*)0x205fafec = 0; *(uint8_t*)0x205fafed = 0; *(uint8_t*)0x205fafee = 0; *(uint8_t*)0x205fafef = 0; *(uint32_t*)0x205faff0 = 4; *(uint32_t*)0x205faff4 = 0; *(uint32_t*)0x205faff8 = 2; *(uint32_t*)0x205faffc = 0; syscall(__NR_connect, r[1], 0x205fafd2, 0x2e); *(uint64_t*)0x2037ffc8 = 0x20041000; *(uint16_t*)0x20041000 = 0x10; *(uint16_t*)0x20041002 = 0; *(uint32_t*)0x20041004 = 0; *(uint32_t*)0x20041008 = 2; *(uint32_t*)0x2037ffd0 = 0xc; *(uint64_t*)0x2037ffd8 = 0x20e6c000; *(uint64_t*)0x20e6c000 = 0x20e6cff0; *(uint32_t*)0x20e6cff0 = 0x10; *(uint16_t*)0x20e6cff4 = 0x14; *(uint16_t*)0x20e6cff6 = 0x200; *(uint32_t*)0x20e6cff8 = 0; *(uint32_t*)0x20e6cffc = 3; *(uint64_t*)0x20e6c008 = 0x10; *(uint64_t*)0x2037ffe0 = 1; *(uint64_t*)0x2037ffe8 = 0; *(uint64_t*)0x2037fff0 = 0; *(uint32_t*)0x2037fff8 = 0x8800; syscall(__NR_sendmsg, r[1], 0x2037ffc8, 0x81); *(uint8_t*)0x20000540 = 0xaa; *(uint8_t*)0x20000541 = 0xaa; *(uint8_t*)0x20000542 = 0xaa; *(uint8_t*)0x20000543 = 0xaa; *(uint8_t*)0x20000544 = 0xaa; *(uint8_t*)0x20000545 = 0xaa; *(uint8_t*)0x20000546 = 0; *(uint8_t*)0x20000547 = 0; *(uint8_t*)0x20000548 = 0x14; *(uint8_t*)0x20000549 = 0; *(uint8_t*)0x2000054a = 0; *(uint8_t*)0x2000054b = 0; *(uint16_t*)0x2000054c = htobe16(0x86dd); STORE_BY_BITMASK(uint8_t, 0x2000054e, 0, 0, 4); STORE_BY_BITMASK(uint8_t, 0x2000054e, 6, 4, 4); memcpy((void*)0x2000054f, "\x20\xa1\x7e", 3); *(uint16_t*)0x20000552 = htobe16(0x10); *(uint8_t*)0x20000554 = 0x88; *(uint8_t*)0x20000555 = 0; *(uint8_t*)0x20000556 = 0xfe; *(uint8_t*)0x20000557 = 0x80; *(uint8_t*)0x20000558 = 0; *(uint8_t*)0x20000559 = 0; *(uint8_t*)0x2000055a = 0; *(uint8_t*)0x2000055b = 0; *(uint8_t*)0x2000055c = 0; *(uint8_t*)0x2000055d = 0; *(uint8_t*)0x2000055e = 0; *(uint8_t*)0x2000055f = 0; *(uint8_t*)0x20000560 = 0; *(uint8_t*)0x20000561 = 0; *(uint8_t*)0x20000562 = 0; *(uint8_t*)0x20000563 = 0; *(uint8_t*)0x20000564 = 0; *(uint8_t*)0x20000565 = 0; *(uint8_t*)0x20000566 = 0xfe; *(uint8_t*)0x20000567 = 0x80; *(uint8_t*)0x20000568 = 0; *(uint8_t*)0x20000569 = 0; *(uint8_t*)0x2000056a = 0; *(uint8_t*)0x2000056b = 0; *(uint8_t*)0x2000056c = 0; *(uint8_t*)0x2000056d = 0; *(uint8_t*)0x2000056e = 0; *(uint8_t*)0x2000056f = 0; *(uint8_t*)0x20000570 = 0; *(uint8_t*)0x20000571 = 0; *(uint8_t*)0x20000572 = 0; *(uint8_t*)0x20000573 = 0; *(uint8_t*)0x20000574 = 0; *(uint8_t*)0x20000575 = 0xaa; STORE_BY_BITMASK(uint16_t, 0x20000576, 0, 0, 1); STORE_BY_BITMASK(uint16_t, 0x20000576, 0, 1, 1); STORE_BY_BITMASK(uint16_t, 0x20000576, 1, 2, 1); STORE_BY_BITMASK(uint16_t, 0x20000576, 0, 3, 1); STORE_BY_BITMASK(uint16_t, 0x20000576, 0, 4, 4); STORE_BY_BITMASK(uint16_t, 0x20000576, 0, 8, 1); STORE_BY_BITMASK(uint16_t, 0x20000576, 0, 9, 4); STORE_BY_BITMASK(uint16_t, 0x20000576, 1, 13, 3); *(uint16_t*)0x20000578 = htobe16(0x880b); *(uint16_t*)0x2000057a = htobe16(0xa); *(uint16_t*)0x2000057c = htobe16(3); STORE_BY_BITMASK(uint16_t, 0x2000057e, 0, 0, 1); STORE_BY_BITMASK(uint16_t, 0x2000057e, 0, 1, 1); STORE_BY_BITMASK(uint16_t, 0x2000057e, 0, 2, 1); STORE_BY_BITMASK(uint16_t, 0x2000057e, 0, 3, 1); STORE_BY_BITMASK(uint16_t, 0x2000057e, 0, 4, 9); STORE_BY_BITMASK(uint16_t, 0x2000057e, 0, 13, 3); *(uint16_t*)0x20000580 = htobe16(0x800); STORE_BY_BITMASK(uint16_t, 0x20000582, 0, 0, 1); STORE_BY_BITMASK(uint16_t, 0x20000582, 0, 1, 1); STORE_BY_BITMASK(uint16_t, 0x20000582, 0, 2, 1); STORE_BY_BITMASK(uint16_t, 0x20000582, 0, 3, 1); STORE_BY_BITMASK(uint16_t, 0x20000582, 0, 4, 9); STORE_BY_BITMASK(uint16_t, 0x20000582, 0, 13, 3); *(uint16_t*)0x20000584 = htobe16(0x86dd); *(uint16_t*)0x20000586 = 0; *(uint16_t*)0x20000588 = htobe16(0); *(uint32_t*)0x2000058a = htobe32(0); STORE_BY_BITMASK(uint8_t, 0x2000058e, 0, 0, 4); STORE_BY_BITMASK(uint8_t, 0x2000058e, 0, 4, 4); *(uint8_t*)0x2000058f = 0; STORE_BY_BITMASK(uint8_t, 0x20000590, 0, 0, 2); STORE_BY_BITMASK(uint8_t, 0x20000590, 0, 2, 1); STORE_BY_BITMASK(uint8_t, 0x20000590, 0, 3, 2); STORE_BY_BITMASK(uint8_t, 0x20000590, 0, 5, 3); *(uint8_t*)0x20000591 = 0; *(uint32_t*)0x20000592 = 0; *(uint32_t*)0x20000596 = htobe32(0); *(uint16_t*)0x2000059a = 0; *(uint16_t*)0x2000059c = htobe16(0); *(uint32_t*)0x2000059e = htobe32(0); STORE_BY_BITMASK(uint8_t, 0x200005a2, 0, 0, 4); STORE_BY_BITMASK(uint8_t, 0x200005a2, 0, 4, 4); *(uint8_t*)0x200005a3 = 0; STORE_BY_BITMASK(uint8_t, 0x200005a4, 0, 0, 2); STORE_BY_BITMASK(uint8_t, 0x200005a4, 0, 2, 1); STORE_BY_BITMASK(uint8_t, 0x200005a4, 0, 3, 2); STORE_BY_BITMASK(uint8_t, 0x200005a4, 0, 5, 3); *(uint8_t*)0x200005a5 = 0; *(uint32_t*)0x200005a6 = 0; *(uint32_t*)0x200005aa = htobe32(0); *(uint16_t*)0x200005ae = htobe16(0); STORE_BY_BITMASK(uint8_t, 0x200005b0, 0, 0, 2); STORE_BY_BITMASK(uint8_t, 0x200005b0, 0, 2, 5); STORE_BY_BITMASK(uint8_t, 0x200005b0, 0, 7, 1); STORE_BY_BITMASK(uint8_t, 0x200005b1, 0, 0, 1); STORE_BY_BITMASK(uint8_t, 0x200005b1, 0, 1, 2); STORE_BY_BITMASK(uint8_t, 0x200005b1, 0, 3, 1); STORE_BY_BITMASK(uint8_t, 0x200005b1, 0, 4, 1); *(uint16_t*)0x200005b2 = 0; *(uint16_t*)0x200005b4 = htobe16(0); *(uint32_t*)0x200005b6 = htobe32(0); } int main() { syscall(__NR_mmap, 0x20000000, 0x1000000, 3, 0x32, -1, 0); loop(); return 0; }