[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20241008165732.2603647-3-roberto.sassu@huaweicloud.com>
Date: Tue, 8 Oct 2024 18:57:32 +0200
From: Roberto Sassu <roberto.sassu@...weicloud.com>
To: zohar@...ux.ibm.com,
dmitry.kasatkin@...il.com,
eric.snowberg@...cle.com,
paul@...l-moore.com,
jmorris@...ei.org,
serge@...lyn.com
Cc: linux-integrity@...r.kernel.org,
linux-security-module@...r.kernel.org,
linux-kernel@...r.kernel.org,
bpf@...r.kernel.org,
ebpqwerty472123@...il.com,
Roberto Sassu <roberto.sassu@...wei.com>
Subject: [PATCH 3/3] ima: Mark concurrent accesses to the iint pointer in the inode security blob
From: Roberto Sassu <roberto.sassu@...wei.com>
Use the READ_ONCE() and WRITE_ONCE() macros to mark concurrent read and
write accesses to the portion of the inode security blob containing the
iint pointer.
Writers are serialized by the iint lock.
Signed-off-by: Roberto Sassu <roberto.sassu@...wei.com>
---
security/integrity/ima/ima.h | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/security/integrity/ima/ima.h b/security/integrity/ima/ima.h
index 6474a15b584a..3fe1651395ce 100644
--- a/security/integrity/ima/ima.h
+++ b/security/integrity/ima/ima.h
@@ -215,7 +215,7 @@ ima_inode_get_iint(const struct inode *inode)
return NULL;
iint_lock = ima_inode_security(inode->i_security);
- return iint_lock->iint;
+ return READ_ONCE(iint_lock->iint);
}
static inline void ima_inode_set_iint(const struct inode *inode,
@@ -227,7 +227,7 @@ static inline void ima_inode_set_iint(const struct inode *inode,
return;
iint_lock = ima_inode_security(inode->i_security);
- iint_lock->iint = iint;
+ WRITE_ONCE(iint_lock->iint, iint);
}
struct ima_iint_cache *ima_iint_find(struct inode *inode);
--
2.34.1
Powered by blists - more mailing lists