* [PATCH] ima: Use inode_is_open_for_write
@ 2018-12-11 8:31 Nikolay Borisov
2018-12-11 13:23 ` Mimi Zohar
0 siblings, 1 reply; 2+ messages in thread
From: Nikolay Borisov @ 2018-12-11 8:31 UTC (permalink / raw)
To: zohar; +Cc: jmorris, linux-integrity, linux-security-module, Nikolay Borisov
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
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] ima: Use inode_is_open_for_write
2018-12-11 8:31 [PATCH] ima: Use inode_is_open_for_write Nikolay Borisov
@ 2018-12-11 13:23 ` Mimi Zohar
0 siblings, 0 replies; 2+ messages in thread
From: Mimi Zohar @ 2018-12-11 13:23 UTC (permalink / raw)
To: Nikolay Borisov, zohar; +Cc: jmorris, linux-integrity, linux-security-module
On Tue, 2018-12-11 at 10:31 +0200, Nikolay Borisov wrote:
> Use the aptly named function rather than open coding the check. No
> functional changes.
>
> Signed-off-by: Nikolay Borisov <nborisov@suse.com>
Thanks. This patch is now in the #next-integrity branch.
Mimi
> ---
> 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;
> }
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2018-12-11 13:23 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-12-11 8:31 [PATCH] ima: Use inode_is_open_for_write Nikolay Borisov
2018-12-11 13:23 ` Mimi Zohar
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).