sys/freebsd: add bindat(2)

This commit is contained in:
Mark Johnston 2020-03-26 15:21:27 -04:00 committed by Dmitry Vyukov
parent c37c8bf05b
commit 87abd520f8
10 changed files with 40 additions and 4 deletions

4
executor/defs.h generated
View File

@ -20,7 +20,7 @@
#if GOARCH_386
#define GOARCH "386"
#define SYZ_REVISION "325e7f88c9a9be6d5408e8f4b16b46a7dfa46701"
#define SYZ_REVISION "9153d8fbbe6b117424690a313cf2b7a3a1f02c34"
#define SYZ_EXECUTOR_USES_FORK_SERVER 1
#define SYZ_EXECUTOR_USES_SHMEM 1
#define SYZ_PAGE_SIZE 4096
@ -30,7 +30,7 @@
#if GOARCH_amd64
#define GOARCH "amd64"
#define SYZ_REVISION "240c65c5b7b17b0d4a6d7365323733dd48fc9118"
#define SYZ_REVISION "b3574571fbfa175bbf91c857af8d5e6db2d92ccf"
#define SYZ_EXECUTOR_USES_FORK_SERVER 1
#define SYZ_EXECUTOR_USES_SHMEM 1
#define SYZ_PAGE_SIZE 4096

4
executor/syscalls.h generated
View File

@ -252,6 +252,8 @@ const call_t syscalls[] = {
{"bind$inet", 104},
{"bind$inet6", 104},
{"bind$unix", 104},
{"bindat", 538},
{"bindat$unix", 538},
{"chdir", 12},
{"chflags", 34},
{"chflagsat", 540},
@ -770,6 +772,8 @@ const call_t syscalls[] = {
{"bind$inet", 104},
{"bind$inet6", 104},
{"bind$unix", 104},
{"bindat", 538},
{"bindat$unix", 538},
{"chdir", 12},
{"chflags", 34},
{"chflagsat", 540},

15
sys/freebsd/gen/386.go generated
View File

@ -1920,6 +1920,18 @@ var syscalls_386 = []*Syscall{
&PtrType{TypeCommon{TypeName: "ptr", FldName: "addr", TypeSize: 4}, &UnionType{Key: StructKey{Name: "sockaddr_un"}}},
&LenType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "len", FldName: "addrlen", TypeSize: 4}}, Path: []string{"addr"}},
}},
{NR: 538, Name: "bindat", CallName: "bindat", Args: []Type{
&ResourceType{TypeCommon: TypeCommon{TypeName: "fd", FldName: "dirfd", TypeSize: 4}},
&ResourceType{TypeCommon: TypeCommon{TypeName: "sock", FldName: "fd", TypeSize: 4}},
&PtrType{TypeCommon{TypeName: "ptr", FldName: "addr", TypeSize: 4}, &UnionType{Key: StructKey{Name: "sockaddr_storage"}}},
&LenType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "len", FldName: "addrlen", TypeSize: 4}}, Path: []string{"addr"}},
}},
{NR: 538, Name: "bindat$unix", CallName: "bindat", Args: []Type{
&ResourceType{TypeCommon: TypeCommon{TypeName: "fd", FldName: "dirfd", TypeSize: 4}},
&ResourceType{TypeCommon: TypeCommon{TypeName: "sock_unix", FldName: "fd", TypeSize: 4}},
&PtrType{TypeCommon{TypeName: "ptr", FldName: "addr", TypeSize: 4}, &UnionType{Key: StructKey{Name: "sockaddr_un"}}},
&LenType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "len", FldName: "addrlen", TypeSize: 4}}, Path: []string{"addr"}},
}},
{NR: 12, Name: "chdir", CallName: "chdir", Args: []Type{
&PtrType{TypeCommon{TypeName: "ptr", FldName: "dir", TypeSize: 4}, &BufferType{TypeCommon: TypeCommon{TypeName: "filename", IsVarlen: true}, Kind: 3}},
}},
@ -5618,6 +5630,7 @@ var consts_386 = []ConstValue{
{"SYS_accept", 30},
{"SYS_accept4", 541},
{"SYS_bind", 104},
{"SYS_bindat", 538},
{"SYS_chdir", 12},
{"SYS_chflags", 34},
{"SYS_chflagsat", 540},
@ -5837,4 +5850,4 @@ var consts_386 = []ConstValue{
{"WUNTRACED", 2},
}
const revision_386 = "325e7f88c9a9be6d5408e8f4b16b46a7dfa46701"
const revision_386 = "9153d8fbbe6b117424690a313cf2b7a3a1f02c34"

View File

@ -1947,6 +1947,18 @@ var syscalls_amd64 = []*Syscall{
&PtrType{TypeCommon{TypeName: "ptr", FldName: "addr", TypeSize: 8}, &UnionType{Key: StructKey{Name: "sockaddr_un"}}},
&LenType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "len", FldName: "addrlen", TypeSize: 8}}, Path: []string{"addr"}},
}},
{NR: 538, Name: "bindat", CallName: "bindat", Args: []Type{
&ResourceType{TypeCommon: TypeCommon{TypeName: "fd", FldName: "dirfd", TypeSize: 4}},
&ResourceType{TypeCommon: TypeCommon{TypeName: "sock", FldName: "fd", TypeSize: 4}},
&PtrType{TypeCommon{TypeName: "ptr", FldName: "addr", TypeSize: 8}, &UnionType{Key: StructKey{Name: "sockaddr_storage"}}},
&LenType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "len", FldName: "addrlen", TypeSize: 8}}, Path: []string{"addr"}},
}},
{NR: 538, Name: "bindat$unix", CallName: "bindat", Args: []Type{
&ResourceType{TypeCommon: TypeCommon{TypeName: "fd", FldName: "dirfd", TypeSize: 4}},
&ResourceType{TypeCommon: TypeCommon{TypeName: "sock_unix", FldName: "fd", TypeSize: 4}},
&PtrType{TypeCommon{TypeName: "ptr", FldName: "addr", TypeSize: 8}, &UnionType{Key: StructKey{Name: "sockaddr_un"}}},
&LenType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "len", FldName: "addrlen", TypeSize: 8}}, Path: []string{"addr"}},
}},
{NR: 12, Name: "chdir", CallName: "chdir", Args: []Type{
&PtrType{TypeCommon{TypeName: "ptr", FldName: "dir", TypeSize: 8}, &BufferType{TypeCommon: TypeCommon{TypeName: "filename", IsVarlen: true}, Kind: 3}},
}},
@ -5645,6 +5657,7 @@ var consts_amd64 = []ConstValue{
{"SYS_accept", 30},
{"SYS_accept4", 541},
{"SYS_bind", 104},
{"SYS_bindat", 538},
{"SYS_chdir", 12},
{"SYS_chflags", 34},
{"SYS_chflagsat", 540},
@ -5864,4 +5877,4 @@ var consts_amd64 = []ConstValue{
{"WUNTRACED", 2},
}
const revision_amd64 = "240c65c5b7b17b0d4a6d7365323733dd48fc9118"
const revision_amd64 = "b3574571fbfa175bbf91c857af8d5e6db2d92ccf"

View File

@ -17,6 +17,7 @@ type sock_port proc[20000, 4, int16be]
socket(domain flags[socket_domain], type flags[socket_type], proto int8) sock
socketpair(domain flags[socket_domain], type flags[socket_type], proto int8, fds ptr[out, sock_pair])
bind(fd sock, addr ptr[in, sockaddr_storage], addrlen len[addr])
bindat(dirfd fd, fd sock, addr ptr[in, sockaddr_storage], addrlen len[addr])
connect(fd sock, addr ptr[in, sockaddr_storage], addrlen len[addr])
connectat(dirfd fd, fd sock, addr ptr[in, sockaddr_storage], addrlen len[addr])
accept(fd sock, peer ptr[out, sockaddr_storage, opt], peerlen ptr[inout, len[peer, int32]]) sock

View File

@ -69,6 +69,7 @@ SO_USER_COOKIE = 4117
SYS_accept = 30
SYS_accept4 = 541
SYS_bind = 104
SYS_bindat = 538
SYS_connect = 98
SYS_connectat = 539
SYS_getpeername = 31

View File

@ -69,6 +69,7 @@ SO_USER_COOKIE = 4117
SYS_accept = 30
SYS_accept4 = 541
SYS_bind = 104
SYS_bindat = 538
SYS_connect = 98
SYS_connectat = 539
SYS_getpeername = 31

View File

@ -14,6 +14,7 @@ resource sock_unix[sock]
socket$unix(domain const[AF_UNIX], type flags[unix_socket_type], proto const[0]) sock_unix
socketpair$unix(domain const[AF_UNIX], type flags[unix_socket_type], proto const[0], fds ptr[out, unix_pair])
bind$unix(fd sock_unix, addr ptr[in, sockaddr_un], addrlen len[addr])
bindat$unix(dirfd fd, fd sock_unix, addr ptr[in, sockaddr_un], addrlen len[addr])
connect$unix(fd sock_unix, addr ptr[in, sockaddr_un], addrlen len[addr])
connectat$unix(dirfd fd, fd sock_unix, addr ptr[in, sockaddr_un], addrlen len[addr])
accept$unix(fd sock_unix, peer ptr[out, sockaddr_un, opt], peerlen ptr[inout, len[peer, int32]]) sock_unix

View File

@ -10,6 +10,7 @@ SOL_SOCKET = 65535
SYS_accept = 30
SYS_accept4 = 541
SYS_bind = 104
SYS_bindat = 538
SYS_connect = 98
SYS_connectat = 539
SYS_getpeername = 31

View File

@ -10,6 +10,7 @@ SOL_SOCKET = 65535
SYS_accept = 30
SYS_accept4 = 541
SYS_bind = 104
SYS_bindat = 538
SYS_connect = 98
SYS_connectat = 539
SYS_getpeername = 31