syzkaller/sys/kcm.txt
Dmitry Vyukov 0d0fbbe73f overhaul syscall description generation process
This splits generation process into two phases:
1. Extract values of constants from linux kernel sources.
2. Generate Go code.

Constant values are checked in.
The advantage is that the second phase is now completely independent
from linux source files, kernel version, presence of headers for
particular drivers, etc. This allows to change what Go code we generate
any time without access to all kernel headers (which in future won't be
limited to only upstream headers).

Constant extraction process does require proper kernel sources,
but this can be done only once by the person who added the driver
and has access to the required sources. Then the constant values
are checked in for others to use.
Consant extraction process is per-file/per-arch. That is,
if I am adding a driver that is not present upstream and that
works only on a single arch, I will check in constants only for
that driver and for that arch.
2016-08-26 07:09:25 +02:00

32 lines
1.1 KiB
Plaintext
Executable File

# Copyright 2016 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 <linux/net.h>
include <linux/kcm.h>
include <linux/sockios.h>
socket$kcm(domain const[AF_KCM], type flags[kcm_socket_type], proto const[KCMPROTO_CONNECTED]) fd[kcm]
setsockopt$KCM_RECV_DISABLE(fd fd[kcm], level const[SOL_KCM], opt const[KCM_RECV_DISABLE], val ptr[in, int32], len len[val])
getsockopt$KCM_RECV_DISABLE(fd fd[kcm], level const[SOL_KCM], opt const[KCM_RECV_DISABLE], val ptr[out, int32], len len[val])
sendmsg$kcm(fd fd[kcm], msg ptr[in, send_msghdr], f flags[send_flags])
recvmsg$kcm(fd fd[kcm], msg ptr[in, recv_msghdr], f flags[recv_flags])
ioctl$SIOCKCMATTACH(fd fd[kcm], cmd const[SIOCKCMATTACH], arg ptr[in, kcm_attach])
ioctl$SIOCKCMUNATTACH(fd fd[kcm], cmd const[SIOCKCMUNATTACH], arg ptr[in, kcm_unattach])
ioctl$SIOCKCMCLONE(fd fd[kcm], cmd const[SIOCKCMCLONE], arg ptr[inout, kcm_clone])
kcm_socket_type = SOCK_DGRAM, SOCK_SEQPACKET
kcm_attach {
fd fd[sock]
bpf_fd int32
}
kcm_unattach {
fd fd[sock]
}
kcm_clone {
fd fd[sock]
}