Skip to content
Commit 1984c23f authored by Tyler Hicks's avatar Tyler Hicks
Browse files

eCryptfs: Clear buffer before reading in metadata xattr



We initially read in the first PAGE_CACHE_SIZE of a file to if the
eCryptfs header marker can be found.  If it isn't found and
ecryptfs_xattr_metadata was given as a mount option, then the
user.ecryptfs xattr is read into the same buffer.  Since the data from
the first page of the file wasn't cleared, it is possible that we think
we've found a second tag 3 or tag 1 packet and then error out after the
packet contents aren't as expected.  This patch clears the buffer before
filling it with metadata from the user.ecryptfs xattr.

Reviewed-by: default avatarEric Sandeen <sandeen@redhat.com>
Signed-off-by: default avatarTyler Hicks <tyhicks@linux.vnet.ibm.com>
parent fa3ef1cb
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment