Skip to content

Commit

Permalink
eCryptfs: fix possible fault in ecryptfs_sync_page
Browse files Browse the repository at this point in the history
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>
Acked-by: Michael Halcrow <mhalcrow@us.ibm.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  • Loading branch information
Ryusuke Konishi authored and Linus Torvalds committed Aug 31, 2007
1 parent 85787a2 commit 2aeb3db
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion fs/ecryptfs/mmap.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 2aeb3db

Please sign in to comment.