ecryptfs_fnek_sig missing when login at the same time on cron session close
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
eCryptfs |
Fix Released
|
Medium
|
Dustin Kirkland | ||
ecryptfs-utils (Ubuntu) |
Fix Released
|
Medium
|
Dustin Kirkland | ||
Oneiric |
Fix Released
|
Medium
|
Unassigned | ||
Precise |
Fix Released
|
Medium
|
Unassigned | ||
Quantal |
Fix Released
|
Medium
|
Unassigned |
Bug Description
when login at the same time on cron session close, ecryptfs directory will not be decrypted properly.
[IMPACT]
* folder/file names created by users at the session are unencrypted
* in desktop session, xdg-user-
"Desktop", "Download", etc. with unencrypted folder names
even if encrypted folders with the same name exist.
On the next login, unencrypted one will be shown with empty content,
so users feel all data was lost, in spite of actual data is in encrypted one.
* Reproduced on Oneiric through Quantal
Bug #623708 has quite similar symptom.
[Test Case]
1. Install ecryptfs-utils and expect
$ sudo apt-get install ecryptfs-utils expect
2. Create user 'foo', with encrypted home, and password 'ubuntu'
$ sudo adduser --encrypt-home foo
3. Download the lp1052038-test expect script from the bug attachments
4. In terminal 1, run lp1052038-test in a loop that watches for the eCryptfs encrypted
filename prefix
$ false ; while [[ $? -ne 0 ]]; do \
sudo lp1052038-test | grep ECRYPTFS_
5. In terminal 2, run a loop that su's from root to user foo. This is the loop that
will trigger the race condition and cause the loop in terminal 1 to end due to
encrypted filenames being detected.
$ while ((1)); do sudo su - foo -c 'sleep 0.1s' ; done
The expected result is that the loops in terminal 1 and terminal 2 will run forever.
The buggy result is that the loop in terminal 1 will end with
ECRYPTFS_
happens within 15 seconds, from my experience.
[Regression Potential]
The regression potential is that a user cannot properly access his/her encrypted home
directory. This would be a serious regression and I've done extensive testing on
Oneiric, Precise, and Quantal to be sure that this will not happen. I've also tested
the lesser used encrypted ~/Private use case, as well as the use case where filenames
are not encrypted but the file contents are encrypted.
[Other Info]
Bug reporter's original reproducer instructions:
1. setup a home directory encrypted with ecryptfs
2. set cron job of a user,
for example, just sleeping for 1 minutes
/etc/
"*/2 * * * * user1 sleep 1m"
3. login at the same time on cron session closed
for example, login near 00 second in odd minute.
==========
Sep 17 23:32:56 ecryptfs-test login[6019]: pam_ecryptfs: Passphrase file wrapped
Sep 17 23:33:01 ecryptfs-test CRON[6003]: pam_unix(
Sep 17 23:33:02 ecryptfs-test login[6012]: pam_unix(
==========
Expected results:
home directory mounted properly
* mount -l
/home/
* keyctl show
Session Keyring
-3 --alswrv 1000 -1 keyring: _uid_ses.1000
311854780 --alswrv 1000 -1 \_ keyring: _uid.1000
110408274 --alswrv 1000 0 \_ user: 9cb9226b29f1b007
923006627 --alswrv 1000 0 \_ user: ab224e5125be6655
Actual results:
home directory mounted without folder/file names are decrypted
* mount -l
/home/
* keyctl show
Session Keyring
-3 --alswrv 1000 -1 keyring: _uid_ses.1000
311854780 --alswrv 1000 -1 \_ keyring: _uid.1000
71413043 --alswrv 1000 0 \_ user: ab224e5125be6655
ProblemType: Bug
DistroRelease: Ubuntu 12.04
Package: ecryptfs-utils 96-0ubuntu3
ProcVersionSign
Uname: Linux 3.2.0-30-generic x86_64
ApportVersion: 2.0.1-0ubuntu13
Architecture: amd64
Date: Tue Sep 18 00:21:00 2012
InstallationMedia: Ubuntu 12.04.1 LTS "Precise Pangolin" - Release amd64 (20120823.1)
ProcEnviron:
TERM=screen-bce
LANG=ja_JP.UTF-8
SHELL=/bin/bash
SourcePackage: ecryptfs-utils
UpgradeStatus: No upgrade log present (probably fresh install)
Changed in ecryptfs-utils (Ubuntu Precise): | |
status: | In Progress → New |
assignee: | Chris J Arges (christopherarges) → nobody |
Changed in ecryptfs-utils (Ubuntu Oneiric): | |
status: | New → Triaged |
Changed in ecryptfs-utils (Ubuntu Precise): | |
status: | New → Triaged |
Changed in ecryptfs-utils (Ubuntu Quantal): | |
status: | New → Triaged |
Changed in ecryptfs-utils (Ubuntu Oneiric): | |
importance: | Undecided → Medium |
Changed in ecryptfs-utils (Ubuntu Quantal): | |
importance: | Undecided → Medium |
Hi Nobuto - Thank you for the detailed bug report.
Can you please try to reproduce this issue with the ecryptfs-utils package from ppa:ecryptfs/ ecryptfs- utils-daily ? I think that revision 713 of upstream ecryptfs-utils may have fixed this, but I'm not certain. It was released in ecryptfs-utils-100, so Ubuntu 12.04 does not have that patch.
Thanks!