History

[PATCH] selinux: add hooks for key subsystem

Introduce SELinux hooks to support the access key retention subsystem within the kernel. Incorporate new flask headers from a modified version of the SELinux reference policy, with support for the new security class representing retained keys. Extend the "key_alloc" security hook with a task parameter representing the intended ownership context for the key being allocated. Attach security information to root's default keyrings within the SELinux initialization routine. Has passed David's testsuite.

Michael LeMay committed 20 years ago

Commit d7200241 parent f893afb16 files · +155 −27Browse files

Showing the changes to security/keys/key.c (1 of 16 files). Show all

Unified · Split

security/keys/key.c+4−4
@@ -247,8 +247,8 @@ static inline void key_alloc_serial(struct key *key) · 246 unmodified lines
247247 * instantiate the key or discard it before returning
248248 */
249249 struct key *key_alloc(struct key_type *type, const char *desc,
250− uid_t uid, gid_t gid, key_perm_t perm,
251− int not_in_quota)
250+ uid_t uid, gid_t gid, struct task_struct *ctx,
251+ key_perm_t perm, int not_in_quota)
252252 {
253253 struct key_user *user = NULL;
254254 struct key *key;
@@ -318,7 +318,7 @@ struct key *key_alloc(struct key_type *type, const char *desc, · 63 unmodified lines
318318 #endif
319319
320320 /* let the security module know about the key */
321− ret = security_key_alloc(key);
321+ ret = security_key_alloc(key, ctx);
322322 if (ret < 0)
323323 goto security_error;
324324
@@ -822,7 +822,7 @@ key_ref_t key_create_or_update(key_ref_t keyring_ref, · 497 unmodified lines
822822
823823 /* allocate a new key */
824824 key = key_alloc(ktype, description, current->fsuid, current->fsgid,
825− perm, not_in_quota);
825+ current, perm, not_in_quota);
826826 if (IS_ERR(key)) {
827827 key_ref = ERR_PTR(PTR_ERR(key));
828828 goto error_3;