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 2/4] ima: use fs method to read integrity data
Date: Fri, 11 Aug 2017 12:21:13 +0200	[thread overview]
Message-ID: <20170811102113.GC11531@lst.de> (raw)
In-Reply-To: <1502408507-4257-3-git-send-email-zohar@linux.vnet.ibm.com>

On Thu, Aug 10, 2017 at 07:41:45PM -0400, Mimi Zohar wrote:
> From: Christoph Hellwig <hch@lst.de>
> 
> Add a new ->integrity_read file operation to read data for integrity
> hash collection.  This is defined to be equivalent to ->read_iter,
> except that it will be called with the i_rwsem held exclusively.
> 
> Signed-off-by: Christoph Hellwig <hch@lst.de>

Btw, most of this is yours now, feel free to take over the authorship
with a little credit to me for the initial patch if you want.

> Cc: Matthew Garrett <matthew.garrett@nebula.com>

I don't think that will reach Matthew anymore :)

> -static ssize_t efivarfs_file_read(struct file *file, char __user *userbuf,
> -		size_t count, loff_t *ppos)
> +static ssize_t efivarfs_file_read_iter(struct kiocb *iocb,
> +				       struct iov_iter *iter)

The efivars switch to read_iter should be a separate patch before
this one.

>  /**
> + * simple_read_iter_from_buffer - copy data from the buffer to user space
> + * @iocb: struct containing the file, the current position and other info
> + * @to: the user space buffer to read to
> + * @from: the buffer to read from
> + * @available: the size of the buffer
> + *
> + * The simple_read_iter_from_buffer() function reads up to @available bytes
> + * from the current buffer into the user space buffer.
> + *
> + * On success, the current buffer offset is advanced by the number of bytes
> + * read, or a negative value is returned on error.
> + **/
> +ssize_t simple_read_iter_from_buffer(struct kiocb *iocb, struct iov_iter *to,
> +				     const void *from, size_t available)

The addition of simple_read_iter_from_buffer should be another separate
patch, before efivars starts using it.
--
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,
	Matthew Garrett <matthew.garrett@nebula.com>,
	Jan Kara <jack@suse.com>, Theodore Ts'o <tytso@mit.edu>,
	Andreas Dilger <adilger.kernel@dilger.ca>,
	Jaegeuk Kim <jaegeuk@kernel.org>, Chao Yu <yuchao0@huawei.com>,
	Steven Whitehouse <swhiteho@redhat.com>,
	Bob Peterson <rpeterso@redhat.com>,
	David Woodhouse <dwmw2@infradead.org>,
	Dave Kleikamp <shaggy@kernel.org>,
	Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>,
	Mark Fasheh <mfasheh@versity.com>,
	Joel Becker <jlbec@evilplan.org>,
	Richard Weinberger <richard@nod.at>,
	"Darrick J. Wong" <darrick.wong@oracle.com>,
	Hugh Dickins <hughd@google.com>, Chris Mason <clm@fb.com>
Subject: Re: [PATCH v5 2/4] ima: use fs method to read integrity data
Date: Fri, 11 Aug 2017 12:21:13 +0200	[thread overview]
Message-ID: <20170811102113.GC11531@lst.de> (raw)
In-Reply-To: <1502408507-4257-3-git-send-email-zohar@linux.vnet.ibm.com>

On Thu, Aug 10, 2017 at 07:41:45PM -0400, Mimi Zohar wrote:
> From: Christoph Hellwig <hch@lst.de>
> 
> Add a new ->integrity_read file operation to read data for integrity
> hash collection.  This is defined to be equivalent to ->read_iter,
> except that it will be called with the i_rwsem held exclusively.
> 
> Signed-off-by: Christoph Hellwig <hch@lst.de>

Btw, most of this is yours now, feel free to take over the authorship
with a little credit to me for the initial patch if you want.

> Cc: Matthew Garrett <matthew.garrett@nebula.com>

I don't think that will reach Matthew anymore :)

> -static ssize_t efivarfs_file_read(struct file *file, char __user *userbuf,
> -		size_t count, loff_t *ppos)
> +static ssize_t efivarfs_file_read_iter(struct kiocb *iocb,
> +				       struct iov_iter *iter)

The efivars switch to read_iter should be a separate patch before
this one.

>  /**
> + * simple_read_iter_from_buffer - copy data from the buffer to user space
> + * @iocb: struct containing the file, the current position and other info
> + * @to: the user space buffer to read to
> + * @from: the buffer to read from
> + * @available: the size of the buffer
> + *
> + * The simple_read_iter_from_buffer() function reads up to @available bytes
> + * from the current buffer into the user space buffer.
> + *
> + * On success, the current buffer offset is advanced by the number of bytes
> + * read, or a negative value is returned on error.
> + **/
> +ssize_t simple_read_iter_from_buffer(struct kiocb *iocb, struct iov_iter *to,
> +				     const void *from, size_t available)

The addition of simple_read_iter_from_buffer should be another separate
patch, before efivars starts using it.

  reply	other threads:[~2017-08-11 10:21 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
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 [this message]
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=20170811102113.GC11531@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.