blob: 52a439b930574a79197c0ad69db53c718250f966 [file] [log] [blame]
// general protection fault in tcp_v6_send_reset
// https://syzkaller.appspot.com/bug?id=6316be09b65b1cc8cc29bb03e10de12ab8cd64ca
// 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);
intptr_t res = 0;
res = syscall(__NR_socket, 0xa, 1, 0);
if (res != -1)
r[0] = res;
*(uint16_t*)0x20000200 = 1;
*(uint64_t*)0x20000208 = 0x20000280;
*(uint16_t*)0x20000280 = 6;
*(uint8_t*)0x20000282 = 0;
*(uint8_t*)0x20000283 = 0;
*(uint32_t*)0x20000284 = 6;
syscall(__NR_setsockopt, r[0], 1, 0x1a, 0x20000200, 0x10);
*(uint16_t*)0x20000080 = 0xa;
*(uint16_t*)0x20000082 = htobe16(0x4e22);
*(uint32_t*)0x20000084 = htobe32(0);
*(uint8_t*)0x20000088 = 0;
*(uint8_t*)0x20000089 = 0;
*(uint8_t*)0x2000008a = 0;
*(uint8_t*)0x2000008b = 0;
*(uint8_t*)0x2000008c = 0;
*(uint8_t*)0x2000008d = 0;
*(uint8_t*)0x2000008e = 0;
*(uint8_t*)0x2000008f = 0;
*(uint8_t*)0x20000090 = 0;
*(uint8_t*)0x20000091 = 0;
*(uint8_t*)0x20000092 = 0;
*(uint8_t*)0x20000093 = 0;
*(uint8_t*)0x20000094 = 0;
*(uint8_t*)0x20000095 = 0;
*(uint8_t*)0x20000096 = 0;
*(uint8_t*)0x20000097 = 0;
*(uint32_t*)0x20000098 = 0;
syscall(__NR_bind, r[0], 0x20000080, 0x1c);
*(uint16_t*)0x20000380 = 0xa;
*(uint16_t*)0x20000382 = htobe16(0x4e22);
*(uint32_t*)0x20000384 = htobe32(0);
*(uint64_t*)0x20000388 = htobe64(0);
*(uint64_t*)0x20000390 = htobe64(1);
*(uint32_t*)0x20000398 = 0;
syscall(__NR_sendto, r[0], 0, 0, 0x20000000, 0x20000380, 0x1c);
memcpy((void*)0x200002c0, "\n", 1);
syscall(__NR_sendto, r[0], 0x200002c0, 1, 4, 0, 0);
return 0;
}