android_kernel_xiaomi_sm8350/fs/ecryptfs
Eric Sandeen 7fcba05437 eCryptfs: use page_alloc not kmalloc to get a page of memory
With SLUB debugging turned on in 2.6.26, I was getting memory corruption
when testing eCryptfs.  The root cause turned out to be that eCryptfs was
doing kmalloc(PAGE_CACHE_SIZE); virt_to_page() and treating that as a nice
page-aligned chunk of memory.  But at least with SLUB debugging on, this
is not always true, and the page we get from virt_to_page does not
necessarily match the PAGE_CACHE_SIZE worth of memory we got from kmalloc.

My simple testcase was 2 loops doing "rm -f fileX; cp /tmp/fileX ." for 2
different multi-megabyte files.  With this change I no longer see the
corruption.

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Acked-by: Michael Halcrow <mhalcrow@us.ibm.com>
Acked-by: Rik van Riel <riel@redhat.com>
Cc: <stable@kernel.org>		[2.6.25.x, 2.6.26.x]
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2008-07-28 16:30:21 -07:00
..
crypto.c eCryptfs: use page_alloc not kmalloc to get a page of memory 2008-07-28 16:30:21 -07:00
debug.c
dentry.c
ecryptfs_kernel.h eCryptfs: Make all persistent file opens delayed 2008-07-24 10:47:31 -07:00
file.c eCryptfs: Make all persistent file opens delayed 2008-07-24 10:47:31 -07:00
inode.c [PATCH] kill nameidata passing to permission(), rename to inode_permission() 2008-07-26 20:53:31 -04:00
keystore.c ecryptfs: propagate key errors up at mount time 2008-07-24 10:47:31 -07:00
kthread.c eCryptfs: Privileged kthread for lower file opens 2008-07-24 10:47:30 -07:00
main.c SL*B: drop kmem cache argument from constructor 2008-07-26 12:00:07 -07:00
Makefile eCryptfs: Privileged kthread for lower file opens 2008-07-24 10:47:30 -07:00
messaging.c eCryptfs: make key module subsystem respect namespaces 2008-04-29 08:06:07 -07:00
miscdev.c ecryptfs: discard ecryptfsd registration messages in miscdev 2008-07-24 10:47:31 -07:00
mmap.c ecryptfs: inode.c mmap.c use unaligned byteorder helpers 2008-07-24 10:47:31 -07:00
netlink.c eCryptfs: make key module subsystem respect namespaces 2008-04-29 08:06:07 -07:00
read_write.c eCryptfs: remove unnecessary page decrypt call 2008-06-06 11:29:09 -07:00
super.c