Corrupted files with ecryptfs (filesize is multiple of 4k)

Reported by Till W. on 2010-12-13
This bug affects 2 people
Affects Status Importance Assigned to Milestone
ecryptfs-utils (Ubuntu)

Bug Description

Binary package hint: ecryptfs-utils

I'm observing the following phenomenon on my system (Ubuntu 10.04, Dell laptop, encrypted home directory):

I have a large amount of small files (approx. 4500 files, ascii text, around 3kb filesize) unpacked from an tar.gz archive into a subfolder within my encrypted home directory. I run a parser program on those files and the parser will stop if any file does not conform to an expected syntax. I now have the effect that the parser runs successfully through all my logfiles on one day, while it stops and complains about corrupt files on the next day. I investigated the reported files and noticed that these files are in fact corrupt: their filesize is always a multiple of 4k (usually 12288 bytes) and they contain a lot of binary garbage after their real contents. Sometimes contents from other logfiles show up within the "garbage area".

The corrupt files are intact inside the tar.gz archive. So when I receive reports about corrupted logfiles I usually just delete all my logfiles, unpack the archive again, and then the parser runs without any errors. The logfiles are never written to on my system. The parser program just reads them.

I'm a bit unsure if this effect is really caused by ecryptfs, so I checked the following:
 - According to S.M.A.R.T. diagnostics my hard-drive is in perfect condition (0 read errors, 0 remapped sectors, 0 pending sectors an so on).
 - A search for files which are multiple of 4k bytes in size *outside* of my home directory returned only files which are in fact that large.
 - A search for files which are multiple of 4k bytes in size *within* of my home directory returned some files which are obviously corrupted.
 - I ran fsck several times without getting any errors.
 - I looked into the logfiles of past boot-time fsck runs: no errors, too.

I also watched out for ecryptfs-related error messages in my system logfiles, but all I found was the following error which occurred only once (whereas I have several file corruptions within the last two weeks):

[10649.948257] ecryptfs_read_and_validate_header_region: Error reading header region; rc = [-4]

Is it possible that this file corruption is indeed caused by ecrpytfs? What can I do to further narrow down the source of the problem?

ProblemType: Bug
DistroRelease: Ubuntu 10.04
Package: ecryptfs-utils 83-0ubuntu3
ProcVersionSignature: Ubuntu 2.6.32-26.48-generic
Uname: Linux 2.6.32-26-generic i686
Architecture: i386
Date: Mon Dec 13 11:08:08 2010
EcryptfsInUse: Yes
InstallationMedia: Ubuntu 9.10 "Karmic Koala" - Release i386 (20091028.5)
 PATH=(custom, user)
SourcePackage: ecryptfs-utils

Till W. (tillw.) wrote :
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers