]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/blobdiff - security/keys/big_key.c
KEYS: Fix race between updating and finding a negative key
[mirror_ubuntu-hirsute-kernel.git] / security / keys / big_key.c
index e607830b6154ce4c8dbcd5563fb0d3607f680c8f..929e14978c421b227e592e937d9157ca2235b2f7 100644 (file)
@@ -247,7 +247,7 @@ void big_key_revoke(struct key *key)
 
        /* clear the quota */
        key_payload_reserve(key, 0);
-       if (key_is_instantiated(key) &&
+       if (key_is_positive(key) &&
            (size_t)key->payload.data[big_key_len] > BIG_KEY_FILE_THRESHOLD)
                vfs_truncate(path, 0);
 }
@@ -279,7 +279,7 @@ void big_key_describe(const struct key *key, struct seq_file *m)
 
        seq_puts(m, key->description);
 
-       if (key_is_instantiated(key))
+       if (key_is_positive(key))
                seq_printf(m, ": %zu [%s]",
                           datalen,
                           datalen > BIG_KEY_FILE_THRESHOLD ? "file" : "buff");