Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[AF_RXRPC]: Key facility changes for AF_RXRPC

Export the keyring key type definition and document its availability.

Add alternative types into the key's type_data union to make it more useful.
Not all users necessarily want to use it as a list_head (AF_RXRPC doesn't, for
example), so make it clear that it can be used in other ways.

Signed-off-by: David Howells <dhowells@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

David Howells and committed by
David S. Miller
7318226e 071b6386

+16
+12
Documentation/keys.txt
··· 859 859 void unregister_key_type(struct key_type *type); 860 860 861 861 862 + Under some circumstances, it may be desirable to desirable to deal with a 863 + bundle of keys. The facility provides access to the keyring type for managing 864 + such a bundle: 865 + 866 + struct key_type key_type_keyring; 867 + 868 + This can be used with a function such as request_key() to find a specific 869 + keyring in a process's keyrings. A keyring thus found can then be searched 870 + with keyring_search(). Note that it is not possible to use request_key() to 871 + search a specific keyring, so using keyrings in this way is of limited utility. 872 + 873 + 862 874 =================================== 863 875 NOTES ON ACCESSING PAYLOAD CONTENTS 864 876 ===================================
+2
include/linux/key.h
··· 160 160 */ 161 161 union { 162 162 struct list_head link; 163 + unsigned long x[2]; 164 + void *p[2]; 163 165 } type_data; 164 166 165 167 /* key data
+2
security/keys/keyring.c
··· 66 66 .read = keyring_read, 67 67 }; 68 68 69 + EXPORT_SYMBOL(key_type_keyring); 70 + 69 71 /* 70 72 * semaphore to serialise link/link calls to prevent two link calls in parallel 71 73 * introducing a cycle