|
|
Log in / Subscribe / Register

Make keyring link restrictions accessible from userspace

From:  Mat Martineau <mathew.j.martineau-AT-linux.intel.com>
To:  keyrings-AT-vger.kernel.org, linux-security-module-AT-vger.kernel.org, dhowells-AT-redhat.com
Subject:  [PATCH v9 00/11] Make keyring link restrictions accessible from userspace
Date:  Wed, 16 Nov 2016 14:37:55 -0800
Message-ID:  <20161116223806.14601-1-mathew.j.martineau@linux.intel.com>
Cc:  Mat Martineau <mathew.j.martineau-AT-linux.intel.com>, zohar-AT-linux.vnet.ibm.com

Keyrings recently acquired the ability to validate keys before they are
linked, but keyrings created from userspace with the add_key syscall
could not configure keyrings to do so. This patch set enables creation
of restricted keyrings from userspace.

These patches apply to linux-fs/keys-misc and are also available here:

    https://git.kernel.org/cgit/linux/kernel/git/martineau/li...

v9: Rebased on linux-fs/keys-misc (v4.9-rc5)

v8: Add option to look for signing keys within the destination keyring.
Fix a consistency issue with keyring locking and restriction checks.

v7: Rework key restriction payload syntax. Move key-type-specific payload
parsing to the key-type. Attach more restriction information to keyrings
(restriction function, data, and data free) so future restrictions are not
limited to storing a key ID to use for key validation. Validate key before
using it to verify another key. Modify key type locking model to allow key
type lookup during keyring creation.

v6: Return error if only restrict_key is supplied, address misc. review
comments.

v5: Fixed signature bypass problem in patch 3/6

v4: Added userspace restriction options based on builtin keyrings.
restrict_link_by_signature implementation is no longer modified. Split
up v3's patch 2/5 to isolate the change to key.h.

v3: Updated commit message for patch 2/5 (restrict_link_by_signature_indirect)

v2: Payload is now preparsed

Mat Martineau (11):
  KEYS: Add a rwsem to each key type
  KEYS: Use a typedef for restrict_link function pointers
  KEYS: Split role of the keyring pointer for keyring restrict functions
  KEYS: Add a key restriction struct
  KEYS: Use structure to capture key restriction function and data
  KEYS: Add an optional lookup_restrict hook to key_type
  KEYS: Parse keyring payload for restrict options
  KEYS: Add a lookup_restrict function for the asymmetric key type
  KEYS: Restrict key linkage using a specific keychain
  KEYS: Consistent ordering for __key_link_begin and restrict check
  KEYS: Keyring restrict method with chaining

 Documentation/crypto/asymmetric-keys.txt |  53 ++++++++++
 Documentation/security/keys.txt          |  28 +++--
 certs/system_keyring.c                   |  39 +++++--
 crypto/asymmetric_keys/asymmetric_type.c |  98 ++++++++++++++++--
 crypto/asymmetric_keys/restrict.c        | 170 ++++++++++++++++++++++++++++++-
 include/crypto/public_key.h              |  13 ++-
 include/keys/system_keyring.h            |   6 +-
 include/linux/key-type.h                 |   9 ++
 include/linux/key.h                      |  28 +++--
 security/keys/gc.c                       |   2 +-
 security/keys/key.c                      |  78 ++++++++------
 security/keys/keyring.c                  | 114 +++++++++++++++++++--
 12 files changed, 557 insertions(+), 81 deletions(-)

-- 
2.10.2

--
To unsubscribe from this list: send the line "unsubscribe linux-security-module" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html



Copyright © 2016, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds