All of lore.kernel.org
 help / color / mirror / Atom feed
From: hch@lst.de (Christoph Hellwig)
To: linux-security-module@vger.kernel.org
Subject: [PATCH v5 1/4] ima: always measure and audit files in policy
Date: Fri, 11 Aug 2017 12:18:09 +0200	[thread overview]
Message-ID: <20170811101809.GB11531@lst.de> (raw)
In-Reply-To: <1502408507-4257-2-git-send-email-zohar@linux.vnet.ibm.com>

> +	i_version = file_inode(file)->i_version;

This probably wants a comment that i_version might be unreliable
unless the file system supports the change attribute.

> +	result = (!buf) ?  ima_calc_file_hash(file, &hash.hdr) :
> +		ima_calc_buffer_hash(buf, size, &hash.hdr);

Please write this like proper C code:

	if (buf)
		result = ima_calc_buffer_hash(buf, size, &hash.hdr);
	else
		result = ima_calc_file_hash(file, &hash.hdr);

> +++ b/security/integrity/ima/ima_crypto.c
> @@ -441,6 +441,16 @@ int ima_calc_file_hash(struct file *file, struct ima_digest_data *hash)
>  	loff_t i_size;
>  	int rc;
>  
> +	/*
> +	 * O_DIRECT not supported for buffered read. For consistency,
> +	 * don't support O_DIRECT on DAX either.
> +	 */

I can't parse this - O_DIRECT is the opposite of a buffered I/O, including
reads.

> +	if ((rc == 0) && (action & IMA_APPRAISE_SUBMASK))

no need for the first set of inner braces.
--
To unsubscribe from this list: send the line "unsubscribe linux-security-module" in
the body of a message to majordomo at vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

WARNING: multiple messages have this Message-ID (diff)
From: Christoph Hellwig <hch@lst.de>
To: Mimi Zohar <zohar@linux.vnet.ibm.com>
Cc: Christoph Hellwig <hch@lst.de>, Al Viro <viro@zeniv.linux.org.uk>,
	James Morris <jmorris@namei.org>,
	linux-fsdevel@vger.kernel.org,
	linux-ima-devel@lists.sourceforge.net,
	linux-security-module@vger.kernel.org
Subject: Re: [PATCH v5 1/4] ima: always measure and audit files in policy
Date: Fri, 11 Aug 2017 12:18:09 +0200	[thread overview]
Message-ID: <20170811101809.GB11531@lst.de> (raw)
In-Reply-To: <1502408507-4257-2-git-send-email-zohar@linux.vnet.ibm.com>

> +	i_version = file_inode(file)->i_version;

This probably wants a comment that i_version might be unreliable
unless the file system supports the change attribute.

> +	result = (!buf) ?  ima_calc_file_hash(file, &hash.hdr) :
> +		ima_calc_buffer_hash(buf, size, &hash.hdr);

Please write this like proper C code:

	if (buf)
		result = ima_calc_buffer_hash(buf, size, &hash.hdr);
	else
		result = ima_calc_file_hash(file, &hash.hdr);

> +++ b/security/integrity/ima/ima_crypto.c
> @@ -441,6 +441,16 @@ int ima_calc_file_hash(struct file *file, struct ima_digest_data *hash)
>  	loff_t i_size;
>  	int rc;
>  
> +	/*
> +	 * O_DIRECT not supported for buffered read. For consistency,
> +	 * don't support O_DIRECT on DAX either.
> +	 */

I can't parse this - O_DIRECT is the opposite of a buffered I/O, including
reads.

> +	if ((rc == 0) && (action & IMA_APPRAISE_SUBMASK))

no need for the first set of inner braces.

  reply	other threads:[~2017-08-11 10:18 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-10 23:41 [PATCH v5 0/4] define new fs integrity_read method Mimi Zohar
2017-08-10 23:41 ` Mimi Zohar
2017-08-10 23:41 ` [PATCH v5 1/4] ima: always measure and audit files in policy Mimi Zohar
2017-08-10 23:41   ` Mimi Zohar
2017-08-11 10:18   ` Christoph Hellwig [this message]
2017-08-11 10:18     ` Christoph Hellwig
2017-08-11 12:34     ` Mimi Zohar
2017-08-11 12:34       ` Mimi Zohar
2017-08-10 23:41 ` [PATCH v5 2/4] ima: use fs method to read integrity data Mimi Zohar
2017-08-10 23:41   ` Mimi Zohar
2017-08-11 10:21   ` Christoph Hellwig
2017-08-11 10:21     ` Christoph Hellwig
2017-08-11 13:20     ` Mimi Zohar
2017-08-11 13:20       ` Mimi Zohar
2017-08-11 17:11       ` Mimi Zohar
2017-08-11 17:11         ` Mimi Zohar
2017-08-11 17:15         ` Christoph Hellwig
2017-08-11 17:15           ` Christoph Hellwig
2017-08-10 23:41 ` [PATCH v5 3/4] ima: define "dont_failsafe" policy action rule Mimi Zohar
2017-08-10 23:41   ` Mimi Zohar
2017-08-10 23:41 ` [PATCH v5 4/4] ima: define "fs_unsafe" builtin policy Mimi Zohar
2017-08-10 23:41   ` 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=20170811101809.GB11531@lst.de \
    --to=hch@lst.de \
    --cc=linux-security-module@vger.kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.