mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] eCryptfs: fix possible fault in ecryptfs_sync_page
@ 2007-08-23  7:42 Ryusuke Konishi
  2007-08-23 14:37 ` [Ecryptfs-devel] " Michael Halcrow
  0 siblings, 1 reply; 4+ messages in thread
From: Ryusuke Konishi @ 2007-08-23  7:42 UTC (permalink / raw)
  To: Michael Halcrow
  Cc: Andrew Morton, ecryptfs-devel, linux-kernel, moriai.satoshi

This will avoid a possible fault in ecryptfs_sync_page().

In the function, eCryptfs calls sync_page() method of a lower 
filesystem without checking its existence.  However, there 
are many filesystems that don't have this method including
network filesystems such as NFS, AFS, and so forth.
They may fail when an eCryptfs page is waiting for lock.

Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
---
 fs/ecryptfs/mmap.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/fs/ecryptfs/mmap.c b/fs/ecryptfs/mmap.c
index e4ab7bc..fd3f94d 100644
--- a/fs/ecryptfs/mmap.c
+++ b/fs/ecryptfs/mmap.c
@@ -834,7 +834,8 @@ static void ecryptfs_sync_page(struct page *page)
 		ecryptfs_printk(KERN_DEBUG, "find_lock_page failed\n");
 		return;
 	}
-	lower_page->mapping->a_ops->sync_page(lower_page);
+	if (lower_page->mapping->a_ops->sync_page)
+		lower_page->mapping->a_ops->sync_page(lower_page);
 	ecryptfs_printk(KERN_DEBUG, "Unlocking page with index = [0x%.16x]\n",
 			lower_page->index);
 	unlock_page(lower_page);

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2007-08-24  2:34 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-08-23  7:42 [PATCH] eCryptfs: fix possible fault in ecryptfs_sync_page Ryusuke Konishi
2007-08-23 14:37 ` [Ecryptfs-devel] " Michael Halcrow
2007-08-23 14:52   ` Erez Zadok
2007-08-24  2:33   ` Ryusuke Konishi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®