1. 10 9月, 2021 13 次提交
  2. 14 4月, 2021 1 次提交
  3. 05 10月, 2020 3 次提交
  4. 21 7月, 2020 1 次提交
    • T
      ima: Support additional conditionals in the KEXEC_CMDLINE hook function · 4834177e
      Tyler Hicks 提交于
      Take the properties of the kexec kernel's inode and the current task
      ownership into consideration when matching a KEXEC_CMDLINE operation to
      the rules in the IMA policy. This allows for some uniformity when
      writing IMA policy rules for KEXEC_KERNEL_CHECK, KEXEC_INITRAMFS_CHECK,
      and KEXEC_CMDLINE operations.
      
      Prior to this patch, it was not possible to write a set of rules like
      this:
      
       dont_measure func=KEXEC_KERNEL_CHECK obj_type=foo_t
       dont_measure func=KEXEC_INITRAMFS_CHECK obj_type=foo_t
       dont_measure func=KEXEC_CMDLINE obj_type=foo_t
       measure func=KEXEC_KERNEL_CHECK
       measure func=KEXEC_INITRAMFS_CHECK
       measure func=KEXEC_CMDLINE
      
      The inode information associated with the kernel being loaded by a
      kexec_kernel_load(2) syscall can now be included in the decision to
      measure or not
      
      Additonally, the uid, euid, and subj_* conditionals can also now be
      used in KEXEC_CMDLINE rules. There was no technical reason as to why
      those conditionals weren't being considered previously other than
      ima_match_rules() didn't have a valid inode to use so it immediately
      bailed out for KEXEC_CMDLINE operations rather than going through the
      full list of conditional comparisons.
      Signed-off-by: NTyler Hicks <tyhicks@linux.microsoft.com>
      Cc: Eric Biederman <ebiederm@xmission.com>
      Cc: kexec@lists.infradead.org
      Reviewed-by: NLakshmi Ramasubramanian <nramas@linux.microsoft.com>
      Signed-off-by: NMimi Zohar <zohar@linux.ibm.com>
      4834177e
  5. 23 5月, 2020 1 次提交
  6. 12 3月, 2020 1 次提交
  7. 23 1月, 2020 1 次提交
  8. 10 1月, 2020 1 次提交
  9. 12 12月, 2019 1 次提交
  10. 12 11月, 2019 1 次提交
  11. 20 8月, 2019 1 次提交
    • M
      kexec: Allow kexec_file() with appropriate IMA policy when locked down · 29d3c1c8
      Matthew Garrett 提交于
      Systems in lockdown mode should block the kexec of untrusted kernels.
      For x86 and ARM we can ensure that a kernel is trustworthy by validating
      a PE signature, but this isn't possible on other architectures. On those
      platforms we can use IMA digital signatures instead. Add a function to
      determine whether IMA has or will verify signatures for a given event type,
      and if so permit kexec_file() even if the kernel is otherwise locked down.
      This is restricted to cases where CONFIG_INTEGRITY_TRUSTED_KEYRING is set
      in order to prevent an attacker from loading additional keys at runtime.
      Signed-off-by: NMatthew Garrett <mjg59@google.com>
      Acked-by: NMimi Zohar <zohar@linux.ibm.com>
      Cc: Dmitry Kasatkin <dmitry.kasatkin@gmail.com>
      Cc: linux-integrity@vger.kernel.org
      Signed-off-by: NJames Morris <jmorris@namei.org>
      29d3c1c8
  12. 24 6月, 2019 1 次提交
  13. 05 6月, 2019 1 次提交
  14. 29 4月, 2019 1 次提交
  15. 05 2月, 2019 1 次提交
  16. 11 12月, 2018 3 次提交
    • M
      x86/ima: retry detecting secure boot mode · 399574c6
      Mimi Zohar 提交于
      The secure boot mode may not be detected on boot for some reason (eg.
      buggy firmware).  This patch attempts one more time to detect the
      secure boot mode.
      Signed-off-by: NMimi Zohar <zohar@linux.ibm.com>
      399574c6
    • 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
    • N
      ima: add support for arch specific policies · 61917062
      Nayna Jain 提交于
      Builtin IMA policies can be enabled on the boot command line, and replaced
      with a custom policy, normally during early boot in the initramfs. Build
      time IMA policy rules were recently added. These rules are automatically
      enabled on boot and persist after loading a custom policy.
      
      There is a need for yet another type of policy, an architecture specific
      policy, which is derived at runtime during kernel boot, based on the
      runtime secure boot flags.  Like the build time policy rules, these rules
      persist after loading a custom policy.
      
      This patch adds support for loading an architecture specific IMA policy.
      Signed-off-by: NNayna Jain <nayna@linux.ibm.com>
      Co-Developed-by: NMimi Zohar <zohar@linux.ibm.com>
      Signed-off-by: NMimi Zohar <zohar@linux.ibm.com>
      61917062
  17. 13 11月, 2018 1 次提交
    • N
      x86/ima: define arch_ima_get_secureboot · 0914ade2
      Nayna Jain 提交于
      Distros are concerned about totally disabling the kexec_load syscall.
      As a compromise, the kexec_load syscall will only be disabled when
      CONFIG_KEXEC_VERIFY_SIG is configured and the system is booted with
      secureboot enabled.
      
      This patch defines the new arch specific function called
      arch_ima_get_secureboot() to retrieve the secureboot state of the system.
      Signed-off-by: NNayna Jain <nayna@linux.ibm.com>
      Suggested-by: NSeth Forshee <seth.forshee@canonical.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>
      0914ade2
  18. 17 7月, 2018 1 次提交
  19. 12 7月, 2018 1 次提交
  20. 22 6月, 2017 1 次提交
  21. 21 12月, 2016 1 次提交
  22. 01 5月, 2016 1 次提交
    • M
      ima: add support for creating files using the mknodat syscall · 05d1a717
      Mimi Zohar 提交于
      Commit 3034a146 "ima: pass 'opened' flag to identify newly created files"
      stopped identifying empty files as new files.  However new empty files
      can be created using the mknodat syscall.  On systems with IMA-appraisal
      enabled, these empty files are not labeled with security.ima extended
      attributes properly, preventing them from subsequently being opened in
      order to write the file data contents.  This patch defines a new hook
      named ima_post_path_mknod() to mark these empty files, created using
      mknodat, as new in order to allow the file data contents to be written.
      
      In addition, files with security.ima xattrs containing a file signature
      are considered "immutable" and can not be modified.  The file contents
      need to be written, before signing the file.  This patch relaxes this
      requirement for new files, allowing the file signature to be written
      before the file contents.
      
      Changelog:
      - defer identifying files with signatures stored as security.ima
        (based on Dmitry Rozhkov's comments)
      - removing tests (eg. dentry, dentry->d_inode, inode->i_size == 0)
        (based on Al's review)
      Signed-off-by: NMimi Zohar <zohar@linux.vnet.ibm.com>
      Cc: Al Viro <<viro@zeniv.linux.org.uk>
      Tested-by: NDmitry Rozhkov <dmitry.rozhkov@linux.intel.com>
      05d1a717
  23. 21 2月, 2016 2 次提交