diff --git a/security/keys/request_key.c b/security/keys/request_key.c index 0d26f689bd77..0088dd8bf68a 100644 --- a/security/keys/request_key.c +++ b/security/keys/request_key.c @@ -537,6 +537,8 @@ int wait_for_key_construction(struct key *key, bool intr) intr ? TASK_INTERRUPTIBLE : TASK_UNINTERRUPTIBLE); if (ret < 0) return ret; + if (test_bit(KEY_FLAG_NEGATIVE, &key->flags)) + return -ENOKEY; return key_validate(key); } EXPORT_SYMBOL(wait_for_key_construction);