public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@osdl.org>
To: Michael Halcrow <mhalcrow@us.ibm.com>
Cc: linux-kernel@vger.kernel.org, tshighla@us.ibm.com, theotso@us.ibm.com
Subject: Re: [PATCH 3/3] eCryptfs: Encrypted passthrough
Date: Tue, 9 Jan 2007 14:42:03 -0800	[thread overview]
Message-ID: <20070109144203.ce1ed092.akpm@osdl.org> (raw)
In-Reply-To: <20070109222337.GF16578@us.ibm.com>

On Tue, 9 Jan 2007 16:23:37 -0600
Michael Halcrow <mhalcrow@us.ibm.com> wrote:

> +				page_virt = (char *)kmap(page);

Do we _have_ to use kmap here?  It's slow and theoretically deadlocky. 
kmap_atomic() is much preferred.

Can the other kmap() calls in ecryptfs be converted?

We'd actually like to remove kmap() one day.  Not much chance of that, but
it's an objective.

> +				if (!page_virt) {
> +					rc = -ENOMEM;
> +					printk(KERN_ERR "Error mapping page\n");
> +					goto out;
> +				}
> +				memset(page_virt, 0, PAGE_CACHE_SIZE);
> +				if (page->index == 0) {
> +					rc = ecryptfs_read_xattr_region(
> +						page_virt, file->f_path.dentry);

Are we assured that ecryptfs_read_xattr_region() cannot overrun the page?

> +					set_header_info(page_virt, crypt_stat);
> +				}

The kernel must always run flush_dcache_page() after modifying a pagecache
page by hand.  Please review all of ecryptfs for this.


> +				kunmap(page);

  reply	other threads:[~2007-01-09 22:45 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-01-09 22:21 [PATCH 0/3] eCryptfs: Support metadata in xattr Michael Halcrow
2007-01-09 22:22 ` [PATCH 1/3] eCryptfs: xattr flags and mount options Michael Halcrow
2007-01-09 22:22 ` [PATCH 2/3] eCryptfs: Generalize metadata read/write Michael Halcrow
2007-01-09 22:31   ` Andrew Morton
2007-01-09 22:23 ` [PATCH 3/3] eCryptfs: Encrypted passthrough Michael Halcrow
2007-01-09 22:42   ` Andrew Morton [this message]
2007-01-09 23:44     ` Michael Halcrow
2007-01-09 22:35 ` [PATCH 0/3] eCryptfs: Support metadata in xattr Andrew Morton
2007-01-09 23:23   ` Michael Halcrow

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=20070109144203.ce1ed092.akpm@osdl.org \
    --to=akpm@osdl.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mhalcrow@us.ibm.com \
    --cc=theotso@us.ibm.com \
    --cc=tshighla@us.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