automake distdir.test fails because of an EPERM error

Bug #926292 reported by Tyler Hicks
18
This bug affects 2 people
Affects Status Importance Assigned to Milestone
eCryptfs
Fix Released
Medium
Tyler Hicks
linux (Ubuntu)
Fix Released
Medium
Tyler Hicks
Lucid
Fix Released
Medium
Colin Ian King
Natty
Fix Released
Medium
Colin Ian King
Oneiric
Fix Released
Medium
Colin Ian King
Precise
Fix Released
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-1.0/another/sub/subsub/file2': Permission denied
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.

Tyler Hicks (tyhicks)
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
Tyler Hicks (tyhicks)
Changed in ecryptfs:
status: Confirmed → In Progress
Revision history for this message
Tyler Hicks (tyhicks) wrote :

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.

Changed in linux (Ubuntu Precise):
milestone: ubuntu-12.04-beta-1 → ubuntu-12.04-beta-2
Revision history for this message
Tyler Hicks (tyhicks) wrote :
Changed in ecryptfs:
status: In Progress → Fix Released
Brad Figg (brad-figg)
tags: added: precise
Revision history for this message
Leann Ogasawara (leannogasawara) wrote :

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
Revision history for this message
Colin Ian King (colin-king) wrote :

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 545d680938be1e86a6c5250701ce9abaf360c495

Testcase:

http://bazaar.launchpad.net/~ecryptfs/ecryptfs/trunk/revision/640

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
Revision history for this message
Luis Henriques (henrix) wrote :

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-needed-oneiric' to 'verification-done-oneiric'.

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://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Thank you!

tags: added: verification-needed-oneiric
Andy Whitcroft (apw)
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)
Revision history for this message
Colin Ian King (colin-king) wrote :

Verified with ecryptfs lower on ext2, ext3, ext4, xfs and btrfs for Oneiric -proposed.

tags: added: verification-done-oneiric
removed: verification-needed-oneiric
Revision history for this message
Sergio Peña (sergio-pena) wrote :

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.

Revision history for this message
Tim Gardner (timg-tpi) wrote :

Released in 3.2.0-18.28. I verified the failure no longer occurs.

Changed in linux (Ubuntu Precise):
status: Fix Committed → Fix Released
Revision history for this message
Launchpad Janitor (janitor) wrote :
Download full text (6.6 KiB)

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/tty/vt/vt_ioctl.c: fix KDFONTOP 32bit compatibility layer
    - 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_kretprobe()
    - 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_WANT_INTERRUPTS_ON_CTXSW
    - 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_WORKAROUND from disabling lockdep
    - LP: #931719
  * hwmon: (w83627ehf) Fix number of fans for NCT6776F
    - LP: #931719
  * ASoC: wm_hubs: Fix routing of input PGAs to li...

Read more...

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
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.