1. 05 2月, 2019 1 次提交
  2. 29 12月, 2018 1 次提交
  3. 21 12月, 2018 1 次提交
  4. 18 12月, 2018 1 次提交
  5. 13 12月, 2018 4 次提交
    • N
      ima: Use inode_is_open_for_write · eed9de3b
      Nikolay Borisov 提交于
      Use the aptly named function rather than open coding the check. No
      functional changes.
      Signed-off-by: NNikolay Borisov <nborisov@suse.com>
      Signed-off-by: NMimi Zohar <zohar@linux.ibm.com>
      eed9de3b
    • N
      ima: Support platform keyring for kernel appraisal · d7cecb67
      Nayna Jain 提交于
      On secure boot enabled systems, the bootloader verifies the kernel
      image and possibly the initramfs signatures based on a set of keys. A
      soft reboot(kexec) of the system, with the same kernel image and
      initramfs, requires access to the original keys to verify the
      signatures.
      
      This patch allows IMA-appraisal access to those original keys, now
      loaded on the platform keyring, needed for verifying the kernel image
      and initramfs signatures.
      
      [zohar@linux.ibm.com: only use platform keyring if it's enabled (Thiago)]
      Signed-off-by: NNayna Jain <nayna@linux.ibm.com>
      Reviewed-by: NMimi Zohar <zohar@linux.ibm.com>
      Acked-by: NSerge Hallyn <serge@hallyn.com>
      Reviewed-by: NJames Morris <james.morris@microsoft.com>
      Reviewed-by: NThiago Jung Bauermann <bauerman@linux.ibm.com>
      Signed-off-by: NMimi Zohar <zohar@linux.ibm.com>
      d7cecb67
    • P
      security: audit and remove any unnecessary uses of module.h · 876979c9
      Paul Gortmaker 提交于
      Historically a lot of these existed because we did not have
      a distinction between what was modular code and what was providing
      support to modules via EXPORT_SYMBOL and friends.  That changed
      when we forked out support for the latter into the export.h file.
      This means we should be able to reduce the usage of module.h
      in code that is obj-y Makefile or bool Kconfig.
      
      The advantage in removing such instances is that module.h itself
      sources about 15 other headers; adding significantly to what we feed
      cpp, and it can obscure what headers we are effectively using.
      
      Since module.h might have been the implicit source for init.h
      (for __init) and for export.h (for EXPORT_SYMBOL) we consider each
      instance for the presence of either and replace as needed.
      
      Cc: James Morris <jmorris@namei.org>
      Cc: "Serge E. Hallyn" <serge@hallyn.com>
      Cc: John Johansen <john.johansen@canonical.com>
      Cc: Mimi Zohar <zohar@linux.ibm.com>
      Cc: Dmitry Kasatkin <dmitry.kasatkin@gmail.com>
      Cc: David Howells <dhowells@redhat.com>
      Cc: linux-security-module@vger.kernel.org
      Cc: linux-integrity@vger.kernel.org
      Cc: keyrings@vger.kernel.org
      Signed-off-by: NPaul Gortmaker <paul.gortmaker@windriver.com>
      Signed-off-by: NJames Morris <james.morris@microsoft.com>
      876979c9
    • P
      security: integrity: make ima_main explicitly non-modular · 4f83d5ea
      Paul Gortmaker 提交于
      The Makefile/Kconfig entry controlling compilation of this code is:
      
      obj-$(CONFIG_IMA) += ima.o
      ima-y := ima_fs.o ima_queue.o ima_init.o ima_main.o ima_crypto.o ima_api.o \
               ima_policy.o ima_template.o ima_template_lib.o
      
      security/integrity/ima/Kconfig:config IMA
      security/integrity/ima/Kconfig- bool "Integrity Measurement Architecture(IMA)"
      
      ...meaning that it currently is not being built as a module by anyone.
      
      Lets remove the couple traces of modular infrastructure use, so that
      when reading the driver there is no doubt it is builtin-only.
      
      We also delete the MODULE_LICENSE tag etc. since all that information
      is already contained at the top of the file in the comments.
      
      Cc: Mimi Zohar <zohar@linux.ibm.com>
      Cc: Dmitry Kasatkin <dmitry.kasatkin@gmail.com>
      Cc: James Morris <jmorris@namei.org>
      Cc: "Serge E. Hallyn" <serge@hallyn.com>
      Cc: linux-ima-devel@lists.sourceforge.net
      Cc: linux-security-module@vger.kernel.org
      Signed-off-by: NPaul Gortmaker <paul.gortmaker@windriver.com>
      Signed-off-by: NJames Morris <james.morris@microsoft.com>
      4f83d5ea
  6. 11 12月, 2018 5 次提交
    • M
      ima: don't measure/appraise files on efivarfs · 060190fb
      Mimi Zohar 提交于
      Update the builtin IMA policies specified on the boot command line
      (eg. ima_policy="tcb|appraise_tcb") to permit accessing efivar files.
      Signed-off-by: NMimi Zohar <zohar@linux.ibm.com>
      060190fb
    • 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
    • N
      ima: refactor ima_init_policy() · c52657d9
      Nayna Jain 提交于
      This patch removes the code duplication in ima_init_policy() by defining
      a new function named add_rules(). The new function adds the rules to the
      initial IMA policy, the custom policy or both based on the policy mask
      (IMA_DEFAULT_POLICY, IMA_CUSTOM_POLICY).
      Signed-off-by: NNayna Jain <nayna@linux.ibm.com>
      Signed-off-by: NMimi Zohar <zohar@linux.ibm.com>
      c52657d9
    • N
      ima: prevent kexec_load syscall based on runtime secureboot flag · b5ca1173
      Nayna Jain 提交于
      When CONFIG_KEXEC_VERIFY_SIG is enabled, the kexec_file_load syscall
      requires the kexec'd kernel image to be signed. 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 disables the kexec_load syscall only for systems booted with
      secureboot enabled.
      
      [zohar@linux.ibm.com: add missing mesage on kexec_load failure]
      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>
      b5ca1173
  7. 27 11月, 2018 1 次提交
  8. 13 11月, 2018 1 次提交
  9. 11 10月, 2018 3 次提交
  10. 28 7月, 2018 2 次提交
  11. 18 7月, 2018 4 次提交
  12. 17 7月, 2018 5 次提交
  13. 12 7月, 2018 1 次提交
  14. 31 5月, 2018 2 次提交
  15. 23 5月, 2018 1 次提交
    • M
      ima: fix updating the ima_appraise flag · 6f0911a6
      Mimi Zohar 提交于
      As IMA policy rules are added, a mask of the type of rule (eg. kernel
      modules, firmware, IMA policy) is updated.  Unlike custom IMA policy
      rules, which replace the original builtin policy rules and update the
      mask, the builtin "secure_boot" policy rules were loaded, but did not
      update the mask.
      
      This patch refactors the code to load custom policies, defining a new
      function named ima_appraise_flag().  The new function is called either
      when loading the builtin "secure_boot" or custom policies.
      
      Fixes: 503ceaef ("ima: define a set of appraisal rules requiring file signatures")
      Signed-off-by: NMimi Zohar <zohar@linux.vnet.ibm.com>
      6f0911a6
  16. 22 5月, 2018 2 次提交
    • M
      ima: based on policy verify firmware signatures (pre-allocated buffer) · fd90bc55
      Mimi Zohar 提交于
      Don't differentiate, for now, between kernel_read_file_id READING_FIRMWARE
      and READING_FIRMWARE_PREALLOC_BUFFER enumerations.
      
      Fixes: a098ecd2 firmware: support loading into a pre-allocated buffer (since 4.8)
      Signed-off-by: NMimi Zohar <zohar@linux.vnet.ibm.com>
      Cc: Luis R. Rodriguez <mcgrof@suse.com>
      Cc: David Howells <dhowells@redhat.com>
      Cc: Kees Cook <keescook@chromium.org>
      Cc: Serge E. Hallyn <serge@hallyn.com>
      Cc: Stephen Boyd <stephen.boyd@linaro.org>
      fd90bc55
    • M
      ima: define a new policy condition based on the filesystem name · f1b08bbc
      Mimi Zohar 提交于
      If/when file data signatures are distributed with the file data, this
      patch will not be needed.  In the current environment where only some
      files are signed, the ability to differentiate between file systems is
      needed.  Some file systems consider the file system magic number
      internal to the file system.
      
      This patch defines a new IMA policy condition named "fsname", based on
      the superblock's file_system_type (sb->s_type) name. This allows policy
      rules to be expressed in terms of the filesystem name.
      
      The following sample rules require file signatures on rootfs files
      executed or mmap'ed.
      
      appraise func=BPRM_CHECK fsname=rootfs appraise_type=imasig
      appraise func=FILE_MMAP fsname=rootfs appraise_type=imasig
      Signed-off-by: NMimi Zohar <zohar@linux.vnet.ibm.com>
      Cc: Dave Chinner <david@fromorbit.com>
      Cc: Theodore Ts'o <tytso@mit.edu>
      f1b08bbc
  17. 17 5月, 2018 4 次提交
  18. 15 5月, 2018 1 次提交