aboutsummaryrefslogtreecommitdiffstats
path: root/security/keys/trusted.c
diff options
context:
space:
mode:
Diffstat (limited to 'security/keys/trusted.c')
-rw-r--r--security/keys/trusted.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/security/keys/trusted.c b/security/keys/trusted.c
index 0c33e2ea1f3..7611f703be5 100644
--- a/security/keys/trusted.c
+++ b/security/keys/trusted.c
@@ -1002,12 +1002,15 @@ static void trusted_rcu_free(struct rcu_head *rcu)
*/
static int trusted_update(struct key *key, const void *data, size_t datalen)
{
- struct trusted_key_payload *p = key->payload.data;
+ struct trusted_key_payload *p;
struct trusted_key_payload *new_p;
struct trusted_key_options *new_o;
char *datablob;
int ret = 0;
+ if (test_bit(KEY_FLAG_NEGATIVE, &key->flags))
+ return -ENOKEY;
+ p = key->payload.data;
if (!p->migratable)
return -EPERM;
if (datalen <= 0 || datalen > 32767 || !data)