automake distdir.test fails because of an EPERM error
| Affects | Status | Importance | Assigned to | Milestone | |
|---|---|---|---|---|---|
| | eCryptfs |
Medium
|
Tyler Hicks | ||
| | linux (Ubuntu) |
Medium
|
Tyler Hicks | ||
| | Lucid |
Medium
|
Colin Ian King | ||
| | Natty |
Medium
|
Colin Ian King | ||
| | Oneiric |
Medium
|
Colin Ian King | ||
| | Precise |
Medium
|
Tyler Hicks | ||
Bug Description
Reported by Sebastien Bacher:
Run this:
$ apt-get source automake1.11 && cd automake1.11-1.11.1 && ./configure && make && cd tests && ./distdir.test
It will fail like so:
cp: cannot remove `distdir-
make[1]: *** [distdir] Error 1
It works on ext4. I've reproduced it in Precise (3.2.0.12.12) and upstream (3.3-rc2) kernels.
| Changed in linux (Ubuntu): | |
| status: | New → Confirmed |
| importance: | Undecided → Medium |
| assignee: | nobody → Tyler Hicks (tyhicks) |
| Changed in linux (Ubuntu Precise): | |
| milestone: | none → ubuntu-12.04-beta-1 |
| tags: | added: rls-p-tracking |
| Changed in ecryptfs: | |
| status: | Confirmed → In Progress |
| Tyler Hicks (tyhicks) wrote : | #1 |
| Changed in linux (Ubuntu Precise): | |
| milestone: | ubuntu-12.04-beta-1 → ubuntu-12.04-beta-2 |
| Tyler Hicks (tyhicks) wrote : | #2 |
Released upstream in 3.3-rc4: http://
| Changed in ecryptfs: | |
| status: | In Progress → Fix Released |
| tags: | added: precise |
| Leann Ogasawara (leannogasawara) wrote : | #3 |
I've gone ahead and cherry-picked this for Precise and applied to master-next. Fix should be available in the first upload after Beta-1. Thanks.
| Changed in linux (Ubuntu Precise): | |
| status: | Confirmed → Fix Committed |
| Colin Ian King (colin-king) wrote : | #4 |
Oneiric SRU justification:
Impact:
After passing through a ->setxattr() call, eCryptfs needs to copy the
inode attributes from the lower inode to the eCryptfs inode, as they
may have changed in the lower filesystem's ->setxattr() path.
One example is if an extended attribute containing a POSIX Access
Control List is being set. The new ACL may cause the lower filesystem to
modify the mode of the lower inode and the eCryptfs inode would need to
be updated to reflect the new mode.
Fix:
Upstream commit 545d680938be1e8
Testcase:
http://
| Changed in linux (Ubuntu Oneiric): | |
| importance: | Undecided → Medium |
| assignee: | nobody → Colin King (colin-king) |
| status: | New → In Progress |
| Changed in linux (Ubuntu Lucid): | |
| status: | New → Confirmed |
| Changed in linux (Ubuntu Natty): | |
| status: | New → Confirmed |
| Changed in linux (Ubuntu Lucid): | |
| importance: | Undecided → Medium |
| Changed in linux (Ubuntu Natty): | |
| importance: | Undecided → Medium |
| Luis Henriques (henrix) wrote : | #5 |
This bug is awaiting verification that the kernel for Oneiric in -proposed solves the problem ( 3.0.0-17.30). Please test the kernel and update this bug with the results. If the problem is solved, change the tag 'verification-
If verification is not done by one week from today, this fix will be dropped from the source code, and this bug will be closed.
See https:/
| tags: | added: verification-needed-oneiric |
| Changed in linux (Ubuntu Lucid): | |
| status: | Confirmed → Fix Committed |
| Changed in linux (Ubuntu Natty): | |
| status: | Confirmed → Fix Committed |
| Changed in linux (Ubuntu Oneiric): | |
| status: | In Progress → Fix Committed |
| Changed in linux (Ubuntu Natty): | |
| assignee: | nobody → Colin King (colin-king) |
| Changed in linux (Ubuntu Lucid): | |
| assignee: | nobody → Colin King (colin-king) |
| Colin Ian King (colin-king) wrote : | #6 |
Verified with ecryptfs lower on ext2, ext3, ext4, xfs and btrfs for Oneiric -proposed.
| tags: |
added: verification-done-oneiric removed: verification-needed-oneiric |
| Sergio Peña (sergio-pena) wrote : | #7 |
Verified on Oneiric.
I had this issue when copying a directory into eCryptfs using 'cp -Rp' command. '-p' option was causing the issue of the permissions.
I tested the oneiric-proposed kernel and it is working fine, permissions are copied correctly.
| Tim Gardner (timg-tpi) wrote : | #8 |
Released in 3.2.0-18.28. I verified the failure no longer occurs.
| Changed in linux (Ubuntu Precise): | |
| status: | Fix Committed → Fix Released |
| Launchpad Janitor (janitor) wrote : | #9 |
This bug was fixed in the package linux - 3.0.0-17.30
---------------
linux (3.0.0-17.30) oneiric-proposed; urgency=low
[Luis Henriques]
* Release Tracking Bug
- LP: #949882
[ Andy Whitcroft ]
* [Config] restore build-% shortcut
[ Stefan Bader ]
* (config) Fix virtual flavour inclusion of xen-kbdfront
- LP: #944582
[ Upstream Kernel Changes ]
* readahead: fix pipeline break caused by block plug
- LP: #931719
* ALSA: HDA: Fix duplicated output to more than one codec
- LP: #924320, #931719
* ASoC: wm_hubs: Enable line out VMID buffer for single ended line
outputs
- LP: #931719
* ASoC: wm_hubs: fix wrong bits for LINEOUT2 N/P mixer
- LP: #931719
* ARM: 7306/1: vfp: flush thread hwstate before restoring context from
sigframe
- LP: #931719
* ARM: 7307/1: vfp: fix ptrace regset modification race
- LP: #931719
* ARM: 7308/1: vfp: flush thread hwstate before copying ptrace registers
- LP: #931719
* ARM: OMAP2+: GPMC: fix device size setup
- LP: #931719
* drivers/
- LP: #931719
* proc: mem_release() should check mm != NULL
- LP: #931719
* proc: unify mem_read() and mem_write()
- LP: #931719
* proc: make sure mem_open() doesn't pin the target's memory
- LP: #931719
* firewire: ohci: add reset packet quirk for SB Audigy
- LP: #931719
* firewire: ohci: disable MSI on Ricoh controllers
- LP: #931719
* IB/mlx4: pass SMP vendor-specific attribute MADs to firmware
- LP: #931719
* kprobes: fix a memory leak in function pre_handler_
- LP: #931719
* at_hdmac: bugfix for enabling channel irq
- LP: #931719
* mm/filemap_xip.c: fix race condition in xip_file_fault()
- LP: #931719
* mm: compaction: check pfn_valid when entering a new MAX_ORDER_NR_PAGES
block during isolation for migration
- LP: #931719
* drm/radeon: Set DESKTOP_HEIGHT register to the framebuffer (not mode)
height.
- LP: #931719
* drm/nouveau/gem: fix fence_sync race / oops
- LP: #931719
* drm/radeon/kms: disable output polling when suspended
- LP: #931719
* sched/rt: Fix task stack corruption under
__ARCH_
- LP: #931719
* ASoC: Ensure we generate a driver name
- LP: #931719
* udf: Mark LVID buffer as uptodate before marking it dirty
- LP: #931719
* drm/i915: HDMI hot remove notification to audio driver
- LP: #931719
* drm/i915: DisplayPort hot remove notification to audio driver
- LP: #931719
* drm/i915: check ACTHD of all rings
- LP: #931719
* drm/i915: Fix TV Out refresh rate.
- LP: #931719
* drm/i915: handle 3rd pipe
- LP: #931719
* eCryptfs: Infinite loop due to overflow in ecryptfs_write()
- LP: #931719
* cifs: Fix oops in session setup code for null user mounts
- LP: #931719
* atmel_lcdfb: fix usage of CONTRAST_CTR in suspend/resume
- LP: #931719
* lockdep, bug: Exclude TAINT_FIRMWARE_
- LP: #931719
* hwmon: (w83627ehf) Fix number of fans for NCT6776F
- LP: #931719
* ASoC: wm_hubs: Fix routing of input PGAs to li...
| Changed in linux (Ubuntu Oneiric): | |
| status: | Fix Committed → Fix Released |
| Changed in linux (Ubuntu Lucid): | |
| status: | Fix Committed → Fix Released |
| Changed in linux (Ubuntu Natty): | |
| status: | Fix Committed → Fix Released |


This was a hard one to track down but an easy one to fix. The make distcheck command was having difficulty with this:
find "distdir-1.0" -type d ! -perm -200 -exec chmod u+w {} ';' && rm -rf "distdir-1.0"
That find command fixes up directory permissions to make sure that they're writeable before trying to recursively delete the directory tree. I discovered that the chmod wasn't happening because when the find program stat'ed the directories, they showed up as writable. But then, strangely, the `rm -rf` failed with a permissions error.
After a lot of debugging to discover that the upper and lower inode's i_mode were getting out of sync somewhere, I then discovered that it was during a setxattr() call on the "system. posix_acl_ access" extended attribute. If the lower filesystem modified the inode's i_mode because of a new POSIX ACL being created, eCryptfs was not mirroring those changes back up to the eCryptfs inode.
So, a subsequent stat on the eCryptfs inode could end up lying about the write permissions, causing find to never chmod the inode. But the lack of write permissions was, of course, enforced by the lower filesystem, resulting in the failed `rm -rf`.
Proposed fix posted here:
http:// article. gmane.org/ gmane.comp. file-systems. ecryptfs. general/ 139
Test case pushed here:
http:// bazaar. launchpad. net/~ecryptfs/ ecryptfs/ trunk/revision/ 640
Since it is a trivial fix, I went ahead and pushed it to the eCryptfs -next branch and I plan on getting into Linus' tree soon.