remounting directory with different password causes files to disappear

Bug #2023373 reported by eratosthenes
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
eCryptfs
New
Undecided
Unassigned

Bug Description

It is possible to mount an ecryptfs directory in a way that causes all files create/copied to that directory to silently disappear.

Although this involves a user-mistake, it could be possible to improve the experience by logging different warnings, or refusing to mount with the wrong password rather than have files silently disappear? I believe the files are actually being encrypted and stored under the hood, they just aren't listable or viewable any more.

The test "private" directory is initially set up the password "p1"
 sudo mount -t ecryptfs -o ecryptfs_cipher=aes,ecryptfs_key_bytes=16,ecryptfs_passthrough=no,ecryptfs_enable_filename_crypto=yes,passphrase_passwd=p1 private private

It's then unmounted and remounted with the incorrect password "p2"
user $ sudo mount -t ecryptfs -o ecryptfs_cipher=aes,ecryptfs_key_bytes=16,ecryptfs_passthrough=no,ecryptfs_enable_filename_crypto=yes,passphrase_passwd=p2 private private
Filename Encryption Key (FNEK) Signature [8881b0fa275cbafa]:
Attempting to mount with the following options:
  ecryptfs_unlink_sigs
  ecryptfs_fnek_sig=8881b0fa275cbafa
  ecryptfs_key_bytes=16
  ecryptfs_cipher=aes
  ecryptfs_sig=8881b0fa275cbafa
WARNING: Based on the contents of [/root/.ecryptfs/sig-cache.txt],
it looks like you have never mounted with this key
before. This could mean that you have typed your
passphrase wrong.

Would you like to proceed with the mount (yes/no)? : yes
Would you like to append sig [8881b0fa275cbafa] to
[/root/.ecryptfs/sig-cache.txt]
in order to avoid this warning in the future (yes/no)? : yes
Successfully appended new sig to user sig cache file
Mounted eCryptfs
user $ dd if=/dev/zero of=private/foo count=100
100+0 records in
100+0 records out
51200 bytes (51 kB, 50 KiB) copied, 0.00397164 s, 12.9 MB/s
user $ ls private
user $ ls

the file private/foo has silently been discarded.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.