1. 18 7月, 2018 1 次提交
  2. 19 5月, 2018 1 次提交
    • M
      EVM: Allow runtime modification of the set of verified xattrs · fa516b66
      Matthew Garrett 提交于
      Sites may wish to provide additional metadata alongside files in order
      to make more fine-grained security decisions[1]. The security of this is
      enhanced if this metadata is protected, something that EVM makes
      possible. However, the kernel cannot know about the set of extended
      attributes that local admins may wish to protect, and hardcoding this
      policy in the kernel makes it difficult to change over time and less
      convenient for distributions to enable.
      
      This patch adds a new /sys/kernel/security/integrity/evm/evm_xattrs node,
      which can be read to obtain the current set of EVM-protected extended
      attributes or written to in order to add new entries. Extending this list
      will not change the validity of any existing signatures provided that the
      file in question does not have any of the additional extended attributes -
      missing xattrs are skipped when calculating the EVM hash.
      
      [1] For instance, a package manager could install information about the
      package uploader in an additional extended attribute. Local LSM policy
      could then be associated with that extended attribute in order to
      restrict the privileges available to packages from less trusted
      uploaders.
      Signed-off-by: NMatthew Garrett <mjg59@google.com>
      Reviewed-by: NJames Morris <james.morris@microsoft.com>
      Signed-off-by: NMimi Zohar <zohar@linux.vnet.ibm.com>
      fa516b66
  3. 15 12月, 2015 2 次提交
  4. 07 1月, 2015 1 次提交
  5. 09 9月, 2014 1 次提交
    • D
      integrity: base integrity subsystem kconfig options on integrity · 7ef84e65
      Dmitry Kasatkin 提交于
      The integrity subsystem has lots of options and takes more than
      half of the security menu.  This patch consolidates the options
      under "integrity", which are hidden if not enabled.  This change
      does not affect existing configurations.  Re-configuration is not
      needed.
      
      Changes v4:
      - no need to change "integrity subsystem" to menuconfig as
      options are hidden, when not enabled. (Mimi)
      - add INTEGRITY Kconfig help description
      
      Changes v3:
      - dependency to INTEGRITY removed when behind 'if INTEGRITY'
      
      Changes v2:
      - previous patch moved integrity out of the 'security' menu.
        This version keeps integrity as a security option (Mimi).
      Signed-off-by: NDmitry Kasatkin <d.kasatkin@samsung.com>
      Signed-off-by: NMimi Zohar <zohar@linux.vnet.ibm.com>
      7ef84e65
  6. 13 6月, 2014 2 次提交
  7. 08 3月, 2014 2 次提交
  8. 06 2月, 2013 1 次提交
    • D
      evm: add file system uuid to EVM hmac · 74de6684
      Dmitry Kasatkin 提交于
      EVM uses the same key for all file systems to calculate the HMAC,
      making it possible to paste inodes from one file system on to another
      one, without EVM being able to detect it.  To prevent such an attack,
      it is necessary to make the EVM HMAC file system specific.
      
      This patch uses the file system UUID, a file system unique identifier,
      to bind the EVM HMAC to the file system. The value inode->i_sb->s_uuid
      is used for the HMAC hash calculation, instead of using it for deriving
      the file system specific key.  Initializing the key for every inode HMAC
      calculation is a bit more expensive operation than adding the uuid to
      the HMAC hash.
      
      Changing the HMAC calculation method or adding additional info to the
      calculation, requires existing EVM labeled file systems to be relabeled.
      This patch adds a Kconfig HMAC version option for backwards compatability.
      
      Changelog v1:
      - squash "hmac version setting"
      Changelog v0:
      - add missing Kconfig depends (Mimi)
      Signed-off-by: NDmitry Kasatkin <dmitry.kasatkin@intel.com>
      Signed-off-by: NMimi Zohar <zohar@linux.vnet.ibm.com>
      74de6684
  9. 15 9月, 2011 1 次提交
    • M
      evm: remove TCG_TPM dependency · 1d714057
      Mimi Zohar 提交于
      All tristates selected by EVM(boolean) are forced to be builtin, except
      in the TCG_TPM(tristate) dependency case. Arnaud Lacombe summarizes the
      Kconfig bug as, "So it would seem direct dependency state influence the
      state of reverse dependencies.."  For a detailed explanation, refer to
      Arnaud Lacombe's posting http://lkml.org/lkml/2011/8/23/498.
      
      With the "encrypted-keys: remove trusted-keys dependency" patch, EVM
      can now be built without a dependency on TCG_TPM.  The trusted-keys
      dependency requires trusted-keys to either be builtin or not selected.
      This dependency will prevent the boolean/tristate mismatch from
      occuring.
      
      Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>,
                   Randy Dunlap <rdunlap@xenotimenet>
      Signed-off-by: NMimi Zohar <zohar@us.ibm.com>
      1d714057
  10. 18 8月, 2011 1 次提交
    • M
      evm: add Kconfig TCG_TPM dependency · dbe5ad17
      Mimi Zohar 提交于
      Although the EVM encrypted-key should be encrypted/decrypted using a
      trusted-key, a user-defined key could be used instead. When using a user-
      defined key, a TCG_TPM dependency should not be required.  Unfortunately,
      the encrypted-key code needs to be refactored a bit in order to remove
      this dependency.
      
      This patch adds the TCG_TPM dependency.
      
      Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>,
      	     Randy Dunlap <rdunlap@xenotimenet>
      Signed-off-by: NMimi Zohar <zohar@us.ibm.com>
      Signed-off-by: NJames Morris <jmorris@namei.org>
      dbe5ad17
  11. 09 8月, 2011 1 次提交
  12. 19 7月, 2011 1 次提交
    • M
      evm: re-release · 66dbc325
      Mimi Zohar 提交于
      EVM protects a file's security extended attributes(xattrs) against integrity
      attacks.  This patchset provides the framework and an initial method.  The
      initial method maintains an HMAC-sha1 value across the security extended
      attributes, storing the HMAC value as the extended attribute 'security.evm'.
      Other methods of validating the integrity of a file's metadata will be posted
      separately (eg. EVM-digital-signatures).
      
      While this patchset does authenticate the security xattrs, and
      cryptographically binds them to the inode, coming extensions will bind other
      directory and inode metadata for more complete protection.  To help simplify
      the review and upstreaming process, each extension will be posted separately
      (eg. IMA-appraisal, IMA-appraisal-directory).  For a general overview of the
      proposed Linux integrity subsystem, refer to Dave Safford's whitepaper:
      http://downloads.sf.net/project/linux-ima/linux-ima/Integrity_overview.pdf.
      
      EVM depends on the Kernel Key Retention System to provide it with a
      trusted/encrypted key for the HMAC-sha1 operation. The key is loaded onto the
      root's keyring using keyctl.  Until EVM receives notification that the key has
      been successfully loaded onto the keyring (echo 1 > <securityfs>/evm), EVM can
      not create or validate the 'security.evm' xattr, but returns INTEGRITY_UNKNOWN.
      Loading the key and signaling EVM should be done as early as possible. Normally
      this is done in the initramfs, which has already been measured as part of the
      trusted boot.  For more information on creating and loading existing
      trusted/encrypted keys, refer to Documentation/keys-trusted-encrypted.txt.  A
      sample dracut patch, which loads the trusted/encrypted key and enables EVM, is
      available from http://linux-ima.sourceforge.net/#EVM.
      
      Based on the LSMs enabled, the set of EVM protected security xattrs is defined
      at compile.  EVM adds the following three calls to the existing security hooks:
      evm_inode_setxattr(), evm_inode_post_setxattr(), and evm_inode_removexattr.  To
      initialize and update the 'security.evm' extended attribute, EVM defines three
      calls: evm_inode_post_init(), evm_inode_post_setattr() and
      evm_inode_post_removexattr() hooks.  To verify the integrity of a security
      xattr, EVM exports evm_verifyxattr().
      
      Changelog v7:
      - Fixed URL in EVM ABI documentation
      
      Changelog v6: (based on Serge Hallyn's review)
      - fix URL in patch description
      - remove evm_hmac_size definition
      - use SHA1_DIGEST_SIZE (removed both MAX_DIGEST_SIZE and evm_hmac_size)
      - moved linux include before other includes
      - test for crypto_hash_setkey failure
      - fail earlier for invalid key
      - clear entire encrypted key, even on failure
      - check xattr name length before comparing xattr names
      
      Changelog:
      - locking based on i_mutex, remove evm_mutex
      - using trusted/encrypted keys for storing the EVM key used in the HMAC-sha1
        operation.
      - replaced crypto hash with shash (Dmitry Kasatkin)
      - support for additional methods of verifying the security xattrs
        (Dmitry Kasatkin)
      - iint not allocated for all regular files, but only for those appraised
      - Use cap_sys_admin in lieu of cap_mac_admin
      - Use __vfs_setxattr_noperm(), without permission checks, from EVM
      Signed-off-by: NMimi Zohar <zohar@us.ibm.com>
      Acked-by: NSerge Hallyn <serge.hallyn@canonical.com>
      66dbc325