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>
#ifndef __NR_bpf
#define __NR_bpf 321
#endif
uint64_t r[2] = {0xffffffffffffffff, 0xffffffffffffffff};
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)) {}
// prctl$PR_SCHED_CORE arguments: [
// option: const = 0x3e (8 bytes)
// cmd: intptr = 0x1 (8 bytes)
// pid: pid (resource)
// type: pid_type = 0x2 (8 bytes)
// uaddr: nil
// ]
syscall(__NR_prctl, /*option=*/0x3eul, /*cmd=*/1ul, /*pid=*/0, /*type=PIDTYPE_PGID*/2ul, /*uaddr=*/0ul);
// prlimit64 arguments: [
// pid: pid (resource)
// res: rlimit_type = 0xe (8 bytes)
// new: ptr[in, rlimit] {
// rlimit {
// soft: intptr = 0x8 (8 bytes)
// hard: intptr = 0x8b (8 bytes)
// }
// }
// old: nil
// ]
*(uint64_t*)0x200000000140 = 8;
*(uint64_t*)0x200000000148 = 0x8b;
syscall(__NR_prlimit64, /*pid=*/0, /*res=RLIMIT_RTPRIO*/0xeul, /*new=*/0x200000000140ul, /*old=*/0ul);
// sched_setscheduler arguments: [
// pid: pid (resource)
// policy: sched_policy = 0x2 (8 bytes)
// prio: ptr[in, int32] {
// int32 = 0x4 (4 bytes)
// }
// ]
*(uint32_t*)0x200000000200 = 4;
syscall(__NR_sched_setscheduler, /*pid=*/0, /*policy=SCHED_RR*/2ul, /*prio=*/0x200000000200ul);
// bpf$BPF_PROG_RAW_TRACEPOINT_LOAD arguments: [
// cmd: const = 0x5 (8 bytes)
// arg: ptr[in, bpf_prog_t[flags[bpf_raw_tracepoint_prog_types, int32], const[0, int32], const[0, int32], const[0, int32]]] {
// bpf_prog_t[flags[bpf_raw_tracepoint_prog_types, int32], const[0, int32], const[0, int32], const[0, int32]] {
// type: bpf_raw_tracepoint_prog_types = 0x3 (4 bytes)
// ninsn: bytesize8 = 0xc (4 bytes)
// insns: ptr[inout, array[ANYUNION]] {
// array[ANYUNION] {
// union ANYUNION {
// ANYBLOB: buffer: {18 02 00 00 01 00 00 00 00 00 00 00 00 00 00 00 85 00 00 00 53 00 00 00 18 01 00 00 20 20 75 25 00 00 00 00 00 00 20 20 7b 1a f8 ff 00 00 00 00 bf a1 00 00 00 00 00 00 07 01 00 00 f8 ff ff ff b7 02 00 00 08 00 00 00 b7 03 00 00 fc ff ff ff 85 00 00 00 73 00 00 00 95} (length 0x59)
// }
// }
// }
// license: ptr[in, buffer] {
// buffer: {47 50 4c 00} (length 0x4)
// }
// loglev: int32 = 0x0 (4 bytes)
// logsize: len = 0x0 (4 bytes)
// log: nil
// kern_version: bpf_kern_version = 0x41100 (4 bytes)
// flags: bpf_prog_load_flags = 0x0 (4 bytes)
// prog_name: buffer: {00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00} (length 0x10)
// prog_ifindex: ifindex (resource)
// expected_attach_type: const = 0x0 (4 bytes)
// btf_fd: fd_btf (resource)
// func_info_rec_size: const = 0x8 (4 bytes)
// func_info: nil
// func_info_cnt: len = 0x0 (4 bytes)
// line_info_rec_size: const = 0x10 (4 bytes)
// line_info: nil
// line_info_cnt: len = 0x0 (4 bytes)
// attach_btf_id: const = 0x0 (4 bytes)
// attach_prog_fd: const = 0x0 (4 bytes)
// core_relo_cnt: len = 0x0 (4 bytes)
// fd_array: nil
// core_relos: nil
// core_relo_rec_size: const = 0x10 (4 bytes)
// log_true_size: int32 = 0x0 (4 bytes)
// prog_token_fd: union _bpf_prog_t[flags[bpf_raw_tracepoint_prog_types, int32], const[0, int32], const[0, int32], const[0, int32]]_prog_token_fd_wrapper {
// void: buffer: {} (length 0x0)
// }
// pad: union _bpf_prog_t[flags[bpf_raw_tracepoint_prog_types, int32], const[0, int32], const[0, int32], const[0, int32]]_pad_wrapper {
// value: const = 0x0 (4 bytes)
// }
// }
// }
// size: len = 0x94 (8 bytes)
// ]
// returns fd_bpf_prog_raw_tracepoint
*(uint32_t*)0x200000000200 = 3;
*(uint32_t*)0x200000000204 = 0xc;
*(uint64_t*)0x200000000208 = 0x200000000800;
memcpy((void*)0x200000000800, "... [truncated large byte array] ...", 89);
*(uint64_t*)0x200000000210 = 0x200000000080;
memcpy((void*)0x200000000080, "GPL\000", 4);
*(uint32_t*)0x200000000218 = 0;
*(uint32_t*)0x20000000021c = 0;
*(uint64_t*)0x200000000220 = 0;
*(uint32_t*)0x200000000228 = 0x41100;
*(uint32_t*)0x20000000022c = 0;
memset((void*)0x200000000230, 0, 16);
*(uint32_t*)0x200000000240 = 0;
*(uint32_t*)0x200000000244 = 0;
*(uint32_t*)0x200000000248 = -1;
*(uint32_t*)0x20000000024c = 8;
*(uint64_t*)0x200000000250 = 0;
*(uint32_t*)0x200000000258 = 0;
*(uint32_t*)0x20000000025c = 0x10;
*(uint64_t*)0x200000000260 = 0;
*(uint32_t*)0x200000000268 = 0;
*(uint32_t*)0x20000000026c = 0;
*(uint32_t*)0x200000000270 = 0;
*(uint32_t*)0x200000000274 = 0;
*(uint64_t*)0x200000000278 = 0;
*(uint64_t*)0x200000000280 = 0;
*(uint32_t*)0x200000000288 = 0x10;
*(uint32_t*)0x20000000028c = 0;
*(uint32_t*)0x200000000290 = 0;
res = syscall(__NR_bpf, /*cmd=*/5ul, /*arg=*/0x200000000200ul, /*size=*/0x94ul);
if (res != -1)
r[0] = res;
// bpf$PROG_LOAD arguments: [
// cmd: const = 0x5 (8 bytes)
// arg: ptr[in, bpf_prog_t[flags[bpf_prog_type, int32], bpf_prog_attach_types, bpf_btf_id[opt], fd_bpf_prog[opt]]] {
// bpf_prog_t[flags[bpf_prog_type, int32], bpf_prog_attach_types, bpf_btf_id[opt], fd_bpf_prog[opt]] {
// type: bpf_prog_type = 0x11 (4 bytes)
// ninsn: bytesize8 = 0xb (4 bytes)
// insns: nil
// license: ptr[in, buffer] {
// buffer: {47 50 4c 00} (length 0x4)
// }
// loglev: int32 = 0x0 (4 bytes)
// logsize: len = 0x0 (4 bytes)
// log: nil
// kern_version: bpf_kern_version = 0x0 (4 bytes)
// flags: bpf_prog_load_flags = 0x0 (4 bytes)
// prog_name: buffer: {00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00} (length 0x10)
// prog_ifindex: ifindex (resource)
// expected_attach_type: union bpf_prog_attach_types {
// fallback: bpf_attach_types = 0x0 (4 bytes)
// }
// btf_fd: fd_btf (resource)
// func_info_rec_size: const = 0x0 (4 bytes)
// func_info: nil
// func_info_cnt: len = 0x0 (4 bytes)
// line_info_rec_size: const = 0x0 (4 bytes)
// line_info: nil
// line_info_cnt: len = 0x0 (4 bytes)
// attach_btf_id: bpf_btf_id (resource)
// attach_prog_fd: fd_bpf_prog (resource)
// core_relo_cnt: len = 0x0 (4 bytes)
// fd_array: nil
// core_relos: nil
// core_relo_rec_size: const = 0x0 (4 bytes)
// log_true_size: int32 = 0x0 (4 bytes)
// prog_token_fd: union _bpf_prog_t[flags[bpf_prog_type, int32], bpf_prog_attach_types, bpf_btf_id[opt], fd_bpf_prog[opt]]_prog_token_fd_wrapper {
// void: buffer: {} (length 0x0)
// }
// pad: union _bpf_prog_t[flags[bpf_prog_type, int32], bpf_prog_attach_types, bpf_btf_id[opt], fd_bpf_prog[opt]]_pad_wrapper {
// value: const = 0x0 (4 bytes)
// }
// }
// }
// size: len = 0x94 (8 bytes)
// ]
// returns fd_bpf_prog
*(uint32_t*)0x2000000006c0 = 0x11;
*(uint32_t*)0x2000000006c4 = 0xb;
*(uint64_t*)0x2000000006c8 = 0;
*(uint64_t*)0x2000000006d0 = 0x200000000200;
memcpy((void*)0x200000000200, "GPL\000", 4);
*(uint32_t*)0x2000000006d8 = 0;
*(uint32_t*)0x2000000006dc = 0;
*(uint64_t*)0x2000000006e0 = 0;
*(uint32_t*)0x2000000006e8 = 0;
*(uint32_t*)0x2000000006ec = 0;
memset((void*)0x2000000006f0, 0, 16);
*(uint32_t*)0x200000000700 = 0;
*(uint32_t*)0x200000000704 = 0;
*(uint32_t*)0x200000000708 = -1;
*(uint32_t*)0x20000000070c = 0;
*(uint64_t*)0x200000000710 = 0;
*(uint32_t*)0x200000000718 = 0;
*(uint32_t*)0x20000000071c = 0;
*(uint64_t*)0x200000000720 = 0;
*(uint32_t*)0x200000000728 = 0;
*(uint32_t*)0x20000000072c = 0;
*(uint32_t*)0x200000000730 = 0;
*(uint32_t*)0x200000000734 = 0;
*(uint64_t*)0x200000000738 = 0;
*(uint64_t*)0x200000000740 = 0;
*(uint32_t*)0x200000000748 = 0;
*(uint32_t*)0x20000000074c = 0;
*(uint32_t*)0x200000000750 = 0;
res = syscall(__NR_bpf, /*cmd=*/5ul, /*arg=*/0x2000000006c0ul, /*size=*/0x94ul);
if (res != -1)
r[1] = res;
// bpf$BPF_RAW_TRACEPOINT_OPEN arguments: [
// cmd: const = 0x11 (8 bytes)
// arg: ptr[in, bpf_raw_tracepoint] {
// bpf_raw_tracepoint {
// name: ptr[in, buffer] {
// buffer: {73 63 68 65 64 5f 73 77 69 74 63 68 00} (length 0xd)
// }
// prog_fd: fd_bpf_prog_raw_tracepoint (resource)
// pad: const = 0x0 (4 bytes)
// cookie: int64 = 0x0 (8 bytes)
// }
// }
// size: len = 0x10 (8 bytes)
// ]
// returns fd_perf_base
*(uint64_t*)0x2000000002c0 = 0x200000000080;
memcpy((void*)0x200000000080, "sched_switch\000", 13);
*(uint32_t*)0x2000000002c8 = r[1];
*(uint32_t*)0x2000000002cc = 0;
*(uint64_t*)0x2000000002d0 = 0;
syscall(__NR_bpf, /*cmd=*/0x11ul, /*arg=*/0x2000000002c0ul, /*size=*/0x10ul);
// bpf$BPF_PROG_TEST_RUN arguments: [
// cmd: const = 0xa (8 bytes)
// arg: ptr[in, bpf_test_prog_arg] {
// bpf_test_prog_arg {
// prog: fd_bpf_prog (resource)
// retval: const = 0x0 (4 bytes)
// insizedata: len = 0xe (4 bytes)
// outsizedata: len = 0x0 (4 bytes)
// indata: ptr[in, buffer] {
// buffer: {e0 7b 29 2f e0 79 98 9c b9 54 7e d3 87 db} (length 0xe)
// }
// outdata: nil
// repeat: int32 = 0x80000000 (4 bytes)
// dur: const = 0x0 (4 bytes)
// insizectx: len = 0x0 (4 bytes)
// outsizectx: len = 0x0 (4 bytes)
// inctx: nil
// outctx: nil
// flags: bpf_prog_test_run_flags = 0x0 (4 bytes)
// cpu: const = 0x0 (4 bytes)
// batch_size: int32 = 0x0 (4 bytes)
// pad = 0x0 (4 bytes)
// }
// }
// size: len = 0x50 (8 bytes)
// ]
*(uint32_t*)0x2000000002c0 = r[0];
*(uint32_t*)0x2000000002c4 = 0;
*(uint32_t*)0x2000000002c8 = 0xe;
*(uint32_t*)0x2000000002cc = 0;
*(uint64_t*)0x2000000002d0 = 0x200000000040;
memcpy((void*)0x200000000040, "\xe0\x7b\x29\x2f\xe0\x79\x98\x9c\xb9\x54\x7e\xd3\x87\xdb", 14);
*(uint64_t*)0x2000000002d8 = 0;
*(uint32_t*)0x2000000002e0 = 0x80000000;
*(uint32_t*)0x2000000002e4 = 0;
*(uint32_t*)0x2000000002e8 = 0;
*(uint32_t*)0x2000000002ec = 0;
*(uint64_t*)0x2000000002f0 = 0;
*(uint64_t*)0x2000000002f8 = 0;
*(uint32_t*)0x200000000300 = 0;
*(uint32_t*)0x200000000304 = 0;
*(uint32_t*)0x200000000308 = 0;
syscall(__NR_bpf, /*cmd=*/0xaul, /*arg=*/0x2000000002c0ul, /*size=*/0x50ul);
// read$msr arguments: [
// fd: fd_msr (resource)
// buf: ptr[out, buffer] {
// buffer: (DirOut)
// }
// count: len = 0x18ff8 (8 bytes)
// ]
syscall(__NR_read, /*fd=*/(intptr_t)-1, /*buf=*/0x200000019680ul, /*count=*/0x18ff8ul);
// recvmmsg arguments: [
// fd: sock (resource)
// mmsg: ptr[in, array[recv_mmsghdr]] {
// array[recv_mmsghdr] {
// recv_mmsghdr {
// msg_hdr: recv_msghdr {
// msg_name: nil
// msg_namelen: len = 0x0 (4 bytes)
// pad = 0x0 (4 bytes)
// msg_iov: nil
// msg_iovlen: len = 0x0 (8 bytes)
// msg_control: nil
// msg_controllen: bytesize = 0x0 (8 bytes)
// msg_flags: const = 0x0 (4 bytes)
// pad = 0x0 (4 bytes)
// }
// msg_len: int32 = 0x6e1 (4 bytes)
// pad = 0x0 (4 bytes)
// }
// }
// }
// vlen: len = 0x1 (8 bytes)
// f: recv_flags = 0x20 (8 bytes)
// timeout: nil
// ]
*(uint64_t*)0x2000000000c0 = 0;
*(uint32_t*)0x2000000000c8 = 0;
*(uint64_t*)0x2000000000d0 = 0;
*(uint64_t*)0x2000000000d8 = 0;
*(uint64_t*)0x2000000000e0 = 0;
*(uint64_t*)0x2000000000e8 = 0;
*(uint32_t*)0x2000000000f0 = 0;
*(uint32_t*)0x2000000000f8 = 0x6e1;
syscall(__NR_recvmmsg, /*fd=*/(intptr_t)-1, /*mmsg=*/0x2000000000c0ul, /*vlen=*/1ul, /*f=MSG_TRUNC*/0x20ul, /*timeout=*/0ul);
return 0;
}
]