From: Nikolay Borisov <nborisov@suse.com>
To: zohar@linux.vnet.ibm.com
Cc: jmorris@namei.org, linux-integrity@vger.kernel.org,
linux-security-module@vger.kernel.org,
Nikolay Borisov <nborisov@suse.com>
Subject: [PATCH] ima: Use inode_is_open_for_write
Date: Tue, 11 Dec 2018 10:31:40 +0200 [thread overview]
Message-ID: <20181211083140.21430-1-nborisov@suse.com> (raw)
Use the aptly named function rather than open coding the check. No
functional changes.
Signed-off-by: Nikolay Borisov <nborisov@suse.com>
---
security/integrity/ima/ima_main.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/security/integrity/ima/ima_main.c b/security/integrity/ima/ima_main.c
index 1b88d58e1325..05fbf8a2fa42 100644
--- a/security/integrity/ima/ima_main.c
+++ b/security/integrity/ima/ima_main.c
@@ -103,7 +103,7 @@ static void ima_rdwr_violation_check(struct file *file,
} else {
if (must_measure)
set_bit(IMA_MUST_MEASURE, &iint->atomic_flags);
- if ((atomic_read(&inode->i_writecount) > 0) && must_measure)
+ if (inode_is_open_for_write(inode) && must_measure)
send_writers = true;
}
--
2.17.1
next reply other threads:[~2018-12-11 8:31 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-12-11 8:31 Nikolay Borisov [this message]
2018-12-11 13:23 ` [PATCH] ima: Use inode_is_open_for_write Mimi Zohar
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20181211083140.21430-1-nborisov@suse.com \
--to=nborisov@suse.com \
--cc=jmorris@namei.org \
--cc=linux-integrity@vger.kernel.org \
--cc=linux-security-module@vger.kernel.org \
--cc=zohar@linux.vnet.ibm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).