diff options
Diffstat (limited to 'include/linux/verification.h')
-rw-r--r-- | include/linux/verification.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/include/linux/verification.h b/include/linux/verification.h index 911ab7c2b1ab..f34e50ebcf60 100644 --- a/include/linux/verification.h +++ b/include/linux/verification.h @@ -8,6 +8,8 @@ #ifndef _LINUX_VERIFICATION_H #define _LINUX_VERIFICATION_H +#include <linux/types.h> + /* * Indicate that both builtin trusted keys and secondary trusted keys * should be used. @@ -15,6 +17,14 @@ #define VERIFY_USE_SECONDARY_KEYRING ((struct key *)1UL) #define VERIFY_USE_PLATFORM_KEYRING ((struct key *)2UL) +static inline int system_keyring_id_check(u64 id) +{ + if (id > (unsigned long)VERIFY_USE_PLATFORM_KEYRING) + return -EINVAL; + + return 0; +} + /* * The use to which an asymmetric key is being put. */ |