aboutsummaryrefslogtreecommitdiffstats
path: root/security/keys/key.c
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/keys/key.c
parentv2 linux-next scripts/sign-file.c Fix LibreSSL support (diff)
downloadlinux-dev-5d2787cf0b210d2925e8d44e2e79241385249d6b.tar.xz
linux-dev-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/keys/key.c')
-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;