| // KASAN: invalid-free in sctp_stream_free |
| // https://syzkaller.appspot.com/bug?id=9f5c59939d107d15af692ca1751fdf52cd669e88 |
| // status:fixed |
| // autogenerated by syzkaller (https://github.com/google/syzkaller) |
| |
| #define _GNU_SOURCE |
| |
| #include <endian.h> |
| #include <stdint.h> |
| #include <stdio.h> |
| #include <stdlib.h> |
| #include <string.h> |
| #include <sys/syscall.h> |
| #include <sys/types.h> |
| #include <unistd.h> |
| |
| uint64_t r[1] = {0xffffffffffffffff}; |
| |
| int main(void) |
| { |
| syscall(__NR_mmap, 0x20000000, 0x1000000, 3, 0x32, -1, 0); |
| long res = 0; |
| res = syscall(__NR_socket, 2, 0x80001, 0x84); |
| if (res != -1) |
| r[0] = res; |
| *(uint16_t*)0x20000000 = 2; |
| *(uint16_t*)0x20000002 = htobe16(0x4e20); |
| *(uint32_t*)0x20000004 = htobe32(0x7f000001); |
| syscall(__NR_bind, r[0], 0x20000000, 0x10); |
| *(uint16_t*)0x20000040 = 0; |
| *(uint16_t*)0x20000042 = 1; |
| *(uint16_t*)0x20000044 = 0; |
| *(uint16_t*)0x20000046 = 0; |
| syscall(__NR_setsockopt, r[0], 0x84, 2, 0x20000040, 8); |
| *(uint16_t*)0x20000180 = 8; |
| *(uint16_t*)0x20000182 = 4; |
| *(uint32_t*)0x20000184 = 0x8001; |
| *(uint32_t*)0x20000188 = 0xff; |
| *(uint32_t*)0x2000018c = 0; |
| syscall(__NR_setsockopt, r[0], 0x84, 0x22, 0x20000180, 0x10); |
| *(uint64_t*)0x2001afc8 = 0x20006000; |
| *(uint16_t*)0x20006000 = 2; |
| *(uint16_t*)0x20006002 = htobe16(0x4e20); |
| *(uint32_t*)0x20006004 = htobe32(0x7f000001); |
| *(uint32_t*)0x2001afd0 = 0x80; |
| *(uint64_t*)0x2001afd8 = 0x20007f80; |
| *(uint64_t*)0x20007f80 = 0x2000a000; |
| memcpy((void*)0x2000a000, "\f", 1); |
| *(uint64_t*)0x20007f88 = 1; |
| *(uint64_t*)0x2001afe0 = 1; |
| *(uint64_t*)0x2001afe8 = 0; |
| *(uint64_t*)0x2001aff0 = 0; |
| *(uint32_t*)0x2001aff8 = 0; |
| syscall(__NR_sendmsg, r[0], 0x2001afc8, 0); |
| return 0; |
| } |