From: Michael Halcrow Date: Wed, 19 Nov 2008 23:36:28 +0000 (-0800) Subject: eCryptfs: Allocate up to two scatterlists for crypto ops on keys X-Git-Tag: v2.6.27.8~94 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c53459aa96901e6d21d69acff88fb77759edd3f7;p=pandora-kernel.git eCryptfs: Allocate up to two scatterlists for crypto ops on keys commit ac97b9f9a2d0b83488e0bbcb8517b229d5c9b142 upstream. I have received some reports of out-of-memory errors on some older AMD architectures. These errors are what I would expect to see if crypt_stat->key were split between two separate pages. eCryptfs should not assume that any of the memory sent through virt_to_scatterlist() is all contained in a single page, and so this patch allocates two scatterlist structs instead of one when processing keys. I have received confirmation from one person affected by this bug that this patch resolves the issue for him, and so I am submitting it for inclusion in a future stable release. Note that virt_to_scatterlist() runs sg_init_table() on the scatterlist structs passed to it, so the calls to sg_init_table() in decrypt_passphrase_encrypted_session_key() are redundant. Signed-off-by: Michael Halcrow Reported-by: Paulo J. S. Silva Cc: "Leon Woestenberg" Cc: Tim Gardner Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds Signed-off-by: Greg Kroah-Hartman --- Reading git-diff-tree failed