syzkaller/sys/linux/socket_alg.txt
Dmitry Vyukov 0781895e0f pkg/compiler: refactor attribute handling
Introduce common infrastructure for describing and parsing attribute
instead of custom per-attribute code scattered across several locations.

Change align attribute syntax from the weird align_N to align[N].
This also allows to use literal constants as N.

Introduce notion of builtin constants.
Currently we have only PTR_SIZE, which is needed to replace
align_ptr with align[PTR_SIZE].
2020-04-19 10:26:57 +02:00

104 lines
3.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.
# AF_ALG support.
include <linux/socket.h>
include <linux/net.h>
include <linux/crypto.h>
include <uapi/linux/if_alg.h>
resource sock_alg[sock]
resource sock_algconn[sock]
socket$alg(domain const[AF_ALG], type const[SOCK_SEQPACKET], proto const[0]) sock_alg
bind$alg(fd sock_alg, addr ptr[in, sockaddr_alg], addrlen len[addr])
setsockopt$ALG_SET_KEY(fd sock_alg, level const[SOL_ALG], opt const[ALG_SET_KEY], key buffer[in], keylen len[key])
setsockopt$ALG_SET_AEAD_AUTHSIZE(fd sock_alg, level const[SOL_ALG], opt const[ALG_SET_AEAD_AUTHSIZE], val const[0], size intptr)
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 {
family const[AF_ALG, int16]
type string["AUTOGENERATED", 14]
feat flags[af_alg_type, int32]
mask flags[af_alg_type, int32]
name string["AUTOGENERATED", 64]
}
# Special struct generated by Go code.
alg_name {
name string["AUTOGENERATED", 64]
}
# Special struct generated by Go code.
alg_aead_name {
name string["AUTOGENERATED", 64]
}
# Special struct generated by Go code.
alg_hash_name {
name string["AUTOGENERATED", 64]
}
# Special struct generated by Go code.
alg_skcipher_name {
name string["AUTOGENERATED", 64]
}
alg_compress_name {
name string[alg_compress_names, 64]
}
# This is what XFRM supports (see xfrm_calg_list).
alg_compress_names = "deflate", "lzs", "lzjh"
msghdr_alg {
addr const[0, intptr]
addrlen const[0, int32]
vec ptr[in, array[iovec_in]]
vlen len[vec, intptr]
ctrl ptr[in, array[cmsghdr_alg], opt]
ctrllen bytesize[ctrl, intptr]
f flags[send_flags, int32]
}
cmsghdr_alg [
iv cmsghdr_alg_iv
op cmsghdr_alg_op
assoc cmsghdr_alg_assoc
] [varlen]
cmsghdr_alg_iv {
len len[parent, intptr]
level const[SOL_ALG, int32]
type const[ALG_SET_IV, int32]
ivlen len[iv, int32]
iv array[int8]
} [align[PTR_SIZE]]
cmsghdr_alg_op {
len len[parent, intptr]
level const[SOL_ALG, int32]
type const[ALG_SET_OP, int32]
op flags[alg_op_op, int32]
} [align[PTR_SIZE]]
cmsghdr_alg_assoc {
len len[parent, intptr]
level const[SOL_ALG, int32]
type const[ALG_SET_AEAD_ASSOCLEN, int32]
assoc int32
} [align[PTR_SIZE]]
af_alg_type = CRYPTO_ALG_TYPE_MASK, CRYPTO_ALG_TYPE_CIPHER, CRYPTO_ALG_TYPE_COMPRESS, CRYPTO_ALG_TYPE_AEAD, CRYPTO_ALG_TYPE_SKCIPHER, CRYPTO_ALG_TYPE_HASH, CRYPTO_ALG_TYPE_SHASH, CRYPTO_ALG_TYPE_AHASH, CRYPTO_ALG_TYPE_RNG, CRYPTO_ALG_TYPE_AKCIPHER, CRYPTO_ALG_TYPE_PCOMPRESS, CRYPTO_ALG_LARVAL, CRYPTO_ALG_DEAD, CRYPTO_ALG_DYING, CRYPTO_ALG_ASYNC, CRYPTO_ALG_NEED_FALLBACK, CRYPTO_ALG_TESTED, CRYPTO_ALG_INSTANCE, CRYPTO_ALG_KERN_DRIVER_ONLY, CRYPTO_ALG_INTERNAL
alg_op_op = ALG_OP_DECRYPT, ALG_OP_ENCRYPT
# Removed in next-20160210 (commit 11049218)
define CRYPTO_ALG_TYPE_PCOMPRESS 0x0000000f