1. 28 9月, 2021 1 次提交
  2. 17 7月, 2021 1 次提交
  3. 14 4月, 2021 3 次提交
  4. 07 8月, 2020 1 次提交
  5. 21 7月, 2020 2 次提交
    • B
      ima: move APPRAISE_BOOTPARAM dependency on ARCH_POLICY to runtime · 311aa6aa
      Bruno Meneguele 提交于
      The IMA_APPRAISE_BOOTPARAM config allows enabling different "ima_appraise="
      modes - log, fix, enforce - at run time, but not when IMA architecture
      specific policies are enabled.  This prevents properly labeling the
      filesystem on systems where secure boot is supported, but not enabled on the
      platform.  Only when secure boot is actually enabled should these IMA
      appraise modes be disabled.
      
      This patch removes the compile time dependency and makes it a runtime
      decision, based on the secure boot state of that platform.
      
      Test results as follows:
      
      -> x86-64 with secure boot enabled
      
      [    0.015637] Kernel command line: <...> ima_policy=appraise_tcb ima_appraise=fix
      [    0.015668] ima: Secure boot enabled: ignoring ima_appraise=fix boot parameter option
      
      -> powerpc with secure boot disabled
      
      [    0.000000] Kernel command line: <...> ima_policy=appraise_tcb ima_appraise=fix
      [    0.000000] Secure boot mode disabled
      
      -> Running the system without secure boot and with both options set:
      
      CONFIG_IMA_APPRAISE_BOOTPARAM=y
      CONFIG_IMA_ARCH_POLICY=y
      
      Audit prompts "missing-hash" but still allow execution and, consequently,
      filesystem labeling:
      
      type=INTEGRITY_DATA msg=audit(07/09/2020 12:30:27.778:1691) : pid=4976
      uid=root auid=root ses=2
      subj=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023 op=appraise_data
      cause=missing-hash comm=bash name=/usr/bin/evmctl dev="dm-0" ino=493150
      res=no
      
      Cc: stable@vger.kernel.org
      Fixes: d958083a ("x86/ima: define arch_get_ima_policy() for x86")
      Signed-off-by: NBruno Meneguele <bmeneg@redhat.com>
      Cc: stable@vger.kernel.org # 5.0
      Signed-off-by: NMimi Zohar <zohar@linux.ibm.com>
      311aa6aa
    • T
      ima: AppArmor satisfies the audit rule requirements · 1768215a
      Tyler Hicks 提交于
      AppArmor meets all the requirements for IMA in terms of audit rules
      since commit e79c26d0 ("apparmor: Add support for audit rule
      filtering"). Update IMA's Kconfig section for CONFIG_IMA_LSM_RULES to
      reflect this.
      
      Fixes: e79c26d0 ("apparmor: Add support for audit rule filtering")
      Signed-off-by: NTyler Hicks <tyhicks@linux.microsoft.com>
      Signed-off-by: NMimi Zohar <zohar@linux.ibm.com>
      1768215a
  6. 12 3月, 2020 1 次提交
  7. 18 2月, 2020 1 次提交
  8. 23 1月, 2020 1 次提交
  9. 10 1月, 2020 1 次提交
  10. 20 8月, 2019 1 次提交
  11. 06 8月, 2019 2 次提交
  12. 14 6月, 2019 1 次提交
    • N
      x86/ima: fix the Kconfig dependency for IMA_ARCH_POLICY · 9e1e5d43
      Nayna Jain 提交于
      If enabled, ima arch specific policies always adds the measurements rules,
      this makes it dependent on CONFIG_IMA. CONFIG_IMA_APPRAISE implicitly takes
      care of this, however it is needed explicitly for CONFIG_KEXEC_VERIFY_SIG.
      
      This patch adds the CONFIG_IMA dependency in combination with
      CONFIG_KEXEC_VERIFY_SIG for CONFIG_IMA_ARCH_POLICY
      
      Fixes: d958083a (x86/ima: define arch_get_ima_policy() for x86)
      Signed-off-by: NNayna Jain <nayna@linux.ibm.com>
      Cc: Eric Biederman <ebiederm@xmission.com>
      Cc: Dave Young <dyoung@redhat.com>
      Signed-off-by: NMimi Zohar <zohar@linux.ibm.com>
      9e1e5d43
  13. 21 5月, 2019 1 次提交
  14. 11 12月, 2018 1 次提交
    • E
      x86/ima: define arch_get_ima_policy() for x86 · d958083a
      Eric Richter 提交于
      On x86, there are two methods of verifying a kexec'ed kernel image
      signature being loaded via the kexec_file_load syscall - an architecture
      specific implementaton or a IMA KEXEC_KERNEL_CHECK appraisal rule. Neither
      of these methods verify the kexec'ed kernel image signature being loaded
      via the kexec_load syscall.
      
      Secure boot enabled systems require kexec images to be signed. Therefore,
      this patch loads an IMA KEXEC_KERNEL_CHECK policy rule on secure boot
      enabled systems not configured with CONFIG_KEXEC_VERIFY_SIG enabled.
      
      When IMA_APPRAISE_BOOTPARAM is configured, different IMA appraise modes
      (eg. fix, log) can be specified on the boot command line, allowing unsigned
      or invalidly signed kernel images to be kexec'ed. This patch permits
      enabling IMA_APPRAISE_BOOTPARAM or IMA_ARCH_POLICY, but not both.
      Signed-off-by: NEric Richter <erichte@linux.ibm.com>
      Signed-off-by: NNayna Jain <nayna@linux.ibm.com>
      Cc: David Howells <dhowells@redhat.com>
      Cc: Eric Biederman <ebiederm@xmission.com>
      Cc: Peter Jones <pjones@redhat.com>
      Cc: Vivek Goyal <vgoyal@redhat.com>
      Cc: Dave Young <dyoung@redhat.com>
      Signed-off-by: NMimi Zohar <zohar@linux.ibm.com>
      d958083a
  15. 18 7月, 2018 1 次提交
  16. 17 7月, 2018 1 次提交
  17. 25 3月, 2018 1 次提交
  18. 22 6月, 2017 2 次提交
  19. 21 12月, 2016 1 次提交
  20. 12 4月, 2016 1 次提交
    • D
      IMA: Use the the system trusted keyrings instead of .ima_mok · 56104cf2
      David Howells 提交于
      Add a config option (IMA_KEYRINGS_PERMIT_SIGNED_BY_BUILTIN_OR_SECONDARY)
      that, when enabled, allows keys to be added to the IMA keyrings by
      userspace - with the restriction that each must be signed by a key in the
      system trusted keyrings.
      
      EPERM will be returned if this option is disabled, ENOKEY will be returned if
      no authoritative key can be found and EKEYREJECTED will be returned if the
      signature doesn't match.  Other errors such as ENOPKG may also be returned.
      
      If this new option is enabled, the builtin system keyring is searched, as is
      the secondary system keyring if that is also enabled.  Intermediate keys
      between the builtin system keyring and the key being added can be added to
      the secondary keyring (which replaces .ima_mok) to form a trust chain -
      provided they are also validly signed by a key in one of the trusted keyrings.
      
      The .ima_mok keyring is then removed and the IMA blacklist keyring gets its
      own config option (IMA_BLACKLIST_KEYRING).
      Signed-off-by: NDavid Howells <dhowells@redhat.com>
      Signed-off-by: NMimi Zohar <zohar@linux.vnet.ibm.com>
      56104cf2
  21. 15 12月, 2015 3 次提交
  22. 24 11月, 2015 1 次提交
    • D
      integrity: define '.evm' as a builtin 'trusted' keyring · f4dc3778
      Dmitry Kasatkin 提交于
      Require all keys added to the EVM keyring be signed by an
      existing trusted key on the system trusted keyring.
      
      This patch also switches IMA to use integrity_init_keyring().
      
      Changes in v3:
      * Added 'init_keyring' config based variable to skip initializing
        keyring instead of using  __integrity_init_keyring() wrapper.
      * Added dependency back to CONFIG_IMA_TRUSTED_KEYRING
      
      Changes in v2:
      * Replace CONFIG_EVM_TRUSTED_KEYRING with IMA and EVM common
        CONFIG_INTEGRITY_TRUSTED_KEYRING configuration option
      * Deprecate CONFIG_IMA_TRUSTED_KEYRING but keep it for config
        file compatibility. (Mimi Zohar)
      Signed-off-by: NDmitry Kasatkin <dmitry.kasatkin@huawei.com>
      Signed-off-by: NMimi Zohar <zohar@linux.vnet.ibm.com>
      f4dc3778
  23. 02 2月, 2015 1 次提交
  24. 07 12月, 2014 1 次提交
  25. 18 11月, 2014 2 次提交
    • D
      ima: require signature based appraisal · c57782c1
      Dmitry Kasatkin 提交于
      This patch provides CONFIG_IMA_APPRAISE_SIGNED_INIT kernel configuration
      option to force IMA appraisal using signatures. This is useful, when EVM
      key is not initialized yet and we want securely initialize integrity or
      any other functionality.
      
      It forces embedded policy to require signature. Signed initialization
      script can initialize EVM key, update the IMA policy and change further
      requirement of everything to be signed.
      
      Changes in v3:
      * kernel parameter fixed to configuration option in the patch description
      
      Changes in v2:
      * policy change of this patch separated from the key loading patch
      Signed-off-by: NDmitry Kasatkin <d.kasatkin@samsung.com>
      Signed-off-by: NMimi Zohar <zohar@linux.vnet.ibm.com>
      c57782c1
    • D
      ima: load x509 certificate from the kernel · fd5f4e90
      Dmitry Kasatkin 提交于
      Define configuration option to load X509 certificate into the
      IMA trusted kernel keyring. It implements ima_load_x509() hook
      to load X509 certificate into the .ima trusted kernel keyring
      from the root filesystem.
      
      Changes in v3:
      * use ima_policy_flag in ima_get_action()
        ima_load_x509 temporarily clears ima_policy_flag to disable
        appraisal to load key. Use it to skip appraisal rules.
      * Key directory path changed to /etc/keys (Mimi)
      * Expand IMA_LOAD_X509 Kconfig help
      
      Changes in v2:
      * added '__init'
      * use ima_policy_flag to disable appraisal to load keys
      Signed-off-by: NDmitry Kasatkin <d.kasatkin@samsung.com>
      Signed-off-by: NMimi Zohar <zohar@linux.vnet.ibm.com>
      fd5f4e90
  26. 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
  27. 17 7月, 2014 1 次提交
    • M
      ima: define '.ima' as a builtin 'trusted' keyring · 7d2ce232
      Mimi Zohar 提交于
      Require all keys added to the IMA keyring be signed by an
      existing trusted key on the system trusted keyring.
      
      Changelog v6:
      - remove ifdef CONFIG_IMA_TRUSTED_KEYRING in C code - Dmitry
      - update Kconfig dependency and help
      - select KEYS_DEBUG_PROC_KEYS - Dmitry
      
      Changelog v5:
      - Move integrity_init_keyring() to init_ima() - Dmitry
      - reset keyring[id] on failure - Dmitry
      
      Changelog v1:
      - don't link IMA trusted keyring to user keyring
      
      Changelog:
      - define stub integrity_init_keyring() function (reported-by Fengguang Wu)
      - differentiate between regular and trusted keyring names.
      - replace printk with pr_info (D. Kasatkin)
      - only make the IMA keyring a trusted keyring (reported-by D. Kastatkin)
      - define stub integrity_init_keyring() definition based on
        CONFIG_INTEGRITY_SIGNATURE, not CONFIG_INTEGRITY_ASYMMETRIC_KEYS.
        (reported-by Jim Davis)
      Signed-off-by: NMimi Zohar <zohar@linux.vnet.ibm.com>
      Signed-off-by: NDmitry Kasatkin <d.kasatkin@samsung.com>
      Acked-by: NDavid Howells <dhowells@redhat.com>
      7d2ce232
  28. 24 11月, 2013 1 次提交
  29. 01 11月, 2013 2 次提交
    • M
      ima: define '_ima' as a builtin 'trusted' keyring · 217091dd
      Mimi Zohar 提交于
      Require all keys added to the IMA keyring be signed by an
      existing trusted key on the system trusted keyring.
      
      Changelog:
      - define stub integrity_init_keyring() function (reported-by Fengguang Wu)
      - differentiate between regular and trusted keyring names.
      - replace printk with pr_info (D. Kasatkin)
      Signed-off-by: NMimi Zohar <zohar@us.ibm.com>
      217091dd
    • M
      ima: extend the measurement list to include the file signature · bcbc9b0c
      Mimi Zohar 提交于
      This patch defines a new template called 'ima-sig', which includes
      the file signature in the template data, in addition to the file's
      digest and pathname.
      
      A template is composed of a set of fields.  Associated with each
      field is an initialization and display function.  This patch defines
      a new template field called 'sig', the initialization function
      ima_eventsig_init(), and the display function ima_show_template_sig().
      
      This patch modifies the .field_init() function definition to include
      the 'security.ima' extended attribute and length.
      
      Changelog:
      - remove unused code (Dmitry Kasatkin)
      - avoid calling ima_write_template_field_data() unnecesarily (Roberto Sassu)
      - rename DATA_FMT_SIG to DATA_FMT_HEX
      - cleanup ima_eventsig_init() based on Roberto's comments
      Signed-off-by: NMimi Zohar <zohar@linux.vnet.ibm.com>
      Signed-off-by: NDmitry Kasatkin <d.kasatkin@samsung.com>
      Signed-off-by: NRoberto Sassu <roberto.sassu@polito.it>
      bcbc9b0c
  30. 27 10月, 2013 2 次提交
    • M
      ima: enable support for larger default filedata hash algorithms · e7a2ad7e
      Mimi Zohar 提交于
      The IMA measurement list contains two hashes - a template data hash
      and a filedata hash.  The template data hash is committed to the TPM,
      which is limited, by the TPM v1.2 specification, to 20 bytes.  The
      filedata hash is defined as 20 bytes as well.
      
      Now that support for variable length measurement list templates was
      added, the filedata hash is not limited to 20 bytes.  This patch adds
      Kconfig support for defining larger default filedata hash algorithms
      and replacing the builtin default with one specified on the kernel
      command line.
      
      <uapi/linux/hash_info.h> contains a list of hash algorithms.  The
      Kconfig default hash algorithm is a subset of this list, but any hash
      algorithm included in the list can be specified at boot, using the
      'ima_hash=' kernel command line option.
      
      Changelog v2:
      - update Kconfig
      
      Changelog:
      - support hashes that are configured
      - use generic HASH_ALGO_ definitions
      - add Kconfig support
      - hash_setup must be called only once (Dmitry)
      - removed trailing whitespaces (Roberto Sassu)
      Signed-off-by: NMimi Zohar <zohar@us.ibm.com>
      Signed-off-by: NRoberto Sassu <roberto.sassu@polito.it>
      e7a2ad7e
    • M
      ima: add Kconfig default measurement list template · 4286587d
      Mimi Zohar 提交于
      This patch adds a Kconfig option to select the default IMA
      measurement list template.  The 'ima' template limited the
      filedata hash to 20 bytes and the pathname to 255 charaters.
      The 'ima-ng' measurement list template permits larger hash
      digests and longer pathnames.
      
      Changelog:
      - keep 'select CRYPTO_HASH_INFO' in 'config IMA' section (Kconfig)
        (Roberto Sassu);
      - removed trailing whitespaces (Roberto Sassu).
      - Lindent fixes
      Signed-off-by: NMimi Zohar <zohar@us.ibm.com>
      Signed-off-by: NRoberto Sassu <roberto.sassu@polito.it>
      4286587d