diff options
Diffstat (limited to 'include/linux')
| -rw-r--r-- | include/linux/key.h | 11 | ||||
| -rw-r--r-- | include/linux/security.h | 6 |
2 files changed, 14 insertions, 3 deletions
diff --git a/include/linux/key.h b/include/linux/key.h index 3ae45f09589b..017b0826642f 100644 --- a/include/linux/key.h +++ b/include/linux/key.h | |||
| @@ -309,6 +309,17 @@ static inline key_serial_t key_serial(const struct key *key) | |||
| 309 | 309 | ||
| 310 | extern void key_set_timeout(struct key *, unsigned); | 310 | extern void key_set_timeout(struct key *, unsigned); |
| 311 | 311 | ||
| 312 | /* | ||
| 313 | * The permissions required on a key that we're looking up. | ||
| 314 | */ | ||
| 315 | #define KEY_NEED_VIEW 0x01 /* Require permission to view attributes */ | ||
| 316 | #define KEY_NEED_READ 0x02 /* Require permission to read content */ | ||
| 317 | #define KEY_NEED_WRITE 0x04 /* Require permission to update / modify */ | ||
| 318 | #define KEY_NEED_SEARCH 0x08 /* Require permission to search (keyring) or find (key) */ | ||
| 319 | #define KEY_NEED_LINK 0x10 /* Require permission to link */ | ||
| 320 | #define KEY_NEED_SETATTR 0x20 /* Require permission to change attributes */ | ||
| 321 | #define KEY_NEED_ALL 0x3f /* All the above permissions */ | ||
| 322 | |||
| 312 | /** | 323 | /** |
| 313 | * key_is_instantiated - Determine if a key has been positively instantiated | 324 | * key_is_instantiated - Determine if a key has been positively instantiated |
| 314 | * @key: The key to check. | 325 | * @key: The key to check. |
diff --git a/include/linux/security.h b/include/linux/security.h index 6478ce3252c7..9c6b9722ff48 100644 --- a/include/linux/security.h +++ b/include/linux/security.h | |||
| @@ -1708,7 +1708,7 @@ struct security_operations { | |||
| 1708 | void (*key_free) (struct key *key); | 1708 | void (*key_free) (struct key *key); |
| 1709 | int (*key_permission) (key_ref_t key_ref, | 1709 | int (*key_permission) (key_ref_t key_ref, |
| 1710 | const struct cred *cred, | 1710 | const struct cred *cred, |
| 1711 | key_perm_t perm); | 1711 | unsigned perm); |
| 1712 | int (*key_getsecurity)(struct key *key, char **_buffer); | 1712 | int (*key_getsecurity)(struct key *key, char **_buffer); |
| 1713 | #endif /* CONFIG_KEYS */ | 1713 | #endif /* CONFIG_KEYS */ |
| 1714 | 1714 | ||
| @@ -3034,7 +3034,7 @@ static inline int security_path_chroot(struct path *path) | |||
| 3034 | int security_key_alloc(struct key *key, const struct cred *cred, unsigned long flags); | 3034 | int security_key_alloc(struct key *key, const struct cred *cred, unsigned long flags); |
| 3035 | void security_key_free(struct key *key); | 3035 | void security_key_free(struct key *key); |
| 3036 | int security_key_permission(key_ref_t key_ref, | 3036 | int security_key_permission(key_ref_t key_ref, |
| 3037 | const struct cred *cred, key_perm_t perm); | 3037 | const struct cred *cred, unsigned perm); |
| 3038 | int security_key_getsecurity(struct key *key, char **_buffer); | 3038 | int security_key_getsecurity(struct key *key, char **_buffer); |
| 3039 | 3039 | ||
| 3040 | #else | 3040 | #else |
| @@ -3052,7 +3052,7 @@ static inline void security_key_free(struct key *key) | |||
| 3052 | 3052 | ||
| 3053 | static inline int security_key_permission(key_ref_t key_ref, | 3053 | static inline int security_key_permission(key_ref_t key_ref, |
| 3054 | const struct cred *cred, | 3054 | const struct cred *cred, |
| 3055 | key_perm_t perm) | 3055 | unsigned perm) |
| 3056 | { | 3056 | { |
| 3057 | return 0; | 3057 | return 0; |
| 3058 | } | 3058 | } |
