]> git.karo-electronics.de Git - karo-tx-linux.git/commit
eCryptfs: Allow 2 scatterlist entries for encrypted filenames
authorTyler Hicks <tyhicks@linux.vnet.ibm.com>
Tue, 17 May 2011 05:50:33 +0000 (00:50 -0500)
committerGreg Kroah-Hartman <gregkh@suse.de>
Thu, 23 Jun 2011 22:24:04 +0000 (15:24 -0700)
commitee4a3a8203eea2970e2347e2aaf2ba04c0116fff
tree331aec86a345a0149a75d36b172551bac6c1421d
parent773b9883429d1ef9d3b6df50ac8e78b092889603
eCryptfs: Allow 2 scatterlist entries for encrypted filenames

commit 8d08dab786ad5cc2aca2bf870de370144b78c85a upstream.

The buffers allocated while encrypting and decrypting long filenames can
sometimes straddle two pages. In this situation, virt_to_scatterlist()
will return -ENOMEM, causing the operation to fail and the user will get
scary error messages in their logs:

kernel: ecryptfs_write_tag_70_packet: Internal error whilst attempting
to convert filename memory to scatterlist; expected rc = 1; got rc =
[-12]. block_aligned_filename_size = [272]
kernel: ecryptfs_encrypt_filename: Error attempting to generate tag 70
packet; rc = [-12]
kernel: ecryptfs_encrypt_and_encode_filename: Error attempting to
encrypt filename; rc = [-12]
kernel: ecryptfs_lookup: Error attempting to encrypt and encode
filename; rc = [-12]

The solution is to allow up to 2 scatterlist entries to be used.

Signed-off-by: Tyler Hicks <tyhicks@linux.vnet.ibm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
fs/ecryptfs/keystore.c