aboutsummaryrefslogtreecommitdiffstats
path: root/sys/linux
diff options
context:
space:
mode:
authorZubin Mithra <zsm@chromium.org>2019-01-10 10:34:35 -0800
committerDmitry Vyukov <dvyukov@google.com>2019-01-14 18:21:55 +0100
commitb38a805a0ca2f603435089963fe2a42d0b1c7a49 (patch)
treefe394d5e7d3008b219f8aeb919c64f6b4295de41 /sys/linux
parent2a23bd77548452e65f27c0d94a6b285cc204d8cd (diff)
sys/linux: Add syscalls to read from sockets for crypto operations
sockaddr_alg with salg_type as "skcipher", "aead", "hash" and "rng" support for reading from these sockets. Add read descriptions to socket_alg.txt.
Diffstat (limited to 'sys/linux')
-rw-r--r--sys/linux/gen/386.go7
-rw-r--r--sys/linux/gen/amd64.go7
-rw-r--r--sys/linux/gen/arm.go7
-rw-r--r--sys/linux/gen/arm64.go7
-rw-r--r--sys/linux/gen/ppc64le.go7
-rw-r--r--sys/linux/socket_alg.txt1
-rw-r--r--sys/linux/socket_alg_amd64.const1
7 files changed, 32 insertions, 5 deletions
diff --git a/sys/linux/gen/386.go b/sys/linux/gen/386.go
index 2e6a0e0b9..d22855270 100644
--- a/sys/linux/gen/386.go
+++ b/sys/linux/gen/386.go
@@ -34643,6 +34643,11 @@ var syscalls_386 = []*Syscall{
&PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "buf", TypeSize: 4}, Type: &BufferType{TypeCommon: TypeCommon{TypeName: "array", TypeSize: 4096, ArgDir: 1}, Kind: 1, RangeBegin: 4096, RangeEnd: 4096}},
&LenType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "len", FldName: "len", TypeSize: 4}}, Buf: "buf"},
}},
+ {NR: 3, Name: "read$alg", CallName: "read", Args: []Type{
+ &ResourceType{TypeCommon: TypeCommon{TypeName: "sock_algconn", FldName: "fd", TypeSize: 4}},
+ &PtrType{TypeCommon: TypeCommon{TypeName: "buffer", FldName: "buf", TypeSize: 4}, Type: &BufferType{TypeCommon: TypeCommon{ArgDir: 1, IsVarlen: true}}},
+ &LenType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "len", FldName: "size", TypeSize: 4}}, Buf: "buf"},
+ }},
{NR: 3, Name: "read$eventfd", CallName: "read", Args: []Type{
&ResourceType{TypeCommon: TypeCommon{TypeName: "fd_event", FldName: "fd", TypeSize: 4}},
&PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "val", TypeSize: 4}, Type: &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int64", TypeSize: 8, ArgDir: 1}}}},
@@ -46328,4 +46333,4 @@ var consts_386 = []ConstValue{
{Name: "bpf_insn_load_imm_dw", Value: 24},
}
-const revision_386 = "48662e35248c48c4603b1336b18c6af86b066588"
+const revision_386 = "fd6c8c0d5453152c503a72e196385a9ec6ac32b2"
diff --git a/sys/linux/gen/amd64.go b/sys/linux/gen/amd64.go
index da5ac21a6..0d8eadbdf 100644
--- a/sys/linux/gen/amd64.go
+++ b/sys/linux/gen/amd64.go
@@ -35259,6 +35259,11 @@ var syscalls_amd64 = []*Syscall{
&PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "buf", TypeSize: 8}, Type: &BufferType{TypeCommon: TypeCommon{TypeName: "array", TypeSize: 4096, ArgDir: 1}, Kind: 1, RangeBegin: 4096, RangeEnd: 4096}},
&LenType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "len", FldName: "len", TypeSize: 8}}, Buf: "buf"},
}},
+ {Name: "read$alg", CallName: "read", Args: []Type{
+ &ResourceType{TypeCommon: TypeCommon{TypeName: "sock_algconn", FldName: "fd", TypeSize: 4}},
+ &PtrType{TypeCommon: TypeCommon{TypeName: "buffer", FldName: "buf", TypeSize: 8}, Type: &BufferType{TypeCommon: TypeCommon{ArgDir: 1, IsVarlen: true}}},
+ &LenType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "len", FldName: "size", TypeSize: 8}}, Buf: "buf"},
+ }},
{Name: "read$eventfd", CallName: "read", Args: []Type{
&ResourceType{TypeCommon: TypeCommon{TypeName: "fd_event", FldName: "fd", TypeSize: 4}},
&PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "val", TypeSize: 8}, Type: &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int64", TypeSize: 8, ArgDir: 1}}}},
@@ -47118,4 +47123,4 @@ var consts_amd64 = []ConstValue{
{Name: "bpf_insn_load_imm_dw", Value: 24},
}
-const revision_amd64 = "29c6cd9e5fb8dfc9c2c68b74e20dac6056157812"
+const revision_amd64 = "714db9567bad780c568ce486773f7508db10e38e"
diff --git a/sys/linux/gen/arm.go b/sys/linux/gen/arm.go
index 5489dcf5a..45c86eb0a 100644
--- a/sys/linux/gen/arm.go
+++ b/sys/linux/gen/arm.go
@@ -34412,6 +34412,11 @@ var syscalls_arm = []*Syscall{
&PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "buf", TypeSize: 4}, Type: &BufferType{TypeCommon: TypeCommon{TypeName: "array", TypeSize: 4096, ArgDir: 1}, Kind: 1, RangeBegin: 4096, RangeEnd: 4096}},
&LenType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "len", FldName: "len", TypeSize: 4}}, Buf: "buf"},
}},
+ {NR: 3, Name: "read$alg", CallName: "read", Args: []Type{
+ &ResourceType{TypeCommon: TypeCommon{TypeName: "sock_algconn", FldName: "fd", TypeSize: 4}},
+ &PtrType{TypeCommon: TypeCommon{TypeName: "buffer", FldName: "buf", TypeSize: 4}, Type: &BufferType{TypeCommon: TypeCommon{ArgDir: 1, IsVarlen: true}}},
+ &LenType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "len", FldName: "size", TypeSize: 4}}, Buf: "buf"},
+ }},
{NR: 3, Name: "read$eventfd", CallName: "read", Args: []Type{
&ResourceType{TypeCommon: TypeCommon{TypeName: "fd_event", FldName: "fd", TypeSize: 4}},
&PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "val", TypeSize: 4}, Type: &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int64", TypeSize: 8, ArgDir: 1}}}},
@@ -46167,4 +46172,4 @@ var consts_arm = []ConstValue{
{Name: "bpf_insn_load_imm_dw", Value: 24},
}
-const revision_arm = "5cae71ad913cf62e2c1ad54d2252dc27a9197f0c"
+const revision_arm = "9a8f2f521bada026833882545a3c1dfde4f3ec87"
diff --git a/sys/linux/gen/arm64.go b/sys/linux/gen/arm64.go
index de48c9469..457ece864 100644
--- a/sys/linux/gen/arm64.go
+++ b/sys/linux/gen/arm64.go
@@ -34782,6 +34782,11 @@ var syscalls_arm64 = []*Syscall{
&PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "buf", TypeSize: 8}, Type: &BufferType{TypeCommon: TypeCommon{TypeName: "array", TypeSize: 4096, ArgDir: 1}, Kind: 1, RangeBegin: 4096, RangeEnd: 4096}},
&LenType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "len", FldName: "len", TypeSize: 8}}, Buf: "buf"},
}},
+ {NR: 63, Name: "read$alg", CallName: "read", Args: []Type{
+ &ResourceType{TypeCommon: TypeCommon{TypeName: "sock_algconn", FldName: "fd", TypeSize: 4}},
+ &PtrType{TypeCommon: TypeCommon{TypeName: "buffer", FldName: "buf", TypeSize: 8}, Type: &BufferType{TypeCommon: TypeCommon{ArgDir: 1, IsVarlen: true}}},
+ &LenType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "len", FldName: "size", TypeSize: 8}}, Buf: "buf"},
+ }},
{NR: 63, Name: "read$eventfd", CallName: "read", Args: []Type{
&ResourceType{TypeCommon: TypeCommon{TypeName: "fd_event", FldName: "fd", TypeSize: 4}},
&PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "val", TypeSize: 8}, Type: &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int64", TypeSize: 8, ArgDir: 1}}}},
@@ -46476,4 +46481,4 @@ var consts_arm64 = []ConstValue{
{Name: "bpf_insn_load_imm_dw", Value: 24},
}
-const revision_arm64 = "e40e275642a844c787d5af9e28e82d33993bc1ec"
+const revision_arm64 = "21250148b8a615197750c2b1e538f3fdb0fd380d"
diff --git a/sys/linux/gen/ppc64le.go b/sys/linux/gen/ppc64le.go
index 70bc016dd..8b8797ca4 100644
--- a/sys/linux/gen/ppc64le.go
+++ b/sys/linux/gen/ppc64le.go
@@ -33273,6 +33273,11 @@ var syscalls_ppc64le = []*Syscall{
&PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "buf", TypeSize: 8}, Type: &BufferType{TypeCommon: TypeCommon{TypeName: "array", TypeSize: 4096, ArgDir: 1}, Kind: 1, RangeBegin: 4096, RangeEnd: 4096}},
&LenType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "len", FldName: "len", TypeSize: 8}}, Buf: "buf"},
}},
+ {NR: 3, Name: "read$alg", CallName: "read", Args: []Type{
+ &ResourceType{TypeCommon: TypeCommon{TypeName: "sock_algconn", FldName: "fd", TypeSize: 4}},
+ &PtrType{TypeCommon: TypeCommon{TypeName: "buffer", FldName: "buf", TypeSize: 8}, Type: &BufferType{TypeCommon: TypeCommon{ArgDir: 1, IsVarlen: true}}},
+ &LenType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "len", FldName: "size", TypeSize: 8}}, Buf: "buf"},
+ }},
{NR: 3, Name: "read$eventfd", CallName: "read", Args: []Type{
&ResourceType{TypeCommon: TypeCommon{TypeName: "fd_event", FldName: "fd", TypeSize: 4}},
&PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "val", TypeSize: 8}, Type: &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int64", TypeSize: 8, ArgDir: 1}}}},
@@ -43834,4 +43839,4 @@ var consts_ppc64le = []ConstValue{
{Name: "bpf_insn_load_imm_dw", Value: 24},
}
-const revision_ppc64le = "1ea8b686a9a5ac23be58de48a99586ad36bc6c46"
+const revision_ppc64le = "f1dfc77ec33b988ac23bfd1917705787a96b5348"
diff --git a/sys/linux/socket_alg.txt b/sys/linux/socket_alg.txt
index 0869dee72..a4f2a672b 100644
--- a/sys/linux/socket_alg.txt
+++ b/sys/linux/socket_alg.txt
@@ -19,6 +19,7 @@ accept$alg(fd sock_alg, peer const[0], peerlen const[0]) sock_algconn
accept4$alg(fd sock_alg, peer const[0], peerlen const[0], flags flags[accept_flags]) sock_algconn
sendmsg$alg(fd sock_algconn, msg ptr[in, msghdr_alg], f flags[send_flags])
sendmmsg$alg(fd sock_algconn, mmsg ptr[in, array[msghdr_alg]], vlen len[mmsg], f flags[send_flags])
+read$alg(fd sock_algconn, buf buffer[out], size len[buf])
# Special struct generated by Go code.
sockaddr_alg {
diff --git a/sys/linux/socket_alg_amd64.const b/sys/linux/socket_alg_amd64.const
index 80c195158..13d649d8d 100644
--- a/sys/linux/socket_alg_amd64.const
+++ b/sys/linux/socket_alg_amd64.const
@@ -34,6 +34,7 @@ SOL_ALG = 279
__NR_accept = 43
__NR_accept4 = 288
__NR_bind = 49
+__NR_read = 0
__NR_sendmmsg = 307
__NR_sendmsg = 46
__NR_setsockopt = 54