linux-stable/security/keys
Jarkko Sakkinen 22ac48d0e4 KEYS: trusted: Fix migratable=1 failing
commit 8da7520c80 upstream.

Consider the following transcript:

$ keyctl add trusted kmk "new 32 blobauth=helloworld keyhandle=80000000 migratable=1" @u
add_key: Invalid argument

The documentation has the following description:

  migratable=   0|1 indicating permission to reseal to new PCR values,
                default 1 (resealing allowed)

The consequence is that "migratable=1" should succeed. Fix this by
allowing this condition to pass instead of return -EINVAL.

[*] Documentation/security/keys/trusted-encrypted.rst

Cc: stable@vger.kernel.org
Cc: "James E.J. Bottomley" <jejb@linux.ibm.com>
Cc: Mimi Zohar <zohar@linux.ibm.com>
Cc: David Howells <dhowells@redhat.com>
Fixes: d00a1c72f7 ("keys: add new trusted key-type")
Signed-off-by: Jarkko Sakkinen <jarkko@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-03-03 17:44:42 +01:00
..
encrypted-keys KEYS: encrypted: fix buffer overread in valid_master_desc() 2018-02-13 12:35:57 +01:00
Kconfig security/keys: BIG_KEY requires CONFIG_CRYPTO 2018-02-25 11:05:53 +01:00
Makefile KEYS: Add KEYCTL_DH_COMPUTE command 2016-04-12 19:54:58 +01:00
big_key.c KEYS: Fix race between updating and finding a negative key 2017-10-27 10:38:11 +02:00
compat.c KEYS: Add placeholder for KDF usage with DH 2016-06-03 16:14:34 +10:00
dh.c KEYS: Add placeholder for KDF usage with DH 2016-06-03 16:14:34 +10:00
gc.c KEYS: Fix race between updating and finding a negative key 2017-10-27 10:38:11 +02:00
internal.h KEYS: prevent creating a different user's keyrings 2017-10-05 09:44:00 +02:00
key.c KEYS: reaching the keys quotas correctly 2020-04-24 07:58:53 +02:00
keyctl.c KEYS: reaching the keys quotas correctly 2020-04-24 07:58:53 +02:00
keyring.c KEYS: always initialize keyring_index_key::desc_len 2019-02-27 10:07:00 +01:00
permission.c
persistent.c KEYS: Strip trailing spaces 2016-06-14 10:29:44 +01:00
proc.c KEYS: restrict /proc/keys by credentials at open time 2019-03-19 13:14:08 +01:00
process_keys.c KEYS: Fix race between updating and finding a negative key 2017-10-27 10:38:11 +02:00
request_key.c KEYS: always initialize keyring_index_key::desc_len 2019-02-27 10:07:00 +01:00
request_key_auth.c keys: Fix missing null pointer check in request_key_auth_describe() 2019-09-21 07:14:21 +02:00
sysctl.c
trusted.c KEYS: trusted: Fix migratable=1 failing 2021-03-03 17:44:42 +01:00
trusted.h
user_defined.c KEYS: Fix race between updating and finding a negative key 2017-10-27 10:38:11 +02:00