From e09b41010ba33a20a87472ee821fa407a5b8da36 Mon Sep 17 00:00:00 2001 From: José Pekkarinen Date: Mon, 11 Apr 2016 10:41:07 +0300 Subject: These changes are the raw update to linux-4.4.6-rt14. Kernel sources are taken from kernel.org, and rt patch from the rt wiki download page. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit During the rebasing, the following patch collided: Force tick interrupt and get rid of softirq magic(I70131fb85). Collisions have been removed because its logic was found on the source already. Change-Id: I7f57a4081d9deaa0d9ccfc41a6c8daccdee3b769 Signed-off-by: José Pekkarinen --- kernel/include/keys/asymmetric-subtype.h | 2 +- kernel/include/keys/asymmetric-type.h | 15 +++++++++++++++ kernel/include/keys/system_keyring.h | 7 +++++++ kernel/include/keys/trusted-type.h | 14 +++++++++++++- kernel/include/keys/user-type.h | 8 ++++++++ 5 files changed, 44 insertions(+), 2 deletions(-) (limited to 'kernel/include/keys') diff --git a/kernel/include/keys/asymmetric-subtype.h b/kernel/include/keys/asymmetric-subtype.h index 4b840e822..4915d40d3 100644 --- a/kernel/include/keys/asymmetric-subtype.h +++ b/kernel/include/keys/asymmetric-subtype.h @@ -49,7 +49,7 @@ struct asymmetric_key_subtype { static inline struct asymmetric_key_subtype *asymmetric_key_subtype(const struct key *key) { - return key->type_data.p[0]; + return key->payload.data[asym_subtype]; } #endif /* _KEYS_ASYMMETRIC_SUBTYPE_H */ diff --git a/kernel/include/keys/asymmetric-type.h b/kernel/include/keys/asymmetric-type.h index c0754abb2..59c1df9cf 100644 --- a/kernel/include/keys/asymmetric-type.h +++ b/kernel/include/keys/asymmetric-type.h @@ -18,6 +18,16 @@ extern struct key_type key_type_asymmetric; +/* + * The key payload is four words. The asymmetric-type key uses them as + * follows: + */ +enum asymmetric_payload_bits { + asym_crypto, + asym_subtype, + asym_key_ids, +}; + /* * Identifiers for an asymmetric key ID. We have three ways of looking up a * key derived from an X.509 certificate: @@ -58,6 +68,11 @@ extern struct asymmetric_key_id *asymmetric_key_generate_id(const void *val_1, size_t len_1, const void *val_2, size_t len_2); +static inline +const struct asymmetric_key_ids *asymmetric_key_ids(const struct key *key) +{ + return key->payload.data[asym_key_ids]; +} /* * The payload is at the discretion of the subtype. diff --git a/kernel/include/keys/system_keyring.h b/kernel/include/keys/system_keyring.h index 72665eb80..b20cd885c 100644 --- a/kernel/include/keys/system_keyring.h +++ b/kernel/include/keys/system_keyring.h @@ -15,6 +15,7 @@ #ifdef CONFIG_SYSTEM_TRUSTED_KEYRING #include +#include extern struct key *system_trusted_keyring; static inline struct key *get_system_trusted_keyring(void) @@ -28,4 +29,10 @@ static inline struct key *get_system_trusted_keyring(void) } #endif +#ifdef CONFIG_SYSTEM_DATA_VERIFICATION +extern int system_verify_data(const void *data, unsigned long len, + const void *raw_pkcs7, size_t pkcs7_len, + enum key_being_used_for usage); +#endif + #endif /* _KEYS_SYSTEM_KEYRING_H */ diff --git a/kernel/include/keys/trusted-type.h b/kernel/include/keys/trusted-type.h index 56f82e5c9..f91ecd9d1 100644 --- a/kernel/include/keys/trusted-type.h +++ b/kernel/include/keys/trusted-type.h @@ -12,10 +12,12 @@ #include #include +#include #define MIN_KEY_SIZE 32 #define MAX_KEY_SIZE 128 -#define MAX_BLOB_SIZE 320 +#define MAX_BLOB_SIZE 512 +#define MAX_PCRINFO_SIZE 64 struct trusted_key_payload { struct rcu_head rcu; @@ -26,6 +28,16 @@ struct trusted_key_payload { unsigned char blob[MAX_BLOB_SIZE]; }; +struct trusted_key_options { + uint16_t keytype; + uint32_t keyhandle; + unsigned char keyauth[TPM_DIGEST_SIZE]; + unsigned char blobauth[TPM_DIGEST_SIZE]; + uint32_t pcrinfo_len; + unsigned char pcrinfo[MAX_PCRINFO_SIZE]; + int pcrlock; +}; + extern struct key_type key_type_trusted; #endif /* _KEYS_TRUSTED_TYPE_H */ diff --git a/kernel/include/keys/user-type.h b/kernel/include/keys/user-type.h index cebefb069..c56fef40f 100644 --- a/kernel/include/keys/user-type.h +++ b/kernel/include/keys/user-type.h @@ -15,6 +15,8 @@ #include #include +#ifdef CONFIG_KEYS + /*****************************************************************************/ /* * the payload for a key of type "user" or "logon" @@ -46,5 +48,11 @@ extern void user_describe(const struct key *user, struct seq_file *m); extern long user_read(const struct key *key, char __user *buffer, size_t buflen); +static inline const struct user_key_payload *user_key_payload(const struct key *key) +{ + return (struct user_key_payload *)rcu_dereference_key(key); +} + +#endif /* CONFIG_KEYS */ #endif /* _KEYS_USER_TYPE_H */ -- cgit 1.2.3-korg