summaryrefslogtreecommitdiffstats
path: root/security
diff options
context:
space:
mode:
authorDavid Howells <dhowells@redhat.com>2016-02-09 16:40:46 +0000
committerDavid Howells <dhowells@redhat.com>2016-02-09 16:40:46 +0000
commit5d2787cf0b210d2925e8d44e2e79241385249d6b (patch)
tree2012c87cf103d8d33ae55f3db822fc380e0280b7 /security
parent411a6f585c0f7695942497ae1a0f3f313cefc6e0 (diff)
downloadlinux-5d2787cf0b210d2925e8d44e2e79241385249d6b.tar.gz
linux-5d2787cf0b210d2925e8d44e2e79241385249d6b.tar.bz2
linux-5d2787cf0b210d2925e8d44e2e79241385249d6b.zip
KEYS: Add an alloc flag to convey the builtinness of a key
Add KEY_ALLOC_BUILT_IN to convey that a key should have KEY_FLAG_BUILTIN set rather than setting it after the fact. Signed-off-by: David Howells <dhowells@redhat.com> Acked-by: Mimi Zohar <zohar@linux.vnet.ibm.com>
Diffstat (limited to 'security')
-rw-r--r--security/keys/key.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/security/keys/key.c b/security/keys/key.c
index 09ef276c4bdc..b28755131687 100644
--- a/security/keys/key.c
+++ b/security/keys/key.c
@@ -296,6 +296,8 @@ struct key *key_alloc(struct key_type *type, const char *desc,
key->flags |= 1 << KEY_FLAG_IN_QUOTA;
if (flags & KEY_ALLOC_TRUSTED)
key->flags |= 1 << KEY_FLAG_TRUSTED;
+ if (flags & KEY_ALLOC_BUILT_IN)
+ key->flags |= 1 << KEY_FLAG_BUILTIN;
#ifdef KEY_DEBUGGING
key->magic = KEY_DEBUG_MAGIC;