diff options
Diffstat (limited to 'security/keys/process_keys.c')
| -rw-r--r-- | security/keys/process_keys.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/security/keys/process_keys.c b/security/keys/process_keys.c index 86bced9fdbdf..d5b25e535d3a 100644 --- a/security/keys/process_keys.c +++ b/security/keys/process_keys.c | |||
| @@ -77,7 +77,8 @@ int install_user_keyrings(void) | |||
| 77 | if (IS_ERR(uid_keyring)) { | 77 | if (IS_ERR(uid_keyring)) { |
| 78 | uid_keyring = keyring_alloc(buf, user->uid, INVALID_GID, | 78 | uid_keyring = keyring_alloc(buf, user->uid, INVALID_GID, |
| 79 | cred, user_keyring_perm, | 79 | cred, user_keyring_perm, |
| 80 | KEY_ALLOC_IN_QUOTA, | 80 | KEY_ALLOC_UID_KEYRING | |
| 81 | KEY_ALLOC_IN_QUOTA, | ||
| 81 | NULL, NULL); | 82 | NULL, NULL); |
| 82 | if (IS_ERR(uid_keyring)) { | 83 | if (IS_ERR(uid_keyring)) { |
| 83 | ret = PTR_ERR(uid_keyring); | 84 | ret = PTR_ERR(uid_keyring); |
| @@ -94,7 +95,8 @@ int install_user_keyrings(void) | |||
| 94 | session_keyring = | 95 | session_keyring = |
| 95 | keyring_alloc(buf, user->uid, INVALID_GID, | 96 | keyring_alloc(buf, user->uid, INVALID_GID, |
| 96 | cred, user_keyring_perm, | 97 | cred, user_keyring_perm, |
| 97 | KEY_ALLOC_IN_QUOTA, | 98 | KEY_ALLOC_UID_KEYRING | |
| 99 | KEY_ALLOC_IN_QUOTA, | ||
| 98 | NULL, NULL); | 100 | NULL, NULL); |
| 99 | if (IS_ERR(session_keyring)) { | 101 | if (IS_ERR(session_keyring)) { |
| 100 | ret = PTR_ERR(session_keyring); | 102 | ret = PTR_ERR(session_keyring); |
| @@ -728,7 +730,7 @@ try_again: | |||
| 728 | 730 | ||
| 729 | ret = -EIO; | 731 | ret = -EIO; |
| 730 | if (!(lflags & KEY_LOOKUP_PARTIAL) && | 732 | if (!(lflags & KEY_LOOKUP_PARTIAL) && |
| 731 | !test_bit(KEY_FLAG_INSTANTIATED, &key->flags)) | 733 | key_read_state(key) == KEY_IS_UNINSTANTIATED) |
| 732 | goto invalid_key; | 734 | goto invalid_key; |
| 733 | 735 | ||
| 734 | /* check the permissions */ | 736 | /* check the permissions */ |
| @@ -736,7 +738,7 @@ try_again: | |||
| 736 | if (ret < 0) | 738 | if (ret < 0) |
| 737 | goto invalid_key; | 739 | goto invalid_key; |
| 738 | 740 | ||
| 739 | key->last_used_at = current_kernel_time().tv_sec; | 741 | key->last_used_at = ktime_get_real_seconds(); |
| 740 | 742 | ||
| 741 | error: | 743 | error: |
| 742 | put_cred(ctx.cred); | 744 | put_cred(ctx.cred); |
