syzkaller/sys/freebsd/ipc.txt
2020-03-27 05:51:58 +01:00

142 lines
5.2 KiB
Plaintext

# Copyright 2017 syzkaller project authors. All rights reserved.
# Use of this source code is governed by Apache 2 LICENSE that can be found in the LICENSE file.
include <sys/types.h>
include <sys/fcntl.h>
include <sys/ipc.h>
include <sys/mman.h>
include <sys/msg.h>
include <sys/sem.h>
include <sys/shm.h>
include <sys/stat.h>
resource ipc[int32]: 0, 0xffffffffffffffff
# TODO: describe ipc syscall
define SYS___semctl 510
resource ipc_msq[ipc]
msgget(key proc[2039379027, 4], flags flags[msgget_flags]) ipc_msq
msgget$private(key const[IPC_PRIVATE], flags flags[msgget_flags]) ipc_msq
msgsnd(msqid ipc_msq, msgp ptr[in, msgbuf], sz len[msgp], flags flags[msgsnd_flags])
msgrcv(msqid ipc_msq, msgp ptr[out, msgbuf], sz len[msgp], typ flags[msgbuf_type], flags flags[msgrcv_flags])
msgctl$IPC_STAT(msqid ipc_msq, cmd const[IPC_STAT], buf buffer[out])
msgctl$IPC_SET(msqid ipc_msq, cmd const[IPC_SET], buf ptr[in, msqid_ds])
msgctl$IPC_RMID(msqid ipc_msq, cmd const[IPC_RMID])
msgctl$IPC_INFO(msqid ipc_msq, cmd const[IPC_INFO], buf buffer[out])
resource ipc_sem[ipc]
semget(key proc[2039359027, 4], nsems flags[sem_sem_id], flags flags[semget_flags]) ipc_sem
semget$private(key const[IPC_PRIVATE], nsems flags[sem_sem_id], flags flags[semget_flags]) ipc_sem
semop(semid ipc_sem, ops ptr[in, array[sembuf]], nops len[ops])
__semctl$IPC_STAT(semid ipc_sem, semnum const[0], cmd const[IPC_STAT], arg buffer[out])
__semctl$IPC_SET(semid ipc_sem, semnum const[0], cmd const[IPC_SET], arg ptr[in, semid_ds])
__semctl$IPC_RMID(semid ipc_sem, semnum const[0], cmd const[IPC_RMID])
__semctl$IPC_INFO(semid ipc_sem, semnum flags[sem_sem_id], cmd const[IPC_INFO], buf buffer[out])
__semctl$SEM_INFO(semid ipc_sem, semnum flags[sem_sem_id], cmd const[SEM_INFO], arg buffer[out])
__semctl$SEM_STAT(semid ipc_sem, semnum flags[sem_sem_id], cmd const[SEM_STAT], arg buffer[out])
__semctl$GETALL(semid ipc_sem, semnum const[0], cmd const[GETALL], arg buffer[out])
__semctl$GETNCNT(semid ipc_sem, semnum flags[sem_sem_id], cmd const[GETNCNT], arg buffer[out])
__semctl$GETPID(semid ipc_sem, semnum flags[sem_sem_id], cmd const[GETPID], arg buffer[out])
__semctl$GETVAL(semid ipc_sem, semnum flags[sem_sem_id], cmd const[GETVAL], arg buffer[out])
__semctl$GETZCNT(semid ipc_sem, semnum flags[sem_sem_id], cmd const[GETZCNT], arg buffer[out])
__semctl$SETALL(semid ipc_sem, semnum const[0], cmd const[SETALL], arg ptr[in, array[int16]])
__semctl$SETVAL(semid ipc_sem, semnum flags[sem_sem_id], cmd const[SETVAL], arg ptr[in, int32])
resource ipc_shm[ipc]
resource shmaddr[intptr]: 0
# The unused arg is unused by syscall (does not exist at all),
# but it helps to generate sane size values.
shmget(key proc[2039339027, 4], size len[unused], flags flags[shmget_flags], unused vma) ipc_shm
shmget$private(key const[IPC_PRIVATE], size len[unused], flags flags[shmget_flags], unused vma) ipc_shm
shmat(shmid ipc_shm, addr vma, flags flags[shmat_flags]) shmaddr
shmctl$IPC_STAT(shmid ipc_shm, cmd const[IPC_STAT], buf buffer[out])
shmctl$IPC_SET(shmid ipc_shm, cmd const[IPC_SET], buf ptr[in, shmid_ds])
shmctl$IPC_RMID(shmid ipc_shm, cmd const[IPC_RMID])
shmctl$IPC_INFO(shmid ipc_shm, cmd const[IPC_INFO], buf buffer[out])
shmctl$SHM_INFO(shmid ipc_shm, cmd const[SHM_INFO], buf buffer[out])
shmctl$SHM_STAT(shmid ipc_shm, cmd const[SHM_STAT], buf buffer[out])
shmctl$SHM_LOCK(shmid ipc_shm, cmd const[SHM_LOCK])
shmctl$SHM_UNLOCK(shmid ipc_shm, cmd const[SHM_UNLOCK])
shmdt(addr shmaddr)
freebsd12_shm_open(path ptr[in, filename], flags flags[shm_open_flags], mode flags[open_mode])
shm_open2(path ptr[in, filename], flags flags[shm_open_flags], mode flags[open_mode], shmflags flags[shm_open2_flags], name ptr[in, string])
shm_rename(from ptr[in, filename], to ptr[in, filename], flags flags[shm_rename_flags])
shm_unlink(path ptr[in, filename])
msgget_flags = IPC_CREAT, IPC_EXCL, S_IRUSR, S_IWUSR, S_IXUSR, S_IRGRP, S_IWGRP, S_IXGRP, S_IROTH, S_IWOTH, S_IXOTH
msgbuf_type = 0, 1, 2, 3
msgsnd_flags = IPC_NOWAIT
msgrcv_flags = IPC_NOWAIT, MSG_NOERROR
semget_flags = IPC_CREAT, IPC_EXCL, S_IRUSR, S_IWUSR, S_IXUSR, S_IRGRP, S_IWGRP, S_IXGRP, S_IROTH, S_IWOTH, S_IXOTH
semop_flags = IPC_NOWAIT, SEM_UNDO
sem_sem_id = 0, 1, 2, 3, 4
shmget_flags = IPC_CREAT, IPC_EXCL, S_IRUSR, S_IWUSR, S_IXUSR, S_IRGRP, S_IWGRP, S_IXGRP, S_IROTH, S_IWOTH, S_IXOTH
shmat_flags = SHM_RND, SHM_RDONLY
shm_open_flags = O_RDONLY, O_RDWR, O_CREAT, O_EXCL, O_TRUNC
shm_open2_flags = SHM_ALLOW_SEALING
shm_rename_flags = SHM_RENAME_EXCHANGE, SHM_RENAME_NOREPLACE
ipc_perm {
key int32
uid uid
gid gid
cuid uid
cgid gid
mode flags[open_mode, int32]
seq int16
pad0 const[0, int16]
pad1 const[0, intptr]
pad2 const[0, intptr]
}
msqid_ds {
perm ipc_perm
stime intptr
rtime intptr
ctime intptr
cbytes intptr
qnum intptr
qbytes intptr
lspid pid
lrpid pid
pad0 const[0, intptr]
pad1 const[0, intptr]
}
shmid_ds {
perm ipc_perm
segsz int32
atime intptr
dtime intptr
ctime intptr
cpid pid
lpid pid
nattch int16
unused0 const[0, int16]
unused1 const[0, intptr]
unused2 const[0, intptr]
}
semid_ds {
perm ipc_perm
otime intptr
ctime intptr
nsems intptr
pad0 const[0, intptr]
pad1 const[0, intptr]
}
sembuf {
num flags[sem_sem_id, int16]
op int16
flg flags[semop_flags, int16]
}
msgbuf {
typ flags[msgbuf_type, intptr]
data array[int8]
} [packed]