Re: [PATCH] KEYS: prevent KEYCTL_READ on negative key

From: David Howells
Date: Tue Sep 19 2017 - 12:09:11 EST


Eric Biggers <ebiggers3@xxxxxxxxx> wrote:

> + if (test_bit(KEY_FLAG_NEGATIVE, &key->flags)) {
> + ret = -ENOKEY;
> + goto error2;
> + }

It might be better to do this check in key_validate(). Also, it should
perhaps take the error from key->reject_error.

David