1. 11 8月, 2011 1 次提交
  2. 09 8月, 2011 1 次提交
  3. 02 8月, 2011 2 次提交
  4. 27 7月, 2011 2 次提交
  5. 24 7月, 2011 1 次提交
    • T
      VFS : mount lock scalability for internal mounts · 423e0ab0
      Tim Chen 提交于
      For a number of file systems that don't have a mount point (e.g. sockfs
      and pipefs), they are not marked as long term. Therefore in
      mntput_no_expire, all locks in vfs_mount lock are taken instead of just
      local cpu's lock to aggregate reference counts when we release
      reference to file objects.  In fact, only local lock need to have been
      taken to update ref counts as these file systems are in no danger of
      going away until we are ready to unregister them.
      
      The attached patch marks file systems using kern_mount without
      mount point as long term.  The contentions of vfs_mount lock
      is now eliminated.  Before un-registering such file system,
      kern_unmount should be called to remove the long term flag and
      make the mount point ready to be freed.
      Signed-off-by: NTim Chen <tim.c.chen@linux.intel.com>
      Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
      423e0ab0
  6. 21 7月, 2011 3 次提交
  7. 20 7月, 2011 4 次提交
  8. 19 7月, 2011 13 次提交
    • M
      evm: add evm_inode_setattr to prevent updating an invalid security.evm · 817b54aa
      Mimi Zohar 提交于
      Permit changing of security.evm only when valid, unless in fixmode.
      Reported-by: NRoberto Sassu <roberto.sassu@polito.it>
      Signed-off-by: NMimi Zohar <zohar@us.ibm.com>
      817b54aa
    • M
      evm: permit only valid security.evm xattrs to be updated · 7102ebcd
      Mimi Zohar 提交于
      In addition to requiring CAP_SYS_ADMIN permission to modify/delete
      security.evm, prohibit invalid security.evm xattrs from changing,
      unless in fixmode. This patch prevents inadvertent 'fixing' of
      security.evm to reflect offline modifications.
      
      Changelog v7:
      - rename boot paramater 'evm_mode' to 'evm'
      Reported-by: NRoberto Sassu <roberto.sassu@polito.it>
      Signed-off-by: NMimi Zohar <zohar@us.ibm.com>
      7102ebcd
    • D
      evm: replace hmac_status with evm_status · 24e0198e
      Dmitry Kasatkin 提交于
      We will use digital signatures in addtion to hmac.
      Signed-off-by: NDmitry Kasatkin <dmitry.kasatkin@nokia.com>
      Signed-off-by: NMimi Zohar <zohar@us.ibm.com>
      24e0198e
    • D
      evm: evm_verify_hmac must not return INTEGRITY_UNKNOWN · 6d38ca01
      Dmitry Kasatkin 提交于
      If EVM is not supported or enabled, evm_verify_hmac() returns
      INTEGRITY_UNKNOWN, which ima_appraise_measurement() ignores and sets
      the appraisal status based solely on the security.ima verification.
      
      evm_verify_hmac() also returns INTEGRITY_UNKNOWN for other failures, such
      as temporary failures like -ENOMEM, resulting in possible attack vectors.
      This patch changes the default return code for temporary/unexpected
      failures, like -ENOMEM, from INTEGRITY_UNKNOWN to INTEGRITY_FAIL, making
      evm_verify_hmac() fail safe.
      
      As a result, failures need to be re-evaluated in order to catch both
      temporary errors, such as the -ENOMEM, as well as errors that have been
      resolved in fix mode.
      Signed-off-by: NDmitry Kasatkin <dmitry.kasatkin@nokia.com>
      Signed-off-by: NMimi Zohar <zohar@us.ibm.com>
      6d38ca01
    • D
      evm: additional parameter to pass integrity cache entry 'iint' · 2960e6cb
      Dmitry Kasatkin 提交于
      Additional iint parameter allows to skip lookup in the cache.
      Signed-off-by: NDmitry Kasatkin <dmitry.kasatkin@nokia.com>
      Signed-off-by: NMimi Zohar <zohar@linux.vnet.ibm.com>
      2960e6cb
    • D
      evm: crypto hash replaced by shash · d46eb369
      Dmitry Kasatkin 提交于
      Using shash is more efficient, because the algorithm is allocated only
      once. Only the descriptor to store the hash state needs to be allocated
      for every operation.
      
      Changelog v6:
      - check for crypto_shash_setkey failure
      Signed-off-by: NDmitry Kasatkin <dmitry.kasatkin@nokia.com>
      Signed-off-by: NMimi Zohar <zohar@linux.vnet.ibm.com>
      d46eb369
    • M
      evm: call evm_inode_init_security from security_inode_init_security · 823eb1cc
      Mimi Zohar 提交于
      Changelog v7:
      - moved the initialization call to security_inode_init_security,
        renaming evm_inode_post_init_security to evm_inode_init_security
      - increase size of xattr array for EVM xattr
      Signed-off-by: NMimi Zohar <zohar@us.ibm.com>
      823eb1cc
    • M
      evm: add evm_inode_init_security to initialize new files · cb723180
      Mimi Zohar 提交于
      Initialize 'security.evm' for new files.
      
      Changelog v7:
      - renamed evm_inode_post_init_security to evm_inode_init_security
      - moved struct xattr definition to earlier patch
      - allocate xattr name
      Changelog v6:
      - Use 'struct evm_ima_xattr_data'
      Signed-off-by: NMimi Zohar <zohar@us.ibm.com>
      cb723180
    • M
      security: imbed evm calls in security hooks · 3e1be52d
      Mimi Zohar 提交于
      Imbed the evm calls evm_inode_setxattr(), evm_inode_post_setxattr(),
      evm_inode_removexattr() in the security hooks.  evm_inode_setxattr()
      protects security.evm xattr.  evm_inode_post_setxattr() and
      evm_inode_removexattr() updates the hmac associated with an inode.
      
      (Assumes an LSM module protects the setting/removing of xattr.)
      
      Changelog:
        - Don't define evm_verifyxattr(), unless CONFIG_INTEGRITY is enabled.
        - xattr_name is a 'const', value is 'void *'
      Signed-off-by: NMimi Zohar <zohar@us.ibm.com>
      Acked-by: NSerge Hallyn <serge.hallyn@ubuntu.com>
      3e1be52d
    • D
      evm: add support for different security.evm data types · 6be5cc52
      Dmitry Kasatkin 提交于
      EVM protects a file's security extended attributes(xattrs) against integrity
      attacks. The current patchset maintains an HMAC-sha1 value across the security
      xattrs, storing the value as the extended attribute 'security.evm'. We
      anticipate other methods for protecting the security extended attributes.
      This patch reserves the first byte of 'security.evm' as a place holder for
      the type of method.
      
      Changelog v6:
      - move evm_ima_xattr_type definition to security/integrity/integrity.h
      - defined a structure for the EVM xattr called evm_ima_xattr_data
        (based on Serge Hallyn's suggestion)
      - removed unnecessary memset
      Signed-off-by: NDmitry Kasatkin <dmitry.kasatkin@nokia.com>
      Signed-off-by: NMimi Zohar <zohar@us.ibm.com>
      Acked-by: NSerge Hallyn <serge.hallyn@canonical.com>
      6be5cc52
    • 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
    • M
      integrity: move ima inode integrity data management · f381c272
      Mimi Zohar 提交于
      Move the inode integrity data(iint) management up to the integrity directory
      in order to share the iint among the different integrity models.
      
      Changelog:
      - don't define MAX_DIGEST_SIZE
      - rename several globally visible 'ima_' prefixed functions, structs,
        locks, etc to 'integrity_'
      - replace '20' with SHA1_DIGEST_SIZE
      - reflect location change in appropriate Kconfig and Makefiles
      - remove unnecessary initialization of iint_initialized to 0
      - rebased on current ima_iint.c
      - define integrity_iint_store/lock as static
      
      There should be no other functional changes.
      Signed-off-by: NMimi Zohar <zohar@us.ibm.com>
      Acked-by: NSerge Hallyn <serge.hallyn@ubuntu.com>
      f381c272
    • M
      security: new security_inode_init_security API adds function callback · 9d8f13ba
      Mimi Zohar 提交于
      This patch changes the security_inode_init_security API by adding a
      filesystem specific callback to write security extended attributes.
      This change is in preparation for supporting the initialization of
      multiple LSM xattrs and the EVM xattr.  Initially the callback function
      walks an array of xattrs, writing each xattr separately, but could be
      optimized to write multiple xattrs at once.
      
      For existing security_inode_init_security() calls, which have not yet
      been converted to use the new callback function, such as those in
      reiserfs and ocfs2, this patch defines security_old_inode_init_security().
      Signed-off-by: NMimi Zohar <zohar@us.ibm.com>
      9d8f13ba
  9. 14 7月, 2011 1 次提交
  10. 11 7月, 2011 5 次提交
  11. 09 7月, 2011 1 次提交
  12. 08 7月, 2011 1 次提交
  13. 01 7月, 2011 1 次提交
  14. 30 6月, 2011 2 次提交
  15. 29 6月, 2011 2 次提交
    • J
      AppArmor: Fix masking of capabilities in complain mode · 25e75dff
      John Johansen 提交于
      AppArmor is masking the capabilities returned by capget against the
      capabilities mask in the profile.  This is wrong, in complain mode the
      profile has effectively all capabilities, as the profile restrictions are
      not being enforced, merely tested against to determine if an access is
      known by the profile.
      
      This can result in the wrong behavior of security conscience applications
      like sshd which examine their capability set, and change their behavior
      accordingly.  In this case because of the masked capability set being
      returned sshd fails due to DAC checks, even when the profile is in complain
      mode.
      
      Kernels affected: 2.6.36 - 3.0.
      Signed-off-by: NJohn Johansen <john.johansen@canonical.com>
      25e75dff
    • J
      AppArmor: Fix reference to rcu protected pointer outside of rcu_read_lock · 04fdc099
      John Johansen 提交于
      The pointer returned from tracehook_tracer_task() is only valid inside
      the rcu_read_lock.  However the tracer pointer obtained is being passed
      to aa_may_ptrace outside of the rcu_read_lock critical section.
      
      Mover the aa_may_ptrace test into the rcu_read_lock critical section, to
      fix this.
      
      Kernels affected: 2.6.36 - 3.0
      Reported-by: NOleg Nesterov <oleg@redhat.com>
      Cc: stable@kernel.org
      Signed-off-by: NJohn Johansen <john.johansen@canonical.com>
      04fdc099