All of lore.kernel.org
 help / color / mirror / Atom feed
* [RFC][PATCH 00/10] Associative array & Massive expansion of keyring capacity
@ 2013-07-17 20:43 David Howells
  2013-07-17 20:43 ` [PATCH 01/10] KEYS: Skip key state checks when checking for possession David Howells
                   ` (9 more replies)
  0 siblings, 10 replies; 16+ messages in thread
From: David Howells @ 2013-07-17 20:43 UTC (permalink / raw)
  To: keyrings; +Cc: linux-security-module, linux-nfs, linux-kernel


Here's a set of patches that do two main things:

 (1) Provide a general purpose associative array implementation.

 (2) Use the associative array implementation to provide key pointer storage
     for keyrings thereby massively increasing capacity.

There are numerous smaller patches also that are split out of (2) to make the
patch in (2) smaller, plus a fix patch that didn't get taken into the last
merge window.

The patches can also be found at:

	http://git.kernel.org/cgit/linux/kernel/git/dhowells/linux-fs.git/log/?h=keys-devel


The impetus for these is that the NFS ID mapper uses keyrings to store name to
ID mappings, but is running up against the limitation imposed by the flat
array currently used by the keyring.

The associative array implementation does all the work.  To quickly summarise
its capabilities: no capacity limit; objects don't need to be modified to go
in it (no list_head/rb_node equivalent needed); objects need a unique index
key of arbitrary length; objects can be anything; modifications are generally
RCU-safe; the contents can be iterated over and it can directly walk to an
object in O(log(N)-ish) time given the key; and lastly, there are several
features to reduce the memory footprint (node sharing and shortcuts).
Documentation is included in the patch.

Note that the associative array implementation was developed in userspace and
has been thoroughly valground and tested inserting new objects whilst
iterating over 2,000,000 objects amongst other things.

The keyutils testsuite has been run successfully against a kernel with these
patches applied, though the testsuite did need some tweaks: (a) previously
keys added to a keyring with no removals appeared to be ordered and (b) some
of the errors have changed.

David
---
David Howells (10):
      KEYS: Skip key state checks when checking for possession
      Add a generic associative array implementation.
      KEYS: Use bool in make_key_ref() and is_key_possessed()
      KEYS: key_is_dead() should take a const key pointer argument
      KEYS: Consolidate the concept of an 'index key' for key access
      KEYS: Introduce a search context structure
      KEYS: Search for auth-key by name rather than targt key ID
      KEYS: Define a __key_get() wrapper to use rather than atomic_inc()
      KEYS: Drop the permissions argument from __keyring_search_one()
      KEYS: Expand the capacity of a keyring


 Documentation/assoc_array.txt    |  583 +++++++++++++
 Documentation/security/keys.txt  |   20 
 include/keys/keyring-type.h      |   17 
 include/linux/assoc_array.h      |   94 ++
 include/linux/assoc_array_priv.h |  159 +++
 include/linux/key-type.h         |    5 
 include/linux/key.h              |   48 +
 lib/Kconfig                      |   14 
 lib/Makefile                     |    1 
 lib/assoc_array.c                | 1734 ++++++++++++++++++++++++++++++++++++++
 security/keys/Kconfig            |    1 
 security/keys/gc.c               |   30 -
 security/keys/internal.h         |   65 +
 security/keys/key.c              |   91 +-
 security/keys/keyring.c          | 1447 ++++++++++++++++----------------
 security/keys/proc.c             |   17 
 security/keys/process_keys.c     |  131 +--
 security/keys/request_key.c      |   56 +
 security/keys/request_key_auth.c |   31 -
 security/keys/user_defined.c     |   18 
 20 files changed, 3596 insertions(+), 966 deletions(-)
 create mode 100644 Documentation/assoc_array.txt
 create mode 100644 include/linux/assoc_array.h
 create mode 100644 include/linux/assoc_array_priv.h
 create mode 100644 lib/assoc_array.c


^ permalink raw reply	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2013-07-19 14:37 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-07-17 20:43 [RFC][PATCH 00/10] Associative array & Massive expansion of keyring capacity David Howells
2013-07-17 20:43 ` [PATCH 01/10] KEYS: Skip key state checks when checking for possession David Howells
2013-07-17 20:43 ` [PATCH 02/10] Add a generic associative array implementation David Howells
2013-07-17 20:53   ` Joe Perches
2013-07-17 21:01   ` David Howells
2013-07-18 13:18   ` [PATCH] Assoc_array: Drop leaf-type concept David Howells
2013-07-18 21:31     ` George Spelvin
2013-07-19 14:37       ` David Howells
2013-07-17 20:43 ` [PATCH 03/10] KEYS: Use bool in make_key_ref() and is_key_possessed() David Howells
2013-07-17 20:43 ` [PATCH 04/10] KEYS: key_is_dead() should take a const key pointer argument David Howells
2013-07-17 20:43 ` [PATCH 05/10] KEYS: Consolidate the concept of an 'index key' for key access David Howells
2013-07-17 20:44 ` [PATCH 06/10] KEYS: Introduce a search context structure David Howells
2013-07-17 20:44 ` [PATCH 07/10] KEYS: Search for auth-key by name rather than targt key ID David Howells
2013-07-17 20:44 ` [PATCH 08/10] KEYS: Define a __key_get() wrapper to use rather than atomic_inc() David Howells
2013-07-17 20:44 ` [PATCH 09/10] KEYS: Drop the permissions argument from __keyring_search_one() David Howells
2013-07-17 20:44 ` [PATCH 10/10] KEYS: Expand the capacity of a keyring David Howells

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.