1. 14 Jan, 2016 1 commit
  2. 10 Jan, 2016 1 commit
  3. 08 Jan, 2016 1 commit
  4. 07 Jan, 2016 1 commit
  5. 03 Jan, 2016 1 commit
  6. 26 Dec, 2015 3 commits
  7. 24 Dec, 2015 10 commits
  8. 20 Dec, 2015 10 commits
  9. 17 Dec, 2015 1 commit
  10. 15 Dec, 2015 11 commits
    • Paul Gortmaker's avatar
      security/integrity: make ima/ima_mok.c explicitly non-modular · 92cc9166
      Paul Gortmaker authored
      The Kconfig currently controlling compilation of this code is:
      
      ima/Kconfig:config IMA_MOK_KEYRING
      ima/Kconfig: bool "Create IMA machine owner keys (MOK) and blacklist keyrings"
      
      ...meaning that it currently is not being built as a module by anyone.
      
      Lets remove the couple of traces of modularity so that when reading the
      driver there is no doubt it really is builtin-only.
      
      Since module_init translates to device_initcall in the non-modular
      case, the init ordering remains unchanged with this commit.
      
      Cc: Mimi Zohar <zohar@linux.vnet.ibm.com>
      Cc: Dmitry Kasatkin <dmitry.kasatkin@gmail.com>
      Cc: James Morris <james.l.morris@oracle.com>
      Cc: "Serge E. Hallyn" <serge@hallyn.com>
      Cc: linux-ima-devel@lists.sourceforge.net
      Cc: linux-ima-user@lists.sourceforge.net
      Cc: linux-security-module@vger.kernel.org
      Signed-off-by: default avatarPaul Gortmaker <paul.gortmaker@windriver.com>
      Signed-off-by: default avatarMimi Zohar <zohar@linux.vnet.ibm.com>
      92cc9166
    • Mimi Zohar's avatar
      ima: update appraise flags after policy update completes · 6ad6afa1
      Mimi Zohar authored
      While creating a temporary list of new rules, the ima_appraise flag is
      updated, but not reverted on failure to append the new rules to the
      existing policy.  This patch defines temp_ima_appraise flag.  Only when
      the new rules are appended to the policy is the flag updated.
      Signed-off-by: default avatarMimi Zohar <zohar@linux.vnet.ibm.com>
      Acked-by: default avatarPetko Manolov <petkan@mip-labs.com>
      6ad6afa1
    • Mimi Zohar's avatar
      IMA: prevent keys on the .ima_blacklist from being removed · 501f1bde
      Mimi Zohar authored
      Set the KEY_FLAGS_KEEP on the .ima_blacklist to prevent userspace
      from removing keys from the keyring.
      Signed-off-by: default avatarMimi Zohar <zohar@linux.vnet.ibm.com>
      501f1bde
    • Mimi Zohar's avatar
      KEYS: prevent keys from being removed from specified keyrings · d3600bcf
      Mimi Zohar authored
      Userspace should not be allowed to remove keys from certain keyrings
      (eg. blacklist), though the keys themselves can expire.
      
      This patch defines a new key flag named KEY_FLAG_KEEP to prevent
      userspace from being able to unlink, revoke, invalidate or timed
      out a key on a keyring.  When this flag is set on the keyring, all
      keys subsequently added are flagged.
      
      In addition, when this flag is set, the keyring itself can not be
      cleared.
      Signed-off-by: default avatarMimi Zohar <zohar@linux.vnet.ibm.com>
      Cc: David Howells <dhowells@redhat.com>
      d3600bcf
    • Petko Manolov's avatar
      IMA: allow reading back the current IMA policy · 80eae209
      Petko Manolov authored
      It is often useful to be able to read back the IMA policy.  It is
      even more important after introducing CONFIG_IMA_WRITE_POLICY.
      This option allows the root user to see the current policy rules.
      Signed-off-by: default avatarZbigniew Jasinski <z.jasinski@samsung.com>
      Signed-off-by: default avatarPetko Manolov <petkan@mip-labs.com>
      Signed-off-by: default avatarMimi Zohar <zohar@linux.vnet.ibm.com>
      80eae209
    • Petko Manolov's avatar
      IMA: create machine owner and blacklist keyrings · 41c89b64
      Petko Manolov authored
      This option creates IMA MOK and blacklist keyrings.  IMA MOK is an
      intermediate keyring that sits between .system and .ima keyrings,
      effectively forming a simple CA hierarchy.  To successfully import a key
      into .ima_mok it must be signed by a key which CA is in .system keyring.
      On turn any key that needs to go in .ima keyring must be signed by CA in
      either .system or .ima_mok keyrings. IMA MOK is empty at kernel boot.
      
      IMA blacklist keyring contains all revoked IMA keys.  It is consulted
      before any other keyring.  If the search is successful the requested
      operation is rejected and error is returned to the caller.
      Signed-off-by: default avatarPetko Manolov <petkan@mip-labs.com>
      Signed-off-by: default avatarMimi Zohar <zohar@linux.vnet.ibm.com>
      41c89b64
    • Petko Manolov's avatar
      IMA: policy can now be updated multiple times · 38d859f9
      Petko Manolov authored
      The new rules get appended to the original policy, forming a queue.
      The new rules are first added to a temporary list, which on error
      get released without disturbing the normal IMA operations.  On
      success both lists (the current policy and the new rules) are spliced.
      
      IMA policy reads are many orders of magnitude more numerous compared to
      writes, the match code is RCU protected.  The updater side also does
      list splice in RCU manner.
      Signed-off-by: default avatarPetko Manolov <petkan@mip-labs.com>
      Signed-off-by: default avatarMimi Zohar <zohar@linux.vnet.ibm.com>
      38d859f9
    • Arnd Bergmann's avatar
      evm: EVM_LOAD_X509 depends on EVM · 05d3884b
      Arnd Bergmann authored
      The newly added EVM_LOAD_X509 code can be configured even if
      CONFIG_EVM is disabled, but that causes a link error:
      
      security/built-in.o: In function `integrity_load_keys':
      digsig_asymmetric.c:(.init.text+0x400): undefined reference to `evm_load_x509'
      
      This adds a Kconfig dependency to ensure it is only enabled when
      CONFIG_EVM is set as well.
      Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
      Fixes: 2ce523eb ("evm: load x509 certificate from the kernel")
      Signed-off-by: default avatarMimi Zohar <zohar@linux.vnet.ibm.com>
      05d3884b
    • Dmitry Kasatkin's avatar
      evm: reset EVM status when file attributes change · 523b74b1
      Dmitry Kasatkin authored
      The EVM verification status is cached in iint->evm_status and if it
      was successful, never re-verified again when IMA passes the 'iint' to
      evm_verifyxattr().
      
      When file attributes or extended attributes change, we may wish to
      re-verify EVM integrity as well.  For example, after setting a digital
      signature we may need to re-verify the signature and update the
      iint->flags that there is an EVM signature.
      
      This patch enables that by resetting evm_status to INTEGRITY_UKNOWN
      state.
      
      Changes in v2:
      * Flag setting moved to EVM layer
      Signed-off-by: default avatarDmitry Kasatkin <dmitry.kasatkin@huawei.com>
      Signed-off-by: default avatarMimi Zohar <zohar@linux.vnet.ibm.com>
      523b74b1
    • Dmitry Kasatkin's avatar
      evm: provide a function to set the EVM key from the kernel · 76266763
      Dmitry Kasatkin authored
      A crypto HW kernel module can possibly initialize the EVM key from the
      kernel __init code to enable EVM before calling the 'init' process.
      This patch provides a function evm_set_key() to set the EVM key
      directly without using the KEY subsystem.
      
      Changes in v4:
      * kernel-doc style for evm_set_key
      
      Changes in v3:
      * error reporting moved to evm_set_key
      * EVM_INIT_HMAC moved to evm_set_key
      * added bitop to prevent key setting race
      
      Changes in v2:
      * use size_t for key size instead of signed int
      * provide EVM_MAX_KEY_SIZE macro in <linux/evm.h>
      * provide EVM_MIN_KEY_SIZE macro in <linux/evm.h>
      Signed-off-by: default avatarDmitry Kasatkin <dmitry.kasatkin@huawei.com>
      Signed-off-by: default avatarMimi Zohar <zohar@linux.vnet.ibm.com>
      76266763
    • Dmitry Kasatkin's avatar
      evm: enable EVM when X509 certificate is loaded · 26ddabfe
      Dmitry Kasatkin authored
      In order to enable EVM before starting the 'init' process,
      evm_initialized needs to be non-zero.  Previously non-zero indicated
      that the HMAC key was loaded.  When EVM loads the X509 before calling
      'init', with this patch it is now possible to enable EVM to start
      signature based verification.
      
      This patch defines bits to enable EVM if a key of any type is loaded.
      
      Changes in v3:
      * print error message if key is not set
      
      Changes in v2:
      * EVM_STATE_KEY_SET replaced by EVM_INIT_HMAC
      * EVM_STATE_X509_SET replaced by EVM_INIT_X509
      Signed-off-by: default avatarDmitry Kasatkin <dmitry.kasatkin@huawei.com>
      Signed-off-by: default avatarMimi Zohar <zohar@linux.vnet.ibm.com>
      26ddabfe