Commit 7f218319 authored by Linus Torvalds's avatar Linus Torvalds

Merge branch 'next-integrity' of...

Merge branch 'next-integrity' of git://git.kernel.org/pub/scm/linux/kernel/git/zohar/linux-integrity

Pull integrity updates from Mimi Zohar:
 "Just a couple of updates for linux-5.7:

   - A new Kconfig option to enable IMA architecture specific runtime
     policy rules needed for secure and/or trusted boot, as requested.

   - Some message cleanup (eg. pr_fmt, additional error messages)"

* 'next-integrity' of git://git.kernel.org/pub/scm/linux/kernel/git/zohar/linux-integrity:
  ima: add a new CONFIG for loading arch-specific policies
  integrity: Remove duplicate pr_fmt definitions
  IMA: Add log statements for failure conditions
  IMA: Update KBUILD_MODNAME for IMA files to ima
parents 6cad420c 9e2b4be3
...@@ -980,6 +980,7 @@ config PPC_SECURE_BOOT ...@@ -980,6 +980,7 @@ config PPC_SECURE_BOOT
bool bool
depends on PPC_POWERNV depends on PPC_POWERNV
depends on IMA_ARCH_POLICY depends on IMA_ARCH_POLICY
imply IMA_SECURE_AND_OR_TRUSTED_BOOT
help help
Systems with firmware secure boot enabled need to define security Systems with firmware secure boot enabled need to define security
policies to extend secure boot to the OS. This config allows a user policies to extend secure boot to the OS. This config allows a user
......
...@@ -195,6 +195,7 @@ config S390 ...@@ -195,6 +195,7 @@ config S390
select ARCH_HAS_FORCE_DMA_UNENCRYPTED select ARCH_HAS_FORCE_DMA_UNENCRYPTED
select SWIOTLB select SWIOTLB
select GENERIC_ALLOCATOR select GENERIC_ALLOCATOR
imply IMA_SECURE_AND_OR_TRUSTED_BOOT
config SCHED_OMIT_FRAME_POINTER config SCHED_OMIT_FRAME_POINTER
......
...@@ -70,7 +70,7 @@ obj-$(CONFIG_JUMP_LABEL) += jump_label.o ...@@ -70,7 +70,7 @@ obj-$(CONFIG_JUMP_LABEL) += jump_label.o
obj-$(CONFIG_KEXEC_FILE) += machine_kexec_file.o kexec_image.o obj-$(CONFIG_KEXEC_FILE) += machine_kexec_file.o kexec_image.o
obj-$(CONFIG_KEXEC_FILE) += kexec_elf.o obj-$(CONFIG_KEXEC_FILE) += kexec_elf.o
obj-$(CONFIG_IMA) += ima_arch.o obj-$(CONFIG_IMA_SECURE_AND_OR_TRUSTED_BOOT) += ima_arch.o
obj-$(CONFIG_PERF_EVENTS) += perf_event.o perf_cpum_cf_common.o obj-$(CONFIG_PERF_EVENTS) += perf_event.o perf_cpum_cf_common.o
obj-$(CONFIG_PERF_EVENTS) += perf_cpum_cf.o perf_cpum_sf.o obj-$(CONFIG_PERF_EVENTS) += perf_cpum_cf.o perf_cpum_sf.o
......
...@@ -230,6 +230,7 @@ config X86 ...@@ -230,6 +230,7 @@ config X86
select VIRT_TO_BUS select VIRT_TO_BUS
select X86_FEATURE_NAMES if PROC_FS select X86_FEATURE_NAMES if PROC_FS
select PROC_PID_ARCH_STATUS if PROC_FS select PROC_PID_ARCH_STATUS if PROC_FS
imply IMA_SECURE_AND_OR_TRUSTED_BOOT if EFI
config INSTRUCTION_DECODER config INSTRUCTION_DECODER
def_bool y def_bool y
......
...@@ -155,6 +155,4 @@ ifeq ($(CONFIG_X86_64),y) ...@@ -155,6 +155,4 @@ ifeq ($(CONFIG_X86_64),y)
obj-y += vsmp_64.o obj-y += vsmp_64.o
endif endif
ifdef CONFIG_EFI obj-$(CONFIG_IMA_SECURE_AND_OR_TRUSTED_BOOT) += ima_arch.o
obj-$(CONFIG_IMA) += ima_arch.o
endif
...@@ -30,8 +30,7 @@ extern void ima_kexec_cmdline(const void *buf, int size); ...@@ -30,8 +30,7 @@ extern void ima_kexec_cmdline(const void *buf, int size);
extern void ima_add_kexec_buffer(struct kimage *image); extern void ima_add_kexec_buffer(struct kimage *image);
#endif #endif
#if (defined(CONFIG_X86) && defined(CONFIG_EFI)) || defined(CONFIG_S390) \ #ifdef CONFIG_IMA_SECURE_AND_OR_TRUSTED_BOOT
|| defined(CONFIG_PPC_SECURE_BOOT)
extern bool arch_ima_get_secureboot(void); extern bool arch_ima_get_secureboot(void);
extern const char * const *arch_get_ima_policy(void); extern const char * const *arch_get_ima_policy(void);
#else #else
......
...@@ -6,8 +6,6 @@ ...@@ -6,8 +6,6 @@
* Dmitry Kasatkin <dmitry.kasatkin@intel.com> * Dmitry Kasatkin <dmitry.kasatkin@intel.com>
*/ */
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
#include <linux/err.h> #include <linux/err.h>
#include <linux/sched.h> #include <linux/sched.h>
#include <linux/slab.h> #include <linux/slab.h>
......
...@@ -6,8 +6,6 @@ ...@@ -6,8 +6,6 @@
* Dmitry Kasatkin <dmitry.kasatkin@intel.com> * Dmitry Kasatkin <dmitry.kasatkin@intel.com>
*/ */
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
#include <linux/err.h> #include <linux/err.h>
#include <linux/ratelimit.h> #include <linux/ratelimit.h>
#include <linux/key-type.h> #include <linux/key-type.h>
......
...@@ -10,8 +10,6 @@ ...@@ -10,8 +10,6 @@
* Using root's kernel master key (kmk), calculate the HMAC * Using root's kernel master key (kmk), calculate the HMAC
*/ */
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
#include <linux/export.h> #include <linux/export.h>
#include <linux/crypto.h> #include <linux/crypto.h>
#include <linux/xattr.h> #include <linux/xattr.h>
......
...@@ -11,8 +11,6 @@ ...@@ -11,8 +11,6 @@
* evm_inode_removexattr, and evm_verifyxattr * evm_inode_removexattr, and evm_verifyxattr
*/ */
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
#include <linux/init.h> #include <linux/init.h>
#include <linux/crypto.h> #include <linux/crypto.h>
#include <linux/audit.h> #include <linux/audit.h>
......
...@@ -10,8 +10,6 @@ ...@@ -10,8 +10,6 @@
* - Get the key and enable EVM * - Get the key and enable EVM
*/ */
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
#include <linux/audit.h> #include <linux/audit.h>
#include <linux/uaccess.h> #include <linux/uaccess.h>
#include <linux/init.h> #include <linux/init.h>
......
...@@ -327,3 +327,10 @@ config IMA_QUEUE_EARLY_BOOT_KEYS ...@@ -327,3 +327,10 @@ config IMA_QUEUE_EARLY_BOOT_KEYS
depends on IMA_MEASURE_ASYMMETRIC_KEYS depends on IMA_MEASURE_ASYMMETRIC_KEYS
depends on SYSTEM_TRUSTED_KEYRING depends on SYSTEM_TRUSTED_KEYRING
default y default y
config IMA_SECURE_AND_OR_TRUSTED_BOOT
bool
depends on IMA_ARCH_POLICY
help
This option is selected by architectures to enable secure and/or
trusted boot based on IMA runtime policies.
...@@ -11,6 +11,6 @@ ima-y := ima_fs.o ima_queue.o ima_init.o ima_main.o ima_crypto.o ima_api.o \ ...@@ -11,6 +11,6 @@ ima-y := ima_fs.o ima_queue.o ima_init.o ima_main.o ima_crypto.o ima_api.o \
ima-$(CONFIG_IMA_APPRAISE) += ima_appraise.o ima-$(CONFIG_IMA_APPRAISE) += ima_appraise.o
ima-$(CONFIG_IMA_APPRAISE_MODSIG) += ima_modsig.o ima-$(CONFIG_IMA_APPRAISE_MODSIG) += ima_modsig.o
ima-$(CONFIG_HAVE_IMA_KEXEC) += ima_kexec.o ima-$(CONFIG_HAVE_IMA_KEXEC) += ima_kexec.o
obj-$(CONFIG_IMA_BLACKLIST_KEYRING) += ima_mok.o ima-$(CONFIG_IMA_BLACKLIST_KEYRING) += ima_mok.o
obj-$(CONFIG_IMA_MEASURE_ASYMMETRIC_KEYS) += ima_asymmetric_keys.o ima-$(CONFIG_IMA_MEASURE_ASYMMETRIC_KEYS) += ima_asymmetric_keys.o
obj-$(CONFIG_IMA_QUEUE_EARLY_BOOT_KEYS) += ima_queue_keys.o ima-$(CONFIG_IMA_QUEUE_EARLY_BOOT_KEYS) += ima_queue_keys.o
...@@ -9,8 +9,6 @@ ...@@ -9,8 +9,6 @@
* create or update. * create or update.
*/ */
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
#include <keys/asymmetric-type.h> #include <keys/asymmetric-type.h>
#include "ima.h" #include "ima.h"
......
...@@ -10,8 +10,6 @@ ...@@ -10,8 +10,6 @@
* Calculates md5/sha1 file hash, template hash, boot-aggreate hash * Calculates md5/sha1 file hash, template hash, boot-aggreate hash
*/ */
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/moduleparam.h> #include <linux/moduleparam.h>
#include <linux/ratelimit.h> #include <linux/ratelimit.h>
......
...@@ -12,8 +12,6 @@ ...@@ -12,8 +12,6 @@
* current measurement list and IMA statistics * current measurement list and IMA statistics
*/ */
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
#include <linux/fcntl.h> #include <linux/fcntl.h>
#include <linux/slab.h> #include <linux/slab.h>
#include <linux/init.h> #include <linux/init.h>
......
...@@ -11,8 +11,6 @@ ...@@ -11,8 +11,6 @@
* initialization and cleanup functions * initialization and cleanup functions
*/ */
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
#include <linux/init.h> #include <linux/init.h>
#include <linux/scatterlist.h> #include <linux/scatterlist.h>
#include <linux/slab.h> #include <linux/slab.h>
......
...@@ -6,7 +6,6 @@ ...@@ -6,7 +6,6 @@
* Thiago Jung Bauermann <bauerman@linux.vnet.ibm.com> * Thiago Jung Bauermann <bauerman@linux.vnet.ibm.com>
* Mimi Zohar <zohar@linux.vnet.ibm.com> * Mimi Zohar <zohar@linux.vnet.ibm.com>
*/ */
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
#include <linux/seq_file.h> #include <linux/seq_file.h>
#include <linux/vmalloc.h> #include <linux/vmalloc.h>
......
...@@ -15,8 +15,6 @@ ...@@ -15,8 +15,6 @@
* and ima_file_check. * and ima_file_check.
*/ */
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
#include <linux/module.h> #include <linux/module.h>
#include <linux/file.h> #include <linux/file.h>
#include <linux/binfmts.h> #include <linux/binfmts.h>
...@@ -757,6 +755,9 @@ void process_buffer_measurement(const void *buf, int size, ...@@ -757,6 +755,9 @@ void process_buffer_measurement(const void *buf, int size,
ima_free_template_entry(entry); ima_free_template_entry(entry);
out: out:
if (ret < 0)
pr_devel("%s: failed, result: %d\n", __func__, ret);
return; return;
} }
......
...@@ -7,8 +7,6 @@ ...@@ -7,8 +7,6 @@
* - initialize default measure policy rules * - initialize default measure policy rules
*/ */
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
#include <linux/init.h> #include <linux/init.h>
#include <linux/list.h> #include <linux/list.h>
#include <linux/fs.h> #include <linux/fs.h>
......
...@@ -15,8 +15,6 @@ ...@@ -15,8 +15,6 @@
* ever removed or changed during the boot-cycle. * ever removed or changed during the boot-cycle.
*/ */
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
#include <linux/rculist.h> #include <linux/rculist.h>
#include <linux/slab.h> #include <linux/slab.h>
#include "ima.h" #include "ima.h"
......
...@@ -8,8 +8,6 @@ ...@@ -8,8 +8,6 @@
* Enables deferred processing of keys * Enables deferred processing of keys
*/ */
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
#include <linux/workqueue.h> #include <linux/workqueue.h>
#include <keys/asymmetric-type.h> #include <keys/asymmetric-type.h>
#include "ima.h" #include "ima.h"
......
...@@ -9,8 +9,6 @@ ...@@ -9,8 +9,6 @@
* Helpers to manage template descriptors. * Helpers to manage template descriptors.
*/ */
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
#include <linux/rculist.h> #include <linux/rculist.h>
#include "ima.h" #include "ima.h"
#include "ima_template_lib.h" #include "ima_template_lib.h"
......
...@@ -9,8 +9,6 @@ ...@@ -9,8 +9,6 @@
* Library of supported template fields. * Library of supported template fields.
*/ */
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
#include "ima_template_lib.h" #include "ima_template_lib.h"
static bool ima_template_hash_algo_allowed(u8 algo) static bool ima_template_hash_algo_allowed(u8 algo)
......
...@@ -6,6 +6,12 @@ ...@@ -6,6 +6,12 @@
* Mimi Zohar <zohar@us.ibm.com> * Mimi Zohar <zohar@us.ibm.com>
*/ */
#ifdef pr_fmt
#undef pr_fmt
#endif
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
#include <linux/types.h> #include <linux/types.h>
#include <linux/integrity.h> #include <linux/integrity.h>
#include <crypto/sha.h> #include <crypto/sha.h>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment