kernel-ark/security/keys
David Howells 65d87fe68a KEYS: Perform RCU synchronisation on keys prior to key destruction
Make the keys garbage collector invoke synchronize_rcu() prior to destroying
keys with a zero usage count.  This means that a key can be examined under the
RCU read lock in the safe knowledge that it won't get deallocated until after
the lock is released - even if its usage count becomes zero whilst we're
looking at it.

This is useful in keyring search vs key link.  Consider a keyring containing a
link to a key.  That link can be replaced in-place in the keyring without
requiring an RCU copy-and-replace on the keyring contents without breaking a
search underway on that keyring when the displaced key is released, provided
the key is actually destroyed only after the RCU read lock held by the search
algorithm is released.

This permits __key_link() to replace a key without having to reallocate the key
payload.  A key gets replaced if a new key being linked into a keyring has the
same type and description.

Signed-off-by: David Howells <dhowells@redhat.com>
Acked-by: Jeff Layton <jlayton@redhat.com>
2012-05-11 10:56:56 +01:00
..
encrypted-keys encrypted-keys: fix rcu and sparse messages 2012-01-18 10:41:30 +11:00
compat.c Cross Memory Attach 2011-10-31 17:30:44 -07:00
gc.c KEYS: Perform RCU synchronisation on keys prior to key destruction 2012-05-11 10:56:56 +01:00
internal.h keys: add a "logon" key type 2012-01-17 22:39:40 -06:00
Kconfig KEYS: Move the key config into security/keys/Kconfig 2012-05-11 10:56:56 +01:00
key.c KEYS: Announce key type (un)registration 2012-05-11 10:56:56 +01:00
keyctl.c NFS client updates for Linux 3.4 2012-03-23 08:53:47 -07:00
keyring.c KEYS: Add missing smp_rmb() primitives to the keyring search code 2012-01-18 10:41:27 +11:00
Makefile KEYS: Reorganise keys Makefile 2012-05-11 10:56:56 +01:00
permission.c KEYS: Fix up comments in key management code 2011-01-21 14:59:30 -08:00
proc.c KEYS: Improve /proc/keys 2011-03-17 11:59:32 +11:00
process_keys.c KEYS: testing wrong bit for KEY_FLAG_REVOKED 2012-03-07 11:12:06 +11:00
request_key_auth.c KEYS: Don't return EAGAIN to keyctl_assume_authority() 2011-06-14 15:03:29 +10:00
request_key.c usermodehelper: kill umh_wait, renumber UMH_* constants 2012-03-23 16:58:41 -07:00
sysctl.c
trusted.c keys: fix trusted/encrypted keys sparse rcu_assign_pointer messages 2012-01-18 10:41:29 +11:00
trusted.h trusted-keys: rename trusted_defined files to trusted 2011-01-24 10:14:22 +11:00
user_defined.c Merge git://git.samba.org/sfrench/cifs-2.6 2012-01-23 08:59:49 -08:00