| // KASAN: slab-out-of-bounds Read in sctp_send_reset_streams |
| // https://syzkaller.appspot.com/bug?id=f39a4688594152c928093aa43e008bee70b55ca4 |
| // status:fixed |
| // autogenerated by syzkaller (http://github.com/google/syzkaller) |
| |
| #define _GNU_SOURCE |
| |
| #include <pthread.h> |
| #include <stdlib.h> |
| #include <sys/syscall.h> |
| #include <unistd.h> |
| |
| #include <stdint.h> |
| #include <string.h> |
| |
| static void test(); |
| |
| void loop() |
| { |
| while (1) { |
| test(); |
| } |
| } |
| |
| long r[45]; |
| void* thr(void* arg) |
| { |
| switch ((long)arg) { |
| case 0: |
| r[0] = syscall(__NR_mmap, 0x20000000ul, 0xfff000ul, 0x3ul, 0x32ul, |
| 0xfffffffffffffffful, 0x0ul); |
| break; |
| case 1: |
| r[1] = syscall(__NR_socket, 0xaul, 0x1ul, 0x8010000000000084ul); |
| break; |
| case 2: |
| *(uint16_t*)0x20186fe4 = (uint16_t)0xa; |
| *(uint16_t*)0x20186fe6 = (uint16_t)0x204e; |
| *(uint32_t*)0x20186fe8 = (uint32_t)0x0; |
| *(uint8_t*)0x20186fec = (uint8_t)0x0; |
| *(uint8_t*)0x20186fed = (uint8_t)0x0; |
| *(uint8_t*)0x20186fee = (uint8_t)0x0; |
| *(uint8_t*)0x20186fef = (uint8_t)0x0; |
| *(uint8_t*)0x20186ff0 = (uint8_t)0x0; |
| *(uint8_t*)0x20186ff1 = (uint8_t)0x0; |
| *(uint8_t*)0x20186ff2 = (uint8_t)0x0; |
| *(uint8_t*)0x20186ff3 = (uint8_t)0x0; |
| *(uint8_t*)0x20186ff4 = (uint8_t)0x0; |
| *(uint8_t*)0x20186ff5 = (uint8_t)0x0; |
| *(uint8_t*)0x20186ff6 = (uint8_t)0x0; |
| *(uint8_t*)0x20186ff7 = (uint8_t)0x0; |
| *(uint8_t*)0x20186ff8 = (uint8_t)0x0; |
| *(uint8_t*)0x20186ff9 = (uint8_t)0x0; |
| *(uint8_t*)0x20186ffa = (uint8_t)0x0; |
| *(uint8_t*)0x20186ffb = (uint8_t)0x0; |
| *(uint32_t*)0x20186ffc = (uint32_t)0x0; |
| r[22] = syscall(__NR_bind, r[1], 0x20186fe4ul, 0x1cul); |
| break; |
| case 3: |
| r[23] = syscall(__NR_fcntl, r[1], 0x0ul, r[1]); |
| break; |
| case 4: |
| *(uint32_t*)0x20474000 = (uint32_t)0x0; |
| *(uint32_t*)0x20474004 = (uint32_t)0x7; |
| r[26] = syscall(__NR_setsockopt, r[23], 0x84ul, 0x75ul, |
| 0x20474000ul, 0x8ul); |
| break; |
| case 5: |
| memcpy((void*)0x20ff8fff, "\xe1", 1); |
| *(uint16_t*)0x2069ffe4 = (uint16_t)0xa; |
| *(uint16_t*)0x2069ffe6 = (uint16_t)0x204e; |
| *(uint32_t*)0x2069ffe8 = (uint32_t)0x0; |
| *(uint64_t*)0x2069ffec = (uint64_t)0x0; |
| *(uint64_t*)0x2069fff4 = (uint64_t)0x100000000000000; |
| *(uint32_t*)0x2069fffc = (uint32_t)0x0; |
| r[34] = syscall(__NR_sendto, r[23], 0x20ff8ffful, 0x1ul, 0x0ul, |
| 0x2069ffe4ul, 0x1cul); |
| break; |
| case 6: |
| *(uint32_t*)0x20dafff8 = (uint32_t)0x0; |
| *(uint32_t*)0x20dafffc = (uint32_t)0x5; |
| r[37] = syscall(__NR_setsockopt, r[23], 0x84ul, 0x76ul, |
| 0x20dafff8ul, 0x8ul); |
| break; |
| case 7: |
| *(uint32_t*)0x20b24000 = (uint32_t)0x0; |
| *(uint32_t*)0x20b24004 = (uint32_t)0x40080000001; |
| r[40] = syscall(__NR_setsockopt, r[23], 0x84ul, 0x77ul, |
| 0x20b24000ul, 0x8ul); |
| break; |
| case 8: |
| r[41] = syscall(__NR_ioctl, 0xfffffffffffffffful, 0x4b6bul, |
| 0x20000f8cul); |
| break; |
| case 9: |
| r[42] = syscall(__NR_socket, 0x10ul, 0x3ul, 0x0ul); |
| break; |
| case 10: |
| memcpy((void*)0x20493000, "\x26\x00\x00\x00\x13\x00\x47\xf1\x07\x01" |
| "\xc1\xb0\x0e\x00\x00\x00\x00\x00\x00\x00" |
| "\x01\x00\x00\x00\x09\xef\x18\xff\xff\x00" |
| "\xf1\x32\x05\x00\x14\x00\x6e\x35", |
| 38); |
| r[44] = syscall(__NR_write, r[42], 0x20493000ul, 0x26ul); |
| break; |
| } |
| return 0; |
| } |
| |
| void test() |
| { |
| long i; |
| pthread_t th[22]; |
| |
| memset(r, -1, sizeof(r)); |
| for (i = 0; i < 11; i++) { |
| pthread_create(&th[i], 0, thr, (void*)i); |
| usleep(rand() % 10000); |
| } |
| usleep(rand() % 100000); |
| } |
| |
| int main() |
| { |
| loop(); |
| return 0; |
| } |