remounting directory with different password causes files to disappear
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_
It's then unmounted and remounted with the incorrect password "p2"
user $ sudo mount -t ecryptfs -o ecryptfs_
Filename Encryption Key (FNEK) Signature [8881b0fa275cbafa]:
Attempting to mount with the following options:
ecryptfs_
ecryptfs_
ecryptfs_
ecryptfs_
ecryptfs_
WARNING: Based on the contents of [/root/
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/
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.