map[SimplifiedCRepro:// 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/mount.h>
#include <sys/syscall.h>
#include <sys/types.h>
#include <unistd.h>
#define BITMASK(bf_off,bf_len) (((1ull << (bf_len)) - 1) << (bf_off))
#define STORE_BY_BITMASK(type,htobe,addr,val,bf_off,bf_len) *(type*)(addr) = htobe((htobe(*(type*)(addr)) & ~BITMASK((bf_off), (bf_len))) | (((type)(val) << (bf_off)) & BITMASK((bf_off), (bf_len))))
uint64_t r[5] = {0xffffffffffffffff, 0xffffffffffffffff, 0x0, 0xffffffffffffffff, 0x0};
int main(void)
{
syscall(__NR_mmap, /*addr=*/0x1ffffffff000ul, /*len=*/0x1000ul, /*prot=*/0ul, /*flags=MAP_FIXED|MAP_ANONYMOUS|MAP_PRIVATE*/0x32ul, /*fd=*/(intptr_t)-1, /*offset=*/0ul);
syscall(__NR_mmap, /*addr=*/0x200000000000ul, /*len=*/0x1000000ul, /*prot=PROT_WRITE|PROT_READ|PROT_EXEC*/7ul, /*flags=MAP_FIXED|MAP_ANONYMOUS|MAP_PRIVATE*/0x32ul, /*fd=*/(intptr_t)-1, /*offset=*/0ul);
syscall(__NR_mmap, /*addr=*/0x200001000000ul, /*len=*/0x1000ul, /*prot=*/0ul, /*flags=MAP_FIXED|MAP_ANONYMOUS|MAP_PRIVATE*/0x32ul, /*fd=*/(intptr_t)-1, /*offset=*/0ul);
const char* reason;
(void)reason;
intptr_t res = 0;
if (write(1, "executing program\n", sizeof("executing program\n") - 1)) {}
// socket$netlink arguments: [
// domain: const = 0x10 (8 bytes)
// type: const = 0x3 (8 bytes)
// proto: netlink_proto = 0x0 (4 bytes)
// ]
// returns sock_netlink
res = syscall(__NR_socket, /*domain=*/0x10ul, /*type=*/3ul, /*proto=*/0);
if (res != -1)
r[0] = res;
// socket arguments: [
// domain: socket_domain = 0x10 (8 bytes)
// type: socket_type = 0x803 (8 bytes)
// proto: int32 = 0x0 (4 bytes)
// ]
// returns sock
res = syscall(__NR_socket, /*domain=AF_NETLINK*/0x10ul, /*type=SOCK_NONBLOCK|SOCK_RAW*/0x803ul, /*proto=*/0);
if (res != -1)
r[1] = res;
// sendmsg$nl_route_sched arguments: [
// fd: sock_nl_route (resource)
// msg: ptr[in, msghdr_netlink[netlink_msg_route_sched]] {
// msghdr_netlink[netlink_msg_route_sched] {
// addr: nil
// addrlen: len = 0x0 (4 bytes)
// pad = 0x0 (4 bytes)
// vec: ptr[in, iovec[in, netlink_msg_route_sched]] {
// iovec[in, netlink_msg_route_sched] {
// addr: nil
// len: len = 0x54 (8 bytes)
// }
// }
// vlen: const = 0x1 (8 bytes)
// ctrl: const = 0x0 (8 bytes)
// ctrllen: const = 0x0 (8 bytes)
// f: send_flags = 0x0 (4 bytes)
// pad = 0x0 (4 bytes)
// }
// }
// f: send_flags = 0x0 (8 bytes)
// ]
*(uint64_t*)0x200000000740 = 0;
*(uint32_t*)0x200000000748 = 0;
*(uint64_t*)0x200000000750 = 0x200000000700;
*(uint64_t*)0x200000000700 = 0;
*(uint64_t*)0x200000000708 = 0x54;
*(uint64_t*)0x200000000758 = 1;
*(uint64_t*)0x200000000760 = 0;
*(uint64_t*)0x200000000768 = 0;
*(uint32_t*)0x200000000770 = 0;
syscall(__NR_sendmsg, /*fd=*/r[1], /*msg=*/0x200000000740ul, /*f=*/0ul);
// getsockname$packet arguments: [
// fd: sock_packet (resource)
// addr: ptr[out, sockaddr_ll] {
// sockaddr_ll {
// sll_family: const = 0x11 (2 bytes)
// sll_protocol: packet_protocols = 0x0 (2 bytes)
// sll_ifindex: ifindex (resource)
// sll_hatype: const = 0x1 (2 bytes)
// sll_pkttype: int8 = 0x0 (1 bytes)
// sll_halen: const = 0x6 (1 bytes)
// sll_addr: union mac_addr {
// broadcast: buffer: (DirOut)
// }
// pad: buffer: (DirOut)
// }
// }
// addrlen: ptr[inout, len] {
// len = 0x14 (4 bytes)
// }
// ]
*(uint32_t*)0x200000000200 = 0x14;
res = syscall(__NR_getsockname, /*fd=*/r[1], /*addr=*/0x200000000100ul, /*addrlen=*/0x200000000200ul);
if (res != -1)
r[2] = *(uint32_t*)0x200000000104;
// sendmsg$nl_route arguments: [
// fd: sock_nl_route (resource)
// msg: ptr[in, msghdr_netlink[netlink_msg_route]] {
// msghdr_netlink[netlink_msg_route] {
// addr: nil
// addrlen: len = 0x0 (4 bytes)
// pad = 0x0 (4 bytes)
// vec: ptr[in, iovec[in, netlink_msg_route]] {
// iovec[in, netlink_msg_route] {
// addr: ptr[inout, array[ANYUNION]] {
// array[ANYUNION] {
// union ANYUNION {
// ANYBLOB: buffer: {3c 00 00 00 10 00 85 06 00 00 00 ff 01 00 00 00 00 00 00 00} (length 0x14)
// }
// union ANYUNION {
// ANYRES32: ANYRES32 (resource)
// }
// union ANYUNION {
// ANYBLOB: buffer: {01 00 00 00 00 00 00 00 1c 00 12 00 0c 00 01 00 62 6f 6e 64 00 00 00 00 0c 00 02 00 08 00 01 00 06} (length 0x21)
// }
// }
// }
// len: len = 0x3c (8 bytes)
// }
// }
// vlen: const = 0x1 (8 bytes)
// ctrl: const = 0x0 (8 bytes)
// ctrllen: const = 0x0 (8 bytes)
// f: send_flags = 0x0 (4 bytes)
// pad = 0x0 (4 bytes)
// }
// }
// f: send_flags = 0x0 (8 bytes)
// ]
*(uint64_t*)0x200000000040 = 0;
*(uint32_t*)0x200000000048 = 0;
*(uint64_t*)0x200000000050 = 0x200000000000;
*(uint64_t*)0x200000000000 = 0x200000000500;
memcpy((void*)0x200000000500, "\x3c\x00\x00\x00\x10\x00\x85\x06\x00\x00\x00\xff\x01\x00\x00\x00\x00\x00\x00\x00", 20);
*(uint32_t*)0x200000000514 = r[2];
memcpy((void*)0x200000000518, "... [truncated large byte array] ...", 33);
*(uint64_t*)0x200000000008 = 0x3c;
*(uint64_t*)0x200000000058 = 1;
*(uint64_t*)0x200000000060 = 0;
*(uint64_t*)0x200000000068 = 0;
*(uint32_t*)0x200000000070 = 0;
syscall(__NR_sendmsg, /*fd=*/r[0], /*msg=*/0x200000000040ul, /*f=*/0ul);
// socket$nl_route arguments: [
// domain: const = 0x10 (8 bytes)
// type: const = 0x3 (8 bytes)
// proto: const = 0x0 (4 bytes)
// ]
// returns sock_nl_route
res = syscall(__NR_socket, /*domain=*/0x10ul, /*type=*/3ul, /*proto=*/0);
if (res != -1)
r[3] = res;
// getsockname$packet arguments: [
// fd: sock_packet (resource)
// addr: ptr[out, sockaddr_ll] {
// sockaddr_ll {
// sll_family: const = 0x11 (2 bytes)
// sll_protocol: packet_protocols = 0x0 (2 bytes)
// sll_ifindex: ifindex (resource)
// sll_hatype: const = 0x1 (2 bytes)
// sll_pkttype: int8 = 0x0 (1 bytes)
// sll_halen: const = 0x6 (1 bytes)
// sll_addr: union mac_addr {
// broadcast: buffer: (DirOut)
// }
// pad: buffer: (DirOut)
// }
// }
// addrlen: ptr[inout, len] {
// len = 0x14 (4 bytes)
// }
// ]
*(uint32_t*)0x2000000004c0 = 0x14;
res = syscall(__NR_getsockname, /*fd=*/r[1], /*addr=*/0x200000000440ul, /*addrlen=*/0x2000000004c0ul);
if (res != -1)
r[4] = *(uint32_t*)0x200000000444;
// sendmsg$nl_route arguments: [
// fd: sock_nl_route (resource)
// msg: ptr[in, msghdr_netlink[netlink_msg_route]] {
// msghdr_netlink[netlink_msg_route] {
// addr: nil
// addrlen: len = 0x0 (4 bytes)
// pad = 0x0 (4 bytes)
// vec: ptr[in, iovec[in, netlink_msg_route]] {
// iovec[in, netlink_msg_route] {
// addr: ptr[in, netlink_msg_route] {
// union netlink_msg_route {
// newlink: netlink_msg_t[const[RTM_NEWLINK, int16], ifinfomsg[AF_UNSPEC], ifla_policy] {
// len: len = 0x48 (4 bytes)
// type: const = 0x10 (2 bytes)
// flags: netlink_msg_flags = 0x40f (2 bytes)
// seq: int32 = 0x0 (4 bytes)
// pid: int32 = 0x0 (4 bytes)
// payload: ifinfomsg[AF_UNSPEC] {
// ifi_family: const = 0x0 (1 bytes)
// __ifi_pad: const = 0x0 (1 bytes)
// ifi_type: const = 0x0 (2 bytes)
// ifi_index: ifindex (resource)
// ifi_flags: net_device_flags = 0x0 (4 bytes)
// ifi_change: net_device_flags = 0x0 (4 bytes)
// }
// attrs: array[ifla_policy] {
// union ifla_policy {
// IFLA_LINKINFO: nlattr_tt[const[IFLA_LINKINFO, int16:14], 0, 1, ifla_info_policy] {
// nla_len: offsetof = 0x20 (2 bytes)
// nla_type: const = 0x12 (1 bytes)
// NLA_F_NET_BYTEORDER: const = 0x0 (0 bytes)
// NLA_F_NESTED: const = 0x1 (1 bytes)
// payload: union ifla_info_policy {
// ip6gretap: ifla_info_policy$t["ip6gretap", IFLA_INFO_DATA, array[ip6gre_policy]] {
// IFLA_INFO_KIND: nlattr_t[const[IFLA_INFO_KIND, int16], string["ip6gretap"]] {
// nla_len: offsetof = 0xe (2 bytes)
// nla_type: const = 0x1 (2 bytes)
// payload: buffer: {69 70 36 67 72 65 74 61 70 00} (length 0xa)
// size: buffer: {} (length 0x0)
// pad = 0x0 (2 bytes)
// }
// IFLA_INFO_DATA: nlattr_tt[const[IFLA_INFO_DATA, int16:14], 0, 1, array[ip6gre_policy]] {
// nla_len: offsetof = 0xc (2 bytes)
// nla_type: const = 0x2 (1 bytes)
// NLA_F_NET_BYTEORDER: const = 0x0 (0 bytes)
// NLA_F_NESTED: const = 0x1 (1 bytes)
// payload: array[ip6gre_policy] {
// union ip6gre_policy {
// IFLA_GRE_LINK: nlattr_t[const[IFLA_GRE_LINK, int16], ifindex] {
// nla_len: offsetof = 0x8 (2 bytes)
// nla_type: const = 0x1 (2 bytes)
// payload: ifindex (resource)
// size: buffer: {} (length 0x0)
// }
// }
// }
// size: buffer: {} (length 0x0)
// }
// }
// }
// size: buffer: {} (length 0x0)
// }
// }
// union ifla_policy {
// IFLA_MASTER: nlattr_t[const[IFLA_MASTER, int16], ifindex] {
// nla_len: offsetof = 0x8 (2 bytes)
// nla_type: const = 0xa (2 bytes)
// payload: ifindex (resource)
// size: buffer: {} (length 0x0)
// }
// }
// }
// }
// }
// }
// len: len = 0x48 (8 bytes)
// }
// }
// vlen: const = 0x1 (8 bytes)
// ctrl: const = 0x0 (8 bytes)
// ctrllen: const = 0x0 (8 bytes)
// f: send_flags = 0x0 (4 bytes)
// pad = 0x0 (4 bytes)
// }
// }
// f: send_flags = 0x0 (8 bytes)
// ]
*(uint64_t*)0x200000000080 = 0;
*(uint32_t*)0x200000000088 = 0;
*(uint64_t*)0x200000000090 = 0x200000000140;
*(uint64_t*)0x200000000140 = 0x200000000540;
*(uint32_t*)0x200000000540 = 0x48;
*(uint16_t*)0x200000000544 = 0x10;
*(uint16_t*)0x200000000546 = 0x40f;
*(uint32_t*)0x200000000548 = 0;
*(uint32_t*)0x20000000054c = 0;
*(uint8_t*)0x200000000550 = 0;
*(uint8_t*)0x200000000551 = 0;
*(uint16_t*)0x200000000552 = 0;
*(uint32_t*)0x200000000554 = 0;
*(uint32_t*)0x200000000558 = 0;
*(uint32_t*)0x20000000055c = 0;
*(uint16_t*)0x200000000560 = 0x20;
STORE_BY_BITMASK(uint16_t, , 0x200000000562, 0x12, 0, 14);
STORE_BY_BITMASK(uint16_t, , 0x200000000563, 0, 6, 1);
STORE_BY_BITMASK(uint16_t, , 0x200000000563, 1, 7, 1);
*(uint16_t*)0x200000000564 = 0xe;
*(uint16_t*)0x200000000566 = 1;
memcpy((void*)0x200000000568, "ip6gretap\000", 10);
*(uint16_t*)0x200000000574 = 0xc;
STORE_BY_BITMASK(uint16_t, , 0x200000000576, 2, 0, 14);
STORE_BY_BITMASK(uint16_t, , 0x200000000577, 0, 6, 1);
STORE_BY_BITMASK(uint16_t, , 0x200000000577, 1, 7, 1);
*(uint16_t*)0x200000000578 = 8;
*(uint16_t*)0x20000000057a = 1;
*(uint32_t*)0x20000000057c = r[2];
*(uint16_t*)0x200000000580 = 8;
*(uint16_t*)0x200000000582 = 0xa;
*(uint32_t*)0x200000000584 = r[4];
*(uint64_t*)0x200000000148 = 0x48;
*(uint64_t*)0x200000000098 = 1;
*(uint64_t*)0x2000000000a0 = 0;
*(uint64_t*)0x2000000000a8 = 0;
*(uint32_t*)0x2000000000b0 = 0;
syscall(__NR_sendmsg, /*fd=*/r[3], /*msg=*/0x200000000080ul, /*f=*/0ul);
return 0;
}
]