kernel-fxtec-pro1x/security/keys
David Howells 7268328219 keys: Fix dependency loop between construction record and auth key
[ Upstream commit 822ad64d7e46a8e2c8b8a796738d7b657cbb146d ]

In the request_key() upcall mechanism there's a dependency loop by which if
a key type driver overrides the ->request_key hook and the userspace side
manages to lose the authorisation key, the auth key and the internal
construction record (struct key_construction) can keep each other pinned.

Fix this by the following changes:

 (1) Killing off the construction record and using the auth key instead.

 (2) Including the operation name in the auth key payload and making the
     payload available outside of security/keys/.

 (3) The ->request_key hook is given the authkey instead of the cons
     record and operation name.

Changes (2) and (3) allow the auth key to naturally be cleaned up if the
keyring it is in is destroyed or cleared or the auth key is unlinked.

Fixes: 7ee02a316600 ("keys: Fix dependency loop between construction record and auth key")
Signed-off-by: David Howells <dhowells@redhat.com>
Signed-off-by: James Morris <james.morris@microsoft.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2019-03-23 20:09:48 +01:00
..
encrypted-keys
big_key.c
compat.c
compat_dh.c
dh.c Revert "uapi/linux/keyctl.h: don't use C++ reserved keyword as a struct member name" 2018-09-25 13:28:58 +02:00
gc.c
internal.h keys: Fix dependency loop between construction record and auth key 2019-03-23 20:09:48 +01:00
Kconfig
key.c KEYS: allow reaching the keys quotas exactly 2019-02-27 10:08:50 +01:00
keyctl.c keys: Fix dependency loop between construction record and auth key 2019-03-23 20:09:48 +01:00
keyring.c KEYS: always initialize keyring_index_key::desc_len 2019-02-27 10:09:00 +01:00
Makefile
permission.c
persistent.c
proc.c KEYS: always initialize keyring_index_key::desc_len 2019-02-27 10:09:00 +01:00
process_keys.c keys: Fix dependency loop between construction record and auth key 2019-03-23 20:09:48 +01:00
request_key.c keys: Fix dependency loop between construction record and auth key 2019-03-23 20:09:48 +01:00
request_key_auth.c keys: Fix dependency loop between construction record and auth key 2019-03-23 20:09:48 +01:00
sysctl.c
trusted.c treewide: kmalloc() -> kmalloc_array() 2018-06-12 16:19:22 -07:00
trusted.h
user_defined.c