Skip to contentSkip to conversation

Patch "evm: labeling pseudo filesystems exception" has been added to the 4.1-stable tree

PATCH [email protected] 1 participant 1 message Jul 30, 2015

Subsystems (4)
lore
Share & tools
lore

[email protected]

author maintainer Applied
#0 lore raw

This is a note to let you know that I've just added the patch titled

evm: labeling pseudo filesystems exception

to the 4.1-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
evm-labeling-pseudo-filesystems-exception.patch
and it can be found in the queue-4.1 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree, please let <[email protected]> know about it.

Quoted 1 line

From 5101a1850bb7ccbf107929dee9af0cd2f400940f Mon Sep 17 00:00:00 2001

From: Mimi Zohar <[email protected]>
Date: Tue, 21 Apr 2015 13:59:31 -0400
Subject: evm: labeling pseudo filesystems exception

From: Mimi Zohar <[email protected]>

commit 5101a1850bb7ccbf107929dee9af0cd2f400940f upstream.

To prevent offline stripping of existing file xattrs and relabeling of them at runtime, EVM allows only newly created files to be labeled. As pseudo filesystems are not persistent, stripping of xattrs is not a concern.

Some LSMs defer file labeling on pseudo filesystems. This patch permits the labeling of existing files on pseudo files systems.

---
 security/integrity/evm/evm_main.c |   11 +++++++++++
 1 file changed, 11 insertions(+)
security/integrity/evm/evm_main.c +11 -0
@@ -296,6 +296,17 @@ static int evm_protect_xattr(struct dent
 		iint = integrity_iint_find(d_backing_inode(dentry));
 		if (iint && (iint->flags & IMA_NEW_FILE))
 			return 0;
+
+		/* exception for pseudo filesystems */
+		if (dentry->d_inode->i_sb->s_magic == TMPFS_MAGIC
+		    || dentry->d_inode->i_sb->s_magic == SYSFS_MAGIC)
+			return 0;
+
+		integrity_audit_msg(AUDIT_INTEGRITY_METADATA,
+				    dentry->d_inode, dentry->d_name.name,
+				    "update_metadata",
+				    integrity_status_msg[evm_status],
+				    -EPERM, 0);
 	}
 out:
 	if (evm_status != INTEGRITY_PASS)

Patches currently in stable-queue which might be from [email protected] are

queue-4.1/keys-fix-ca_keys-partial-key-matching.patch queue-4.1/ima-update-builtin-policies.patch queue-4.1/ima-extend-mask-policy-matching-support.patch queue-4.1/ima-cleanup-ima_init_policy-a-little.patch queue-4.1/evm-labeling-pseudo-filesystems-exception.patch queue-4.1/ima-fix-ima_show_template_data_ascii.patch queue-4.1/ima-add-support-for-new-euid-policy-condition.patch queue-4.1/ima-do-not-measure-or-appraise-the-nsfs-filesystem.patch queue-4.1/ima-skip-measurement-of-cgroupfs-files-and-update-documentation.patch