damaged filesystem if creating of file fails (space issue)

Bug #1001971 reported by kapetr on 2012-05-20
268
This bug affects 3 people
Affects Status Importance Assigned to Milestone
ecryptfs-utils (Ubuntu)
Undecided
Unassigned

Bug Description

I have encrypted home and I have filled it to 100% for just few minutes. (I just thing, that this is the space problem - I had correct the space problem quickly, but the create problem I see whole day ?!)

In this situation there were probably actions to create files, which failed with error in log:

------------------------------------------
May 20 07:05:30 zly-hugo kernel: [ 434.768335] ecryptfs_write_metadata_to_contents: Error attempting to write h
eader information to lower file; rc = [-28]
May 20 07:05:30 zly-hugo kernel: [ 434.768338] ecryptfs_write_metadata: Error writing metadata out to lower fil
e; rc = [-28]
May 20 07:05:30 zly-hugo kernel: [ 434.768340] Error writing headers; rc = [-28]

.....

May 20 14:07:13 zly-hugo kernel: [25700.254730] ecryptfs_create: Failed to create file inlower filesystem
May 20 14:07:13 zly-hugo kernel: [25700.254738] ecryptfs_do_create: Failure to create dentry in lower fs; rc = [
-17]

... syslog filled with these
---------------------------------------------

After reboot I have these error logs:

---------------------------------------
May 20 16:40:45 zly-hugo kernel: [ 8874.374502] Either the lower file is not in a valid eCryptfs format, or the key could not be retrieved. Plaintext passthrough mode is not enabled; returning -EIO
May 20 16:40:46 zly-hugo kernel: [ 8875.561495] Valid eCryptfs headers not found in file header region or xattr region, inode 264302

... many inodes in many many log entries
-----------------------------------------

I have test 5 inodes from this errors in log (put in aaaa file):

-----------------------------
hugo@zly-hugo:~$ cat aaaaa|while read a; do find ~ -inum $a -ls; done
264298 0 -rw-rw-r-- 1 hugo hugo 0 kvě 20 07:06 /home/hugo/.local/share/zeitgeist/fts.index/postlist.tmp
264302 0 -rw-r--r-- 1 hugo hugo 0 kvě 20 07:06 /home/hugo/.mozilla/firefox/ci0lj7xi.default/permissions.sqlite-journal
264424 0 -rw-r--r-- 1 hugo hugo 0 kvě 20 07:12 /home/hugo/.mozilla/firefox/ci0lj7xi.default/blocklist.xml
265031 0 -rw-r--r-- 1 hugo hugo 0 kvě 20 07:06 /home/hugo/.mozilla/firefox/ci0lj7xi.default/cookies.sqlite.bak
266772 0 -rw-r--r-- 1 hugo hugo 0 kvě 20 07:06 /home/hugo/.mozilla/firefox/ci0lj7xi.default/urlclassifier3.sqlite-journal
hugo@zly-hugo:~$
hugo@zly-hugo:~$
hugo@zly-hugo:~$
hugo@zly-hugo:~$ cat aaaaa|while read a; do find /home/hugo/../.ecryptfs/hugo/.Private/ -inum $a -ls; done
264298 0 -rw-rw-r-- 1 hugo hugo 0 kvě 20 07:06 /home/hugo/../.ecryptfs/hugo/.Private/ECRYPTFS_FNEK_ENCRYPTED.FWYv1oDJq8OI1kTm8wAzh7jLaEqz2CnWGcXQeFNsSPbpvY99d0ZsnzARGk--/ECRYPTFS_FNEK_ENCRYPTED.FWYv1oDJq8OI1kTm8wAzh7jLaEqz2CnWGcXQmnxxmAZJ4cFHeaYSk0TKHE--/ECRYPTFS_FNEK_ENCRYPTED.FWYv1oDJq8OI1kTm8wAzh7jLaEqz2CnWGcXQ7IAj3ncWLs9ze2W58uJZBU--/ECRYPTFS_FNEK_ENCRYPTED.FWYv1oDJq8OI1kTm8wAzh7jLaEqz2CnWGcXQdLQB3itzC7.utHQAmsoFaU--/ECRYPTFS_FNEK_ENCRYPTED.FWYv1oDJq8OI1kTm8wAzh7jLaEqz2CnWGcXQUpGMwznybRcx.89mXw6xqE--
264302 0 -rw-r--r-- 1 hugo hugo 0 kvě 20 07:06 /home/hugo/../.ecryptfs/hugo/.Private/ECRYPTFS_FNEK_ENCRYPTED.FWYv1oDJq8OI1kTm8wAzh7jLaEqz2CnWGcXQpYKbfInZMXlTUdNfW6bJTE--/ECRYPTFS_FNEK_ENCRYPTED.FWYv1oDJq8OI1kTm8wAzh7jLaEqz2CnWGcXQxGMJtE3avVLFu3PKK9UpPU--/ECRYPTFS_FNEK_ENCRYPTED.FXYv1oDJq8OI1kTm8wAzh7jLaEqz2CnWGcXQx18cFVTUqcMoNm85zDd4fvb1bh-vzHQxo8XSuVIb4Q--/ECRYPTFS_FNEK_ENCRYPTED.FXYv1oDJq8OI1kTm8wAzh7jLaEqz2CnWGcXQ3v0hIVuMcdguS0urwf0uO-90z0w92aHQI5c9zTZcMgo-
264424 0 -rw-r--r-- 1 hugo hugo 0 kvě 20 07:12 /home/hugo/../.ecryptfs/hugo/.Private/ECRYPTFS_FNEK_ENCRYPTED.FWYv1oDJq8OI1kTm8wAzh7jLaEqz2CnWGcXQpYKbfInZMXlTUdNfW6bJTE--/ECRYPTFS_FNEK_ENCRYPTED.FWYv1oDJq8OI1kTm8wAzh7jLaEqz2CnWGcXQxGMJtE3avVLFu3PKK9UpPU--/ECRYPTFS_FNEK_ENCRYPTED.FXYv1oDJq8OI1kTm8wAzh7jLaEqz2CnWGcXQx18cFVTUqcMoNm85zDd4fvb1bh-vzHQxo8XSuVIb4Q--/ECRYPTFS_FNEK_ENCRYPTED.FWYv1oDJq8OI1kTm8wAzh7jLaEqz2CnWGcXQXH77EwcoB7wX.66OCLxfME--
265031 0 -rw-r--r-- 1 hugo hugo 0 kvě 20 07:06 /home/hugo/../.ecryptfs/hugo/.Private/ECRYPTFS_FNEK_ENCRYPTED.FWYv1oDJq8OI1kTm8wAzh7jLaEqz2CnWGcXQpYKbfInZMXlTUdNfW6bJTE--/ECRYPTFS_FNEK_ENCRYPTED.FWYv1oDJq8OI1kTm8wAzh7jLaEqz2CnWGcXQxGMJtE3avVLFu3PKK9UpPU--/ECRYPTFS_FNEK_ENCRYPTED.FXYv1oDJq8OI1kTm8wAzh7jLaEqz2CnWGcXQx18cFVTUqcMoNm85zDd4fvb1bh-vzHQxo8XSuVIb4Q--/ECRYPTFS_FNEK_ENCRYPTED.FXYv1oDJq8OI1kTm8wAzh7jLaEqz2CnWGcXQkLHApfsdVhUfMbj-C0T-vGyi0LUz2wbrLVxa.zs2s1A-
266772 0 -rw-r--r-- 1 hugo hugo 0 kvě 20 07:06 /home/hugo/../.ecryptfs/hugo/.Private/ECRYPTFS_FNEK_ENCRYPTED.FWYv1oDJq8OI1kTm8wAzh7jLaEqz2CnWGcXQpYKbfInZMXlTUdNfW6bJTE--/ECRYPTFS_FNEK_ENCRYPTED.FWYv1oDJq8OI1kTm8wAzh7jLaEqz2CnWGcXQxGMJtE3avVLFu3PKK9UpPU--/ECRYPTFS_FNEK_ENCRYPTED.FXYv1oDJq8OI1kTm8wAzh7jLaEqz2CnWGcXQx18cFVTUqcMoNm85zDd4fvb1bh-vzHQxo8XSuVIb4Q--/ECRYPTFS_FNEK_ENCRYPTED.FXYv1oDJq8OI1kTm8wAzh7jLaEqz2CnWGcXQB.FsoI1L.NDJYxZmj8Q4TTA6tVNolf6nwi755adWaKc-
hugo@zly-hugo:~$
--------------------------------------------------

These (decrypted) files are not possible to change or delete .

I thing the problem is: It was created the hidden file but there was not space to fill in ecrypts header data.

IT SHOULD NOT HAPPEN ! The file should be created correctly or not at all (atomary operation).
Now is my file system damaged - e.g. Firefox try to read/modify these files but fails !

What to do ? Search and delete manually all zero-sized files in .Private ?

ProblemType: Bug
DistroRelease: Ubuntu 12.04
Package: libecryptfs0 96-0ubuntu3
ProcVersionSignature: Ubuntu 3.2.0-24.37-generic 3.2.14
Uname: Linux 3.2.0-24-generic x86_64
ApportVersion: 2.0.1-0ubuntu7
Architecture: amd64
Date: Sun May 20 16:40:08 2012
EcryptfsInUse: Yes
InstallationMedia: Ubuntu 12.04 LTS "Precise Pangolin" - Beta amd64 (20120401)
ProcEnviron:
 TERM=xterm
 PATH=(custom, no user)
 LANG=cs_CZ.UTF-8
 SHELL=/bin/bash
SourcePackage: ecryptfs-utils
UpgradeStatus: No upgrade log present (probably fresh install)

kapetr (kapetr) wrote :
visibility: private → public
Tyler Hicks (tyhicks) wrote :

Hi kapetr - This is a known issue that seems to have gotten worse in Precise. Addressing this bug is on my todo list for this week.

Marking this bug as duplicate of an earlier bug report.

kapetr (kapetr) wrote :

Thank you for info.

I have deleted these 5 "zero" files in .Private -> I hope it helps.
But there are other 13 "zero" files - should I delete them too ? Are all zero sized files
certainly invalid ?

Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in ecryptfs-utils (Ubuntu):
status: New → Confirmed
To post a comment you must log in.
This report contains Public Security information  Edit
Everyone can see this security related information.

Other bug subscribers