kernel-fxtec-pro1x/include/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
..
asymmetric-parser.h KEYS: Asymmetric key pluggable data parsers 2012-10-08 13:50:13 +10:30
asymmetric-subtype.h docs: Fix some broken references 2018-06-15 18:10:01 -03:00
asymmetric-type.h docs: Fix some broken references 2018-06-15 18:10:01 -03:00
big_key-type.h KEYS: big_key: Use key preparsing 2014-07-22 21:46:47 +01:00
ceph-type.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
dns_resolver-type.h
encrypted-type.h encrypted-keys: add key format support 2011-06-27 09:10:45 -04:00
keyring-type.h KEYS: Expand the capacity of a keyring 2013-09-24 10:35:18 +01:00
request_key_auth-type.h keys: Fix dependency loop between construction record and auth key 2019-03-23 20:09:48 +01:00
rxrpc-type.h net: rxrpc: Replace time_t type with time64_t type 2017-08-29 10:16:00 +01:00
system_keyring.h KEYS: Split role of the keyring pointer for keyring restrict functions 2017-04-03 10:24:56 -07:00
trusted-type.h tpm: fix checks for policy digest existence in tpm2_seal_trusted() 2016-02-10 04:10:55 +02:00
user-type.h KEYS: user: Align the payload buffer 2019-02-27 10:09:00 +01:00