Skip to content

Commit a09003b

Browse files
committed
keys: Invalidate used request_key authentication keys
Invalidate used request_key authentication keys rather than revoking them so that they get cleaned up immediately rather than potentially hanging around. There doesn't seem any need to keep the revoked keys around. Signed-off-by: David Howells <dhowells@redhat.com>
1 parent 504b69e commit a09003b

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

‎security/keys/key.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -459,7 +459,7 @@ static int __key_instantiate_and_link(struct key *key,
459459

460460
/* disable the authorisation key */
461461
if (authkey)
462-
key_revoke(authkey);
462+
key_invalidate(authkey);
463463

464464
if (prep->expiry != TIME64_MAX) {
465465
key->expiry = prep->expiry;
@@ -616,7 +616,7 @@ int key_reject_and_link(struct key *key,
616616

617617
/* disable the authorisation key */
618618
if (authkey)
619-
key_revoke(authkey);
619+
key_invalidate(authkey);
620620
}
621621

622622
mutex_unlock(&key_construction_mutex);

‎security/keys/request_key.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ static int construct_key(struct key *key, const void *callout_info,
222222
/* check that the actor called complete_request_key() prior to
223223
* returning an error */
224224
WARN_ON(ret < 0 &&
225-
!test_bit(KEY_FLAG_REVOKED, &authkey->flags));
225+
!test_bit(KEY_FLAG_INVALIDATED, &authkey->flags));
226226

227227
key_put(authkey);
228228
kleave(" = %d", ret);

0 commit comments

Comments
 (0)