blob: 553f6899bbb7cc7680d2d9df3e8a9173b64c845d [file] [log] [blame]
// WARNING in tcp_mark_head_lost
// https://syzkaller.appspot.com/bug?id=0a4389a1b9d1c1cefdc99ad2b0206da11cb9ae72
// status:fixed
// autogenerated by syzkaller (http://github.com/google/syzkaller)
#define _GNU_SOURCE
#include <endian.h>
#include <stdint.h>
#include <string.h>
#include <sys/syscall.h>
#include <unistd.h>
#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[1] = {0xffffffffffffffff};
void loop()
{
long res = 0;
res = syscall(__NR_socket, 2, 1, 0);
if (res != -1)
r[0] = res;
*(uint32_t*)0x2039c000 = 1;
syscall(__NR_setsockopt, r[0], 6, 0x10000000013, 0x2039c000, 4);
*(uint32_t*)0x200b2000 = -1;
syscall(__NR_setsockopt, r[0], 6, 0x14, 0x200b2000, 4);
*(uint16_t*)0x20b55000 = 2;
*(uint16_t*)0x20b55002 = htobe16(0x4e22);
*(uint32_t*)0x20b55004 = htobe32(0);
*(uint8_t*)0x20b55008 = 0;
*(uint8_t*)0x20b55009 = 0;
*(uint8_t*)0x20b5500a = 0;
*(uint8_t*)0x20b5500b = 0;
*(uint8_t*)0x20b5500c = 0;
*(uint8_t*)0x20b5500d = 0;
*(uint8_t*)0x20b5500e = 0;
*(uint8_t*)0x20b5500f = 0;
syscall(__NR_bind, r[0], 0x20b55000, 0x10);
*(uint16_t*)0x20303000 = 2;
*(uint16_t*)0x20303002 = htobe16(0x4e22);
*(uint32_t*)0x20303004 = htobe32(0x7f000001);
*(uint8_t*)0x20303008 = 0;
*(uint8_t*)0x20303009 = 0;
*(uint8_t*)0x2030300a = 0;
*(uint8_t*)0x2030300b = 0;
*(uint8_t*)0x2030300c = 0;
*(uint8_t*)0x2030300d = 0;
*(uint8_t*)0x2030300e = 0;
*(uint8_t*)0x2030300f = 0;
syscall(__NR_sendto, r[0], 0x205c9000, 0x252, 0x800000020000000, 0x20303000,
0x10);
*(uint32_t*)0x20965fec = 0x40000004;
*(uint32_t*)0x20965ff0 = 0x852b;
*(uint32_t*)0x20965ff4 = 0xffff;
*(uint32_t*)0x20965ff8 = 0x7fffffff;
*(uint32_t*)0x20965ffc = 0;
syscall(__NR_setsockopt, r[0], 6, 0x1d, 0x20965fec, 0x14);
*(uint64_t*)0x20000440 = 0x20000480;
memcpy((void*)0x20000480, "\xb8", 1);
*(uint64_t*)0x20000448 = 1;
syscall(__NR_writev, r[0], 0x20000440, 1);
*(uint32_t*)0x20000000 = 4;
*(uint32_t*)0x20000004 = 0;
*(uint32_t*)0x20000008 = 3;
*(uint32_t*)0x2000000c = 5;
*(uint32_t*)0x20000010 = 2;
*(uint32_t*)0x20000014 = 0x3f;
*(uint32_t*)0x20000018 = 3;
*(uint32_t*)0x2000001c = 0x292;
*(uint32_t*)0x20000020 = 3;
*(uint32_t*)0x20000024 = 0xffff746d;
*(uint32_t*)0x20000028 = 8;
*(uint32_t*)0x2000002c = 0xb220;
*(uint32_t*)0x20000030 = 0;
*(uint32_t*)0x20000034 = 4;
*(uint32_t*)0x20000038 = 0xb;
*(uint32_t*)0x2000003c = 0x6f;
*(uint32_t*)0x20000040 = 3;
*(uint32_t*)0x20000044 = 9;
syscall(__NR_setsockopt, r[0], 6, 0x16, 0x20000000, 9);
syscall(__NR_shutdown, r[0], 1);
memcpy((void*)0x20000100, "\xb3\x3b\xcc\x8f\x29\x32", 6);
*(uint8_t*)0x20000106 = 0xaa;
*(uint8_t*)0x20000107 = 0xaa;
*(uint8_t*)0x20000108 = 0xaa;
*(uint8_t*)0x20000109 = 0xaa;
*(uint8_t*)0x2000010a = 0xaa;
*(uint8_t*)0x2000010b = 0xbb;
*(uint16_t*)0x2000010c = htobe16(0x8100);
STORE_BY_BITMASK(uint16_t, 0x2000010e, 3, 0, 3);
STORE_BY_BITMASK(uint16_t, 0x2000010e, 0xb45, 3, 1);
STORE_BY_BITMASK(uint16_t, 0x2000010e, 2, 4, 12);
*(uint16_t*)0x20000110 = htobe16(0x11);
*(uint8_t*)0x20000112 = 0xe;
*(uint8_t*)0x20000113 = 0xdc;
memcpy((void*)0x20000114, "8", 1);
}
int main()
{
syscall(__NR_mmap, 0x20000000, 0x1000000, 3, 0x32, -1, 0);
loop();
return 0;
}