diff options
| author | Simran Kathpalia <skathpalia3@gmail.com> | 2021-04-28 04:31:00 +0530 |
|---|---|---|
| committer | Mark Johnston <markjdb@gmail.com> | 2021-05-03 10:52:26 -0400 |
| commit | 09efdd63fa8ebdadeccc841b699026e73081f7e0 (patch) | |
| tree | a7ef2b5746672f93059e25ead98820fbc6a86fd1 | |
| parent | ad61f3714f0a5e8f7ce062d54f310df1f5e0d351 (diff) | |
sys/freebsd: added crypto(4) ioctl
| -rw-r--r-- | pkg/build/freebsd.go | 1 | ||||
| -rw-r--r-- | sys/freebsd/dev_crypto.txt | 75 | ||||
| -rw-r--r-- | sys/freebsd/dev_crypto.txt.const | 40 |
3 files changed, 116 insertions, 0 deletions
diff --git a/pkg/build/freebsd.go b/pkg/build/freebsd.go index 7b7c10ebf..ba961dfe9 100644 --- a/pkg/build/freebsd.go +++ b/pkg/build/freebsd.go @@ -81,6 +81,7 @@ tcp_bbr_load="YES" tcp_rack_load="YES" sem_load="YES" mqueuefs_load="YES" +cryptodev_load="YES" __EOF__ cat | sudo tee -a ${tmpdir}/etc/sysctl.conf <<__EOF__ diff --git a/sys/freebsd/dev_crypto.txt b/sys/freebsd/dev_crypto.txt new file mode 100644 index 000000000..869784c3c --- /dev/null +++ b/sys/freebsd/dev_crypto.txt @@ -0,0 +1,75 @@ +# Copyright 2021 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/time.h> +include <fcntl.h> +include <opencrypto/cryptodev.h> + +resource fd_crypto[fd] + +openat$crypto(fd const[AT_FDCWD], file ptr[in, string["/dev/crypto"]], flags flags[open_flags], mode const[0]) fd_crypto + +define CRIOGET 3221513060 +ioctl$CRIOGET(fd fd_crypto, cmd const[CRIOGET], arg ptr[inout, int32]) +ioctl$CIOCFINDDEV(fd fd_crypto, cmd const[CIOCFINDDEV], arg ptr[inout, crypt_find_op]) +ioctl$CIOCGSESSION(fd fd_crypto, cmd const[CIOCGSESSION], arg ptr[inout, session_op]) +ioctl$CIOCGSESSION2(fd fd_crypto, cmd const[CIOCGSESSION2], arg ptr[inout, session2_op]) +ioctl$CIOCCRYPT(fd fd_crypto, cmd const[CIOCCRYPT], arg ptr[inout, crypt_op]) +ioctl$CIOCCRYPTAEAD(fd fd_crypto, cmd const[CIOCCRYPTAEAD], arg ptr[inout, crypt_aead]) +ioctl$CIOCFSESSION(fd fd_crypto, cmd const[CIOCFSESSION], arg ptr[inout, array[int32]]) + +crypt_find_op { + crid int32 + name array[int8, 32] +} + +session_op { + cipher flags[cipher_flags, int32] + mac flags[mac_flags, int32] + keylen bytesize[key, int32] + key ptr[in, array[int8]] + mackeylen bytesize[mackey, int32] + mackey ptr[in, array[int8]] + ses int32 +} + +session2_op { + cipher flags[cipher_flags, int32] + mac flags[mac_flags, int32] + keylen bytesize[key, int32] + key ptr[in, array[int8]] + mackeylen bytesize[mackey, int32] + mackey ptr[in, array[int8]] + ses int32 + crid int32 + pad array[int32, 4] +} + +crypt_op { + ses int32 + op flags[op_flags, int16] + flags int16 + len int32 + src ptr[in, array[int8]] + dst ptr[in, array[int8]] + mac ptr[in, array[int8]] + iv ptr[in, array[int8]] +} + +crypt_aead { + ses int32 + op flags[op_flags, int16] + flags int16 + len int32 + aadlen int32 + ivlen int32 + src ptr[in, array[int8]] + dst ptr[in, array[int8]] + aad ptr[in, array[int8]] + tag ptr[in, array[int8]] + iv ptr[in, array[int8]] +} + +cipher_flags = CRYPTO_AES_CBC, CRYPTO_AES_XTS, CRYPTO_AES_ICM, CRYPTO_CHACHA20, CRYPTO_NULL_CBC, CRYPTO_AES_NIST_GCM_16, CRYPTO_AES_CCM_16, CRYPTO_CHACHA20_POLY1305, CRYPTO_CAMELLIA_CBC +mac_flags = CRYPTO_SHA2_224_HMAC, CRYPTO_SHA2_256_HMAC, CRYPTO_SHA2_384_HMAC, CRYPTO_SHA2_512_HMAC, CRYPTO_AES_NIST_GMAC, CRYPTO_POLY1305, CRYPTO_SHA1, CRYPTO_SHA1_HMAC, CRYPTO_BLAKE2B, CRYPTO_BLAKE2S, CRYPTO_AES_NIST_GMAC, CRYPTO_SHA2_224, CRYPTO_SHA2_256, CRYPTO_SHA2_384, CRYPTO_SHA2_512, CRYPTO_RIPEMD160_HMAC, CRYPTO_AES_CCM_CBC_MAC, CRYPTO_NULL_HMAC +op_flags = COP_ENCRYPT, COP_DECRYPT diff --git a/sys/freebsd/dev_crypto.txt.const b/sys/freebsd/dev_crypto.txt.const new file mode 100644 index 000000000..9a6f34bca --- /dev/null +++ b/sys/freebsd/dev_crypto.txt.const @@ -0,0 +1,40 @@ +# Code generated by syz-sysgen. DO NOT EDIT. +arches = 386, amd64 +AT_FDCWD = 18446744073709551516 +CIOCCRYPT = 3224396647 +CIOCCRYPTAEAD = 3225445229 +CIOCFINDDEV = 3223610220 +CIOCFSESSION = 2147771238 +CIOCGSESSION = 3224396645 +CIOCGSESSION2 = 3225445226 +COP_DECRYPT = 2 +COP_ENCRYPT = 1 +CRIOGET = 3221513060 +CRYPTO_AES_CBC = 11 +CRYPTO_AES_CCM_16 = 40 +CRYPTO_AES_CCM_CBC_MAC = 39 +CRYPTO_AES_ICM = 23 +CRYPTO_AES_NIST_GCM_16 = 25 +CRYPTO_AES_NIST_GMAC = 24 +CRYPTO_AES_XTS = 22 +CRYPTO_BLAKE2B = 29 +CRYPTO_BLAKE2S = 30 +CRYPTO_CAMELLIA_CBC = 21 +CRYPTO_CHACHA20 = 31 +CRYPTO_CHACHA20_POLY1305 = 41 +CRYPTO_NULL_CBC = 16 +CRYPTO_NULL_HMAC = 15 +CRYPTO_POLY1305 = 38 +CRYPTO_RIPEMD160_HMAC = 8 +CRYPTO_SHA1 = 14 +CRYPTO_SHA1_HMAC = 7 +CRYPTO_SHA2_224 = 34 +CRYPTO_SHA2_224_HMAC = 32 +CRYPTO_SHA2_256 = 35 +CRYPTO_SHA2_256_HMAC = 18 +CRYPTO_SHA2_384 = 36 +CRYPTO_SHA2_384_HMAC = 19 +CRYPTO_SHA2_512 = 37 +CRYPTO_SHA2_512_HMAC = 20 +SYS_ioctl = 54 +SYS_openat = 499 |
