Commit 3e7a258b authored by Xiang Yang's avatar Xiang Yang
Browse files

IMA: Fix the incorrect definition and use of IMA_FIX_OVERLAYFS_DETECTION

hulk inclusion
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/IBCIAZ



--------------------------------

The definition of IMA_FIX_OVERLAYFS_DETECTION is wrong with the bool field
has no content, and the use of it in ima_main.c is wrong with the missing
prefix CONFIG_, so correct them.

Fixes: a670a0ed ("IMA: Introduce a config for fix on IMA with Overlayfs issue")
Signed-off-by: default avatarXiang Yang <xiangyang3@huawei.com>
parent f5a62ec8
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -370,7 +370,7 @@ config IMA_PARSER_BINARY_PATH
	   This option defines the path of the parser binary.

config IMA_FIX_OVERLAYFS_DETECTION
	bool
	bool "Fix for overlayfs backing inode change detection"
	default y
	help
	   This option enables the fix for overlayfs backing inode change
+2 −2
Original line number Diff line number Diff line
@@ -267,7 +267,7 @@ static int process_measurement(struct file *file, const struct cred *cred,
			       u32 secid, char *buf, loff_t size, int mask,
			       enum ima_hooks func)
{
#ifdef IMA_FIX_OVERLAYFS_DETECTION
#ifdef CONFIG_IMA_FIX_OVERLAYFS_DETECTION
	struct inode *backing_inode, *inode = file_inode(file);
#else
	struct inode *inode = file_inode(file);
@@ -348,7 +348,7 @@ static int process_measurement(struct file *file, const struct cred *cred,
		iint->measured_pcrs = 0;
	}

#ifdef IMA_FIX_OVERLAYFS_DETECTION
#ifdef CONFIG_IMA_FIX_OVERLAYFS_DETECTION
	/* Detect and re-evaluate changes made to the backing file. */
	backing_inode = d_real_inode(file_dentry(file));
	if (backing_inode != inode &&