Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 3323eec9 authored by Mimi Zohar's avatar Mimi Zohar Committed by James Morris
Browse files

integrity: IMA as an integrity service provider



IMA provides hardware (TPM) based measurement and attestation for
file measurements. As the Trusted Computing (TPM) model requires,
IMA measures all files before they are accessed in any way (on the
integrity_bprm_check, integrity_path_check and integrity_file_mmap
hooks), and commits the measurements to the TPM. Once added to the
TPM, measurements can not be removed.

In addition, IMA maintains a list of these file measurements, which
can be used to validate the aggregate value stored in the TPM.  The
TPM can sign these measurements, and thus the system can prove, to
itself and to a third party, the system's integrity in a way that
cannot be circumvented by malicious or compromised software.

- alloc ima_template_entry before calling ima_store_template()
- log ima_add_boot_aggregate() failure
- removed unused IMA_TEMPLATE_NAME_LEN
- replaced hard coded string length with #define name

Signed-off-by: default avatarMimi Zohar <zohar@us.ibm.com>
Signed-off-by: default avatarJames Morris <jmorris@namei.org>
parent 6146f0d5
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -895,6 +895,15 @@ and is between 256 and 4096 characters. It is defined in the file
	ihash_entries=	[KNL]
			Set number of hash buckets for inode cache.

	ima_audit=	[IMA]
			Format: { "0" | "1" }
			0 -- integrity auditing messages. (Default)
			1 -- enable informational integrity auditing messages.

	ima_hash=	[IMA]
			Formt: { "sha1" | "md5" }
			default: "sha1"

	in2000=		[HW,SCSI]
			See header of drivers/scsi/in2000.c.

+5 −0
Original line number Diff line number Diff line
@@ -125,6 +125,11 @@
#define AUDIT_LAST_KERN_ANOM_MSG    1799
#define AUDIT_ANOM_PROMISCUOUS      1700 /* Device changed promiscuous mode */
#define AUDIT_ANOM_ABEND            1701 /* Process ended abnormally */
#define AUDIT_INTEGRITY_DATA	    1800 /* Data integrity verification */
#define AUDIT_INTEGRITY_METADATA    1801 /* Metadata integrity verification */
#define AUDIT_INTEGRITY_STATUS	    1802 /* Integrity enable status */
#define AUDIT_INTEGRITY_HASH	    1803 /* Integrity HASH type */
#define AUDIT_INTEGRITY_PCR	    1804 /* PCR invalidation msgs */

#define AUDIT_KERNEL		2000	/* Asynchronous audit record. NOT A REQUEST. */

+10 −0
Original line number Diff line number Diff line
@@ -12,6 +12,15 @@
#ifndef _LINUX_IMA_H
#define _LINUX_IMA_H

#ifdef CONFIG_IMA
extern int ima_bprm_check(struct linux_binprm *bprm);
extern int ima_inode_alloc(struct inode *inode);
extern void ima_inode_free(struct inode *inode);
extern int ima_path_check(struct path *path, int mask);
extern void ima_file_free(struct file *file);
extern int ima_file_mmap(struct file *file, unsigned long prot);

#else
static inline int ima_bprm_check(struct linux_binprm *bprm)
{
	return 0;
@@ -41,4 +50,5 @@ static inline int ima_file_mmap(struct file *file, unsigned long prot)
{
	return 0;
}
#endif /* CONFIG_IMA_H */
#endif /* _LINUX_IMA_H */
+4 −1
Original line number Diff line number Diff line
@@ -55,7 +55,8 @@ config SECURITYFS
	bool "Enable the securityfs filesystem"
	help
	  This will build the securityfs filesystem.  It is currently used by
	  the TPM bios character driver.  It is not used by SELinux or SMACK.
	  the TPM bios character driver and IMA, an integrity provider.  It is
	  not used by SELinux or SMACK.

	  If you are unsure how to answer this question, answer N.

@@ -126,5 +127,7 @@ config SECURITY_DEFAULT_MMAP_MIN_ADDR
source security/selinux/Kconfig
source security/smack/Kconfig

source security/integrity/ima/Kconfig

endmenu
+4 −0
Original line number Diff line number Diff line
@@ -17,3 +17,7 @@ obj-$(CONFIG_SECURITY_SELINUX) += selinux/built-in.o
obj-$(CONFIG_SECURITY_SMACK)		+= smack/built-in.o
obj-$(CONFIG_SECURITY_ROOTPLUG)		+= root_plug.o
obj-$(CONFIG_CGROUP_DEVICE)		+= device_cgroup.o

# Object integrity file lists
subdir-$(CONFIG_IMA)			+= integrity/ima
obj-$(CONFIG_IMA)			+= integrity/ima/built-in.o
Loading