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
#ifndef __NR_move_mount
#define __NR_move_mount 429
#endif
#ifndef __NR_open_tree
#define __NR_open_tree 428
#endif
uint64_t r[3] = {0xffffffffffffffff, 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)) {}
// mount$bind arguments: [
// src: nil
// dst: nil
// type: nil
// flags: mount_flags = 0x101091 (8 bytes)
// data: const = 0x0 (8 bytes)
// ]
syscall(__NR_mount, /*src=*/0ul, /*dst=*/0ul, /*type=*/0ul, /*flags=MS_SHARED|MS_SYNCHRONOUS|MS_RDONLY|MS_DIRSYNC|MS_BIND*/0x101091ul, /*data=*/0ul);
// mount$bind arguments: [
// src: nil
// dst: nil
// type: nil
// flags: mount_flags = 0x100000 (8 bytes)
// data: const = 0x0 (8 bytes)
// ]
syscall(__NR_mount, /*src=*/0ul, /*dst=*/0ul, /*type=*/0ul, /*flags=MS_SHARED*/0x100000ul, /*data=*/0ul);
// mount$bind arguments: [
// src: nil
// dst: nil
// type: nil
// flags: mount_flags = 0x2101c84 (8 bytes)
// data: const = 0x0 (8 bytes)
// ]
syscall(__NR_mount, /*src=*/0ul, /*dst=*/0ul, /*type=*/0ul, /*flags=MS_LAZYTIME|MS_SHARED|MS_NODIRATIME|MS_NODEV|MS_NOATIME|0x1080*/0x2101c84ul, /*data=*/0ul);
// socket$packet arguments: [
// domain: const = 0x11 (8 bytes)
// type: packet_socket_type = 0x3 (8 bytes)
// proto: const = 0x300 (4 bytes)
// ]
// returns sock_packet
syscall(__NR_socket, /*domain=*/0x11ul, /*type=SOCK_RAW*/3ul, /*proto=*/0x300);
// 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[0] = res;
// sendmsg$nl_route arguments: [
// fd: sock_nl_route (resource)
// msg: nil
// f: send_flags = 0x0 (8 bytes)
// ]
syscall(__NR_sendmsg, /*fd=*/r[0], /*msg=*/0ul, /*f=*/0ul);
// open_tree arguments: [
// dfd: fd_dir (resource)
// filename: ptr[in, buffer] {
// buffer: {00} (length 0x1)
// }
// flags: open_tree_flags = 0x89901 (8 bytes)
// ]
// returns fd
memset((void*)0x200000000640, 0, 1);
res = syscall(__NR_open_tree, /*dfd=*/0xffffff9c, /*filename=*/0x200000000640ul, /*flags=OPEN_TREE_CLOEXEC|OPEN_TREE_CLONE|AT_SYMLINK_NOFOLLOW|AT_RECURSIVE|AT_NO_AUTOMOUNT|AT_EMPTY_PATH*/0x89901ul);
if (res != -1)
r[1] = res;
// mount$tmpfs arguments: [
// src: const = 0x0 (8 bytes)
// dst: nil
// type: nil
// flags: mount_flags = 0x20000 (8 bytes)
// opts: nil
// ]
syscall(__NR_mount, /*src=*/0ul, /*dst=*/0ul, /*type=*/0ul, /*flags=MS_UNBINDABLE*/0x20000ul, /*opts=*/0ul);
// move_mount arguments: [
// from_dfd: fd_dir (resource)
// from_pathname: nil
// to_dfd: fd_dir (resource)
// to_pathname: nil
// flags: move_mount_flags = 0x167 (8 bytes)
// ]
syscall(__NR_move_mount, /*from_dfd=*/r[1], /*from_pathname=*/0ul, /*to_dfd=*/0xffffff9c, /*to_pathname=*/0ul, /*flags=MOVE_MOUNT_SET_GROUP|MOVE_MOUNT_T_EMPTY_PATH|MOVE_MOUNT_T_AUTOMOUNTS|MOVE_MOUNT_F_EMPTY_PATH|MOVE_MOUNT_F_AUTOMOUNTS|MOVE_MOUNT_F_SYMLINKS*/0x167ul);
// 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 = 0x11 (4 bytes)
// ninsn: bytesize8 = 0x5 (4 bytes)
// insns: ptr[inout, array[ANYUNION]] {
// array[ANYUNION] {
// union ANYUNION {
// ANYBLOB: buffer: {18 01 00 00 21 00 00 00 00 00 00 00 4c c3 11 ec 85 00 00 00 75 00 00 00 a7 00 00 00 08 00 00 00 95} (length 0x21)
// }
// }
// }
// 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: const = 0x2 (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*)0x200000000180 = 0x11;
*(uint32_t*)0x200000000184 = 5;
*(uint64_t*)0x200000000188 = 0x200000000280;
memcpy((void*)0x200000000280, "\x18\x01\x00\x00\x21\x00\x00\x00\x00\x00\x00\x00\x4c\xc3\x11\xec\x85\x00\x00\x00\x75\x00\x00\x00\xa7\x00\x00\x00\x08\x00\x00\x00\x95", 33);
*(uint64_t*)0x200000000190 = 0x200000000100;
memcpy((void*)0x200000000100, "GPL\000", 4);
*(uint32_t*)0x200000000198 = 0;
*(uint32_t*)0x20000000019c = 0;
*(uint64_t*)0x2000000001a0 = 0;
*(uint32_t*)0x2000000001a8 = 0;
*(uint32_t*)0x2000000001ac = 0;
memset((void*)0x2000000001b0, 0, 16);
*(uint32_t*)0x2000000001c0 = 0;
*(uint32_t*)0x2000000001c4 = 2;
*(uint32_t*)0x2000000001c8 = -1;
*(uint32_t*)0x2000000001cc = 8;
*(uint64_t*)0x2000000001d0 = 0;
*(uint32_t*)0x2000000001d8 = 0;
*(uint32_t*)0x2000000001dc = 0x10;
*(uint64_t*)0x2000000001e0 = 0;
*(uint32_t*)0x2000000001e8 = 0;
*(uint32_t*)0x2000000001ec = 0;
*(uint32_t*)0x2000000001f0 = 0;
*(uint32_t*)0x2000000001f4 = 0;
*(uint64_t*)0x2000000001f8 = 0;
*(uint64_t*)0x200000000200 = 0;
*(uint32_t*)0x200000000208 = 0x10;
*(uint32_t*)0x20000000020c = 0;
*(uint32_t*)0x200000000210 = 0;
res = syscall(__NR_bpf, /*cmd=*/5ul, /*arg=*/0x200000000180ul, /*size=*/0x94ul);
if (res != -1)
r[2] = 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: {6b 66 72 65 65 00} (length 0x6)
// }
// 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*)0x200000000540 = 0x200000000000;
memcpy((void*)0x200000000000, "kfree\000", 6);
*(uint32_t*)0x200000000548 = r[2];
*(uint32_t*)0x20000000054c = 0;
*(uint64_t*)0x200000000550 = 0;
syscall(__NR_bpf, /*cmd=*/0x11ul, /*arg=*/0x200000000540ul, /*size=*/0x10ul);
return 0;
}
]