github.com/google/syzkaller@v0.0.0-20240517125934-c0f1611a36d6/sys/linux/vmw_vmci.txt (about)

     1  # Copyright 2020 syzkaller project authors. All rights reserved.
     2  # Use of this source code is governed by Apache 2 LICENSE that can be found in the LICENSE file.
     3  
     4  include <uapi/linux/fcntl.h>
     5  include <linux/ioctl.h>
     6  include <linux/vmw_vmci_defs.h>
     7  include <drivers/misc/vmw_vmci/vmci_context.h>
     8  
     9  resource fd_vmci[fd]
    10  
    11  openat$vmci(fd const[AT_FDCWD], file ptr[in, string["/dev/vmci"]], flags const[O_RDWR], mode const[0]) fd_vmci
    12  
    13  ioctl$IOCTL_VMCI_INIT_CONTEXT(fd fd_vmci, cmd const[IOCTL_VMCI_INIT_CONTEXT], arg ptr[in, vmci_init_blk])
    14  ioctl$IOCTL_VMCI_DATAGRAM_SEND(fd fd_vmci, cmd const[IOCTL_VMCI_DATAGRAM_SEND], arg ptr[in, vmci_datagram_snd_rcv_info])
    15  ioctl$IOCTL_VMCI_DATAGRAM_RECEIVE(fd fd_vmci, cmd const[IOCTL_VMCI_DATAGRAM_RECEIVE], arg ptr[in, vmci_datagram_snd_rcv_info])
    16  ioctl$IOCTL_VMCI_QUEUEPAIR_ALLOC(fd fd_vmci, cmd const[IOCTL_VMCI_QUEUEPAIR_ALLOC], arg ptr[in, vmci_qp_alloc_info])
    17  ioctl$IOCTL_VMCI_QUEUEPAIR_SETVA(fd fd_vmci, cmd const[IOCTL_VMCI_QUEUEPAIR_SETVA], arg ptr[in, vmci_qp_set_va_info])
    18  ioctl$IOCTL_VMCI_QUEUEPAIR_SETPF(fd fd_vmci, cmd const[IOCTL_VMCI_QUEUEPAIR_SETPAGEFILE], arg ptr[in, vmci_qp_page_file_info])
    19  ioctl$IOCTL_VMCI_QUEUEPAIR_DETACH(fd fd_vmci, cmd const[IOCTL_VMCI_QUEUEPAIR_DETACH], arg ptr[in, vmci_qp_dtch_info])
    20  ioctl$IOCTL_VMCI_CTX_ADD_NOTIFICATION(fd fd_vmci, cmd const[IOCTL_VMCI_CTX_ADD_NOTIFICATION], arg ptr[in, vmci_ctx_info])
    21  ioctl$IOCTL_VMCI_CTX_REMOVE_NOTIFICATION(fd fd_vmci, cmd const[IOCTL_VMCI_CTX_REMOVE_NOTIFICATION], arg ptr[in, vmci_ctx_info])
    22  ioctl$IOCTL_VMCI_CTX_GET_CPT_STATE(fd fd_vmci, cmd const[IOCTL_VMCI_CTX_GET_CPT_STATE], arg ptr[in, vmci_ctx_chkpt_buf_info])
    23  ioctl$IOCTL_VMCI_CTX_SET_CPT_STATE(fd fd_vmci, cmd const[IOCTL_VMCI_CTX_SET_CPT_STATE], arg ptr[in, vmci_ctx_chkpt_buf_info])
    24  ioctl$IOCTL_VMCI_GET_CONTEXT_ID(fd fd_vmci, cmd const[IOCTL_VMCI_GET_CONTEXT_ID], arg ptr[out, int32])
    25  ioctl$IOCTL_VMCI_SET_NOTIFY(fd fd_vmci, cmd const[IOCTL_VMCI_SET_NOTIFY], arg ptr[in, vmci_set_notify_info])
    26  ioctl$IOCTL_VMCI_NOTIFY_RESOURCE(fd fd_vmci, cmd const[IOCTL_VMCI_NOTIFY_RESOURCE], arg ptr[in, vmci_dbell_notify_resource_info])
    27  ioctl$IOCTL_VMCI_NOTIFICATIONS_RECEIVE(fd fd_vmci, cmd const[IOCTL_VMCI_NOTIFICATIONS_RECEIVE], arg ptr[in, vmci_ctx_notify_recv_info])
    28  ioctl$IOCTL_VMCI_VERSION(fd fd_vmci, cmd const[IOCTL_VMCI_VERSION], arg ptr[in, flags[vmci_version, int32]])
    29  ioctl$IOCTL_VMCI_VERSION2(fd fd_vmci, cmd const[IOCTL_VMCI_VERSION2], arg ptr[in, flags[vmci_version, int32]])
    30  
    31  vmci_init_blk {
    32  	cid	vmaddr_cid
    33  	flags	flags[vmci_privilege, int32]
    34  }
    35  
    36  vmci_handle {
    37  	context	vmaddr_cid
    38  	rsc	int32
    39  }
    40  
    41  vmci_datagram {
    42  	dst		vmci_handle
    43  	src		vmci_handle
    44  	payload_size	len[payload, int64]
    45  	payload		array[int8, 1024]
    46  }
    47  
    48  vmci_datagram_snd_rcv_info {
    49  	addr	ptr64[in, vmci_datagram]
    50  	len	len[addr, int32]
    51  	result	int32
    52  }
    53  
    54  vmci_qp_alloc_info {
    55  	handle		vmci_handle
    56  	peer		vmaddr_cid
    57  	flags		flags[vmci_qp, int32]
    58  	produce_size	int64
    59  	consume_size	int64
    60  	ppn_va		int64
    61  	num_ppns	int64
    62  	result		int32
    63  	version		int32
    64  }
    65  
    66  vmci_qp_set_va_info {
    67  	handle		vmci_handle
    68  	va		int64
    69  	num_ppns	int64
    70  	version		int32
    71  	result		int32
    72  }
    73  
    74  vmci_qp_page_file_info {
    75  	handle			vmci_handle
    76  	produce_page_file	int64
    77  	consume_page_file	int64
    78  	produce_page_file_size	int64
    79  	consume_page_file_size	int64
    80  	result			int32
    81  	version			int32
    82  	produce_va		int64
    83  	consume_va		int64
    84  }
    85  
    86  vmci_qp_dtch_info {
    87  	handle	vmci_handle
    88  	result	int32
    89  	_pad	int32
    90  }
    91  
    92  vmci_ctx_info {
    93  	remote_cid	vmaddr_cid
    94  	result		int32
    95  }
    96  
    97  vmci_ctx_chkpt_buf_info {
    98  	cpt_buf		ptr64[in, array[int32, 1024]]
    99  	cpt_type	flags[vmci_cpt_state, int32]
   100  	buf_size	len[cpt_buf, int32]
   101  	result		int32
   102  	_pad		const[0, int32]
   103  }
   104  
   105  vmci_set_notify_info {
   106  	notify_uva	int64
   107  	result		int32
   108  	_pad		int32
   109  }
   110  
   111  vmci_dbell_notify_resource_info {
   112  	handle	vmci_handle
   113  	rsc	flags[vmci_notify_resource, int16]
   114  	action	flags[vmci_notify_action, int16]
   115  	result	int32
   116  }
   117  
   118  vmci_ctx_notify_recv_info {
   119  	db_handle_buf_uva	int64
   120  	db_handle_buf_size	int64
   121  	qp_handle_buf_uva	int64
   122  	qp_handle_buf_size	int64
   123  	result			int32
   124  	_pad			int32
   125  }
   126  
   127  vmci_privilege = VMCI_NO_PRIVILEGE_FLAGS, VMCI_PRIVILEGE_FLAG_RESTRICTED, VMCI_PRIVILEGE_FLAG_TRUSTED
   128  vmci_qp = VMCI_QPFLAG_ATTACH_ONLY, VMCI_QPFLAG_LOCAL, VMCI_QPFLAG_NONBLOCK, VMCI_QPFLAG_PINNED
   129  vmci_version = VMCI_VERSION_NOVMVM, VMCI_VERSION_NOTIFY, VMCI_VERSION_HOSTQP, VMCI_VERSION_PREHOSTQP, VMCI_VERSION_PREVERS2
   130  vmci_cpt_state = VMCI_NOTIFICATION_CPT_STATE, VMCI_WELLKNOWN_CPT_STATE, VMCI_DG_OUT_STATE, VMCI_DG_IN_STATE, VMCI_DG_IN_SIZE_STATE, VMCI_DOORBELL_CPT_STATE
   131  vmci_notify_resource = VMCI_NOTIFY_RESOURCE_QUEUE_PAIR, VMCI_NOTIFY_RESOURCE_DOOR_BELL
   132  vmci_notify_action = VMCI_NOTIFY_RESOURCE_ACTION_NOTIFY, VMCI_NOTIFY_RESOURCE_ACTION_CREATE, VMCI_NOTIFY_RESOURCE_ACTION_DESTROY
   133  
   134  # These are defined in kernel source files.
   135  define VMCI_NOTIFICATION_CPT_STATE	1
   136  define VMCI_WELLKNOWN_CPT_STATE	2
   137  define VMCI_DG_OUT_STATE	3
   138  define VMCI_DG_IN_STATE	4
   139  define VMCI_DG_IN_SIZE_STATE	5
   140  define VMCI_DOORBELL_CPT_STATE	6
   141  define VMCI_NOTIFY_RESOURCE_ACTION_NOTIFY	0
   142  define VMCI_NOTIFY_RESOURCE_ACTION_CREATE	1
   143  define VMCI_NOTIFY_RESOURCE_ACTION_DESTROY	2
   144  define VMCI_NOTIFY_RESOURCE_QUEUE_PAIR	0
   145  define VMCI_NOTIFY_RESOURCE_DOOR_BELL	1