summaryrefslogtreecommitdiff
path: root/security
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>2016-02-01 23:53:14 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2016-02-01 23:53:14 +0300
commit6e9131cc43a672003a75483d9b9db5c51015ae5f (patch)
tree23deb539a695272dc9f003b4ab094037ccc10f31 /security
parentafc5ab096581e1ad6e7e7d1533a6bbb1d2b12455 (diff)
parent36f90b0a2ddd60823fe193a85e60ff1906c2a9b3 (diff)
downloadlinux-6e9131cc43a672003a75483d9b9db5c51015ae5f.tar.xz
Merge 4.5-rc2 into tty-next
We want the tty/serial fixes in here as well to make merges easier. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'security')
-rw-r--r--security/keys/key.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/security/keys/key.c b/security/keys/key.c
index 07a87311055c..09ef276c4bdc 100644
--- a/security/keys/key.c
+++ b/security/keys/key.c
@@ -430,7 +430,8 @@ static int __key_instantiate_and_link(struct key *key,
/* and link it into the destination keyring */
if (keyring) {
- set_bit(KEY_FLAG_KEEP, &key->flags);
+ if (test_bit(KEY_FLAG_KEEP, &keyring->flags))
+ set_bit(KEY_FLAG_KEEP, &key->flags);
__key_link(key, _edit);
}