Commit Graph

16 Commits

Author SHA1 Message Date
Eric Biggers
80e99b01d7 sys/linux: update fscrypt descriptions
- Add fscrypt_add_key_arg::key_id and "fscrypt-provisioning" key type
  (Linux 5.6, https://git.kernel.org/linus/93edd392cad7)

- Add FS_IOC_GET_ENCRYPTION_NONCE
  (Linux 5.7, https://git.kernel.org/linus/e98ad464750c)

- Add FSCRYPT_POLICY_FLAG_IV_INO_LBLK_32
  (Linux 5.8, https://git.kernel.org/linus/e3b1078bedd3)
2020-06-10 10:13:43 -07:00
Dmitry Vyukov
924f760604 pkg/compiler: ensure consistency of syscall argument types
Ensure that we don't have conflicting sizes for the same argument
of the same syscall, e.g.:

foo$1(a int16)
foo$2(a int32)

This is useful for several reasons:
 - we will be able avoid morphing syscalls into other syscalls
 - we will be able to figure out more precise sizes for args
   (lots of them are implicitly intptr, which is the largest
   type on most important arches)
 - found few bugs in linux descriptions

Update #477
Update #502
2020-03-17 21:19:13 +01:00
Eric Biggers
84d08cdf2d sys/linux: update for v5.3 again
Update descriptions to be compatible with latest linux-next
(next-20190715), which in theory will match v5.3-rc1 when the merge
window closes.

- KEYCTL_GRANT_PERMISSION was reverted.  So remove its description.

- CRYPTO_ALG_TYPE_DIGEST was removed.  So remove its description.

- IB_QP_CREATE_SIGNATURE_EN was renamed to IB_QP_CREATE_INTEGRITY_EN.

Also remove the sys/linux/rdma_*.const files which were incorrectly
checked into git.  The real copies of those files are in
sys/linux/dev_infiniband_rdma_*.const.

For now I did *not* check for other new APIs that need to be described.
2019-07-16 10:08:43 +02:00
Eric Biggers
139ac68a73 sys/linux: update key descriptions
- Add KEYCTL_MOVE (new in v5.3)
- Add KEYCTL_CAPABILITIES (new in v5.3)
- Add KEYCTL_GRANT_PERMISSION (new in v5.3)
- Remove KEY_PERM_UNDEF (was only ever in an internal kernel header,
  not in UAPI; removed in v5.3)
2019-07-15 13:44:02 +03:00
Dmitry Vyukov
c1caccc833 sys/linux: improve key and net_sch descriptions
Use the len paths to resolve pending TODOs.
2019-05-14 19:28:01 +02:00
Dmitry Vyukov
162bd26be4 pkg/compiler: make buffer alias to ptr[array[int8]]
Ptr type has special handling of direction (pointers are always input).
But buffer type missed this special case all the time.
Make buffer less special by aliasing to the ptr[array[int8]] type.
As the result buffer type can't have optional trailing "opt" attribute
because we don't have such support for templates yet.
Change such cases to use ptr type directly.

Fixes #1097
2019-04-01 12:46:10 +02:00
Dmitry Vyukov
aa4feb0329 sys/linux: extend key descriptions 2019-02-07 09:39:35 +01:00
Dmitry Vyukov
58fca249ef sys/linux: add encrypted key instantiation payloads 2018-09-26 15:37:33 +02:00
Dmitry Vyukov
920b18be87 sys: mark output resources as opt
Mark output resources as opt in preparation for more
precise constructor calculation.
2018-06-18 19:45:47 +02:00
Dmitry Vyukov
6bfd4f1979 sys/linux: netlink xfrm support 2017-12-31 12:11:12 +01:00
Dmitry Vyukov
473d90487b sys/linux: improve hash generation for KEYCTL_DH_COMPUTE
KEYCTL_DH_COMPUTE used the old fixed list of algorithm names.
Use the new code for algorithm generation.
+ it needs only SHASH algs, but we passed in all alg names.
Pass only SHASH algs.
2017-11-27 09:09:01 +01:00
Eric Biggers
7cff33f196 sys/linux: add definition for keyctl_restrict_keyring()
Add a definition for keyctl_restrict_keyring(), which was added in the
v4.12 kernel.
2017-11-03 12:33:25 +03:00
Eric Biggers
d53e548027 sys/linux: add definition for keyctl_dh_compute()
Add a definition for keyctl_dh_compute(), which was added in the v4.7
kernel, then in the v4.12 kernel extended to take in an optional
'keyctl_kdf_params' argument.  (Requires CONFIG_KEY_DH_OPERATIONS=y.)
2017-11-03 12:33:25 +03:00
Eric Biggers
494a18d9f8 sys/linux: use resource subtypes for "user" and "keyring" keys
Many functions in the keys API take in an ID parameter that is expected
to refer to a keyring, not to any key.  Therefore, define a resource
subtype 'keyring' which can be created by add_key("keyring", ...) or by
using one of the special keyring IDs.

Also define a resource subtype 'user_key', since we'll be adding a
definition for KEYCTL_DH_COMPUTE which takes in a struct containing
"user" key IDs.
2017-11-03 12:33:25 +03:00
Eric Biggers
2fb815f286 sys/linux: define all the key types
Add to key.txt all key types that currently might be present in the
kernel.  It was missing a few important ones such as "asymmetric", which
has a significant attack surface since the payloads are run through an
ASN.1 decoder.
2017-11-03 12:33:25 +03:00
Dmitry Vyukov
18e96021ed sys: move linux descriptions to sys/linux 2017-09-15 16:02:37 +02:00