inotify DELETE_SELF notification disappears on ecryptfs mount

Bug #723518 reported by Jean-Paul Calderone on 2011-02-23
14
This bug affects 2 people
Affects Status Importance Assigned to Milestone
eCryptfs
Medium
Tyler Hicks
ecryptfs-utils (Ubuntu)
Medium
Unassigned
Lucid
Undecided
Unassigned
Natty
Undecided
Unassigned
linux (Ubuntu)
Medium
Unassigned
Lucid
Medium
Colin Ian King
Natty
Medium
Colin Ian King

Bug Description

Binary package hint: ecryptfs-utils

The IN_DELETE_SELF mask for inotify_add_watch indicates that an event should be emitted when the watched path is deleted. The attached program uses this feature successfully on a "normal" filesystem (eg ext3). When run in an ecryptfs mount however, the notification never appears and the program hangs indefinitely.

Tested using a brand new ecryptfs mount, created using:

  $ mkdir ecryptfs-source
  $ mkdir ecryptfs-dest
  $ sudo mount -t ecryptfs ecrypt-source/ ecrypt-dest/
  [ select defaults ]

Then run the program with ecrypt-dest as the working directory.

ProblemType: Bug
Architecture: i386
Date: Tue Feb 22 22:30:18 2011
DistroRelease: Ubuntu 9.10
NonfreeKernelModules: nvidia
Package: libecryptfs0 81-0ubuntu3
ProcEnviron:
 LANGUAGE=en_US.UTF-8
 PATH=(custom, user)
 LANG=en_US.UTF-8
 SHELL=/bin/bash
ProcVersionSignature: Ubuntu 2.6.31-22.70-generic-pae
SourcePackage: ecryptfs-utils
Uname: Linux 2.6.31-22-generic-pae i686

Jean-Paul Calderone (exarkun) wrote :
Dustin Kirkland  (kirkland) wrote :

Thanks for the interesting bug report.

I personally have not yet tried inotify on an ecryptfs directory, but that does sound like a reasonable use case.

I'm copying this bug upstream. Tyler, have you ever tested inotify events on an ecryptfs mount?

Changed in ecryptfs:
importance: Undecided → Medium
Changed in ecryptfs-utils (Ubuntu):
importance: Undecided → Medium
Changed in ecryptfs:
status: New → Incomplete
Changed in ecryptfs-utils (Ubuntu):
status: New → Incomplete
Tyler Hicks (tyhicks) wrote :

I was hoping that some recent eCryptfs changes solved this inotify bug, but that doesn't seem to be the case with 2.6.39-rc5+.

Marking this confirmed, as I'm still not quite sure what eCryptfs is doing wrong.

Changed in ecryptfs:
assignee: nobody → Tyler Hicks (tyhicks)
status: Incomplete → Confirmed
Tyler Hicks (tyhicks) wrote :

I've pushed a fix for this to the eCryptfs -next branch and plan on trying to get it into 2.6.39-rc6. I'll attach it here for completeness.

Changed in ecryptfs:
status: Confirmed → Fix Committed
Tyler Hicks (tyhicks) wrote :
tags: added: patch
Tyler Hicks (tyhicks) wrote :

The fix for this will be released in 2.6.40-rc1:

http://git.kernel.org/linus/07850552b92b3637fa56767b5e460b4238014447

Changed in ecryptfs:
status: Fix Committed → Fix Released
Changed in ecryptfs-utils (Ubuntu):
status: Incomplete → Fix Released
Colin Ian King (colin-king) wrote :

Lucid SRU Justification:

The IN_DELETE_SELF mask for inotify_add_watch indicates that an event
should be emitted when the watched path is deleted, however, this does
not happen on an eCryptfs mount.

To reproduce:

mkdir upper lower
sudo mount -t ecryptfs lower upper

and compile and run the following test program in the upper directory:

https://launchpadlibrarian.net/64953109/inotify.c

This test program hangs waiting for the IN_DELETE_SELF event that never
occurs.

Herton R. Krzesinski (herton) wrote :

This bug is awaiting verification that the kernel for Natty in -proposed solves the problem (2.6.38-13.57). Please test the kernel and update this bug with the results. If the problem is solved, change the tag 'verification-needed-natty' to 'verification-done-natty'.

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!

Changed in linux (Ubuntu):
status: New → Fix Released
importance: Undecided → Medium
Changed in linux (Ubuntu Natty):
status: New → Fix Committed
importance: Undecided → Medium
assignee: nobody → Colin King (colin-king)
tags: added: verification-needed-natty
Colin Ian King (colin-king) wrote :

Tested and verified working for Natty -proposed i386

tags: added: verification-done-natty
removed: verification-needed-natty
Herton R. Krzesinski (herton) wrote :

The commit for this issue in Lucid is an early application of a commit that will be coming in via upstream stable (2.6.32.58). As such it is not subject to the standard bug verification process.

tags: added: verification-done-lucid
Changed in linux (Ubuntu Lucid):
status: New → Fix Committed
importance: Undecided → Medium
assignee: nobody → Colin King (colin-king)
Colin Ian King (colin-king) wrote :

Tested and verified working for Lucid -proposed i386 2.6.32-40.87

Launchpad Janitor (janitor) wrote :

This bug was fixed in the package linux - 2.6.38-13.57

---------------
linux (2.6.38-13.57) natty-proposed; urgency=low

  [Herton R. Krzesinski]

  * Release Tracking Bug
    - LP: #947254

  [ Upstream Kernel Changes ]

  * KVM: Device assignment permission checks
    - LP: #897812
    - CVE-2011-4347
  * HID: hid-apple: add device ID of another wireless aluminium
    - LP: #942184
  * eCryptfs: Extend array bounds for all filename chars
    - LP: #944990
  * eCryptfs: Remove extra d_delete in ecryptfs_rmdir
    - LP: #723518
  * eCryptfs: Clear i_nlink in rmdir
    - LP: #723518
  * ipc/sem.c: fix race with concurrent semtimedop() timeouts and IPC_RMID
    - LP: #943815
  * eCryptfs: Sanitize write counts of /dev/ecryptfs
    - LP: #947075
  * eCryptfs: Infinite loop due to overflow in ecryptfs_write()
    - LP: #947143
 -- Herton Ronaldo Krzesinski <email address hidden> Mon, 05 Mar 2012 13:28:11 -0300

Changed in linux (Ubuntu Natty):
status: Fix Committed → Fix Released
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package linux - 2.6.32-40.87

---------------
linux (2.6.32-40.87) lucid-proposed; urgency=low

  [Herton R. Krzesinski]

  * Release Tracking Bug
    - LP: #947375

  [ Upstream Kernel Changes ]

  * IB/mlx4: pass SMP vendor-specific attribute MADs to firmware
    - LP: #932043
  * mm/filemap_xip.c: fix race condition in xip_file_fault()
    - LP: #932043
  * NFSv4: Fix up the callers of nfs4_state_end_reclaim_reboot
    - LP: #932043
  * NFSv4: The state manager shouldn't exit on errors that were handled
    - LP: #932043
  * NFSv4: Ensure the state manager handles NFS4ERR_NO_GRACE correctly
    - LP: #932043
  * NFSv4: Handle NFS4ERR_GRACE when recovering an expired lease.
    - LP: #932043
  * NFSv4: Fix open recovery
    - LP: #932043
  * rpc client can not deal with ENOSOCK, so translate it into ENOCONN
    - LP: #932043
  * udf: Mark LVID buffer as uptodate before marking it dirty
    - LP: #932043
  * eCryptfs: Infinite loop due to overflow in ecryptfs_write()
    - LP: #932043
  * atmel_lcdfb: fix usage of CONTRAST_CTR in suspend/resume
    - LP: #932043
  * Staging: asus_oled: fix image processing
    - LP: #932043
  * Staging: android: binder: Don't call dump_stack in binder_vma_open
    - LP: #932043
  * Staging: android: binder: Fix crashes when sharing a binder file
    between processes
    - LP: #932043
  * usb: gadget: zero: fix bug in loopback autoresume handling
    - LP: #932043
  * usb: Skip PCI USB quirk handling for Netlogic XLP
    - LP: #932043
  * USB: usbserial: add new PID number (0xa951) to the ftdi driver
    - LP: #932043
  * mmc: cb710 core: Add missing spin_lock_init for irq_lock of struct
    cb710_chip
    - LP: #932043
  * net: fix sk_forward_alloc corruptions
    - LP: #932043
  * net: sock_queue_err_skb() dont mess with sk_forward_alloc
    - LP: #932043
  * Linux 2.6.32.57
    - LP: #932043
  * Ban ecryptfs over ecryptfs
    - LP: #932987
  * eCryptfs: Remove mmap from directory operations
    - LP: #400443
  * eCryptfs: Use notify_change for truncating lower inodes
    - LP: #451368
  * ecryptfs: read on a directory should return EISDIR if not supported
    - LP: #719691
  * eCryptfs: Remove extra d_delete in ecryptfs_rmdir
    - LP: #723518
  * eCryptfs: Clear i_nlink in rmdir
    - LP: #723518
  * KVM: Device assignment permission checks
    - LP: #897812
    - CVE-2011-4347
  * block: Fix io_context leak after clone with CLONE_IO
    - LP: #940743
    - CVE-2012-0879
  * block: Fix io_context leak after failure of clone with CLONE_IO
    - LP: #940743
    - CVE-2012-0879
  * eCryptfs: Handle failed metadata read in lookup
    - LP: #509180
  * drm/i915: Fix TV Out refresh rate.
    - LP: #945114
  * Linux 2.6.32.57+drm33.23
    - LP: #945114
 -- Herton Ronaldo Krzesinski <email address hidden> Mon, 05 Mar 2012 16:09:18 -0300

Changed in linux (Ubuntu Lucid):
status: Fix Committed → Fix Released
Rolf Leggewie (r0lf) wrote :

anything left to be done for ecryptfs-utils?

Changed in ecryptfs-utils (Ubuntu Lucid):
status: New → Incomplete
Tyler Hicks (tyhicks) on 2012-05-08
Changed in ecryptfs-utils (Ubuntu Lucid):
status: Incomplete → Fix Released
Changed in ecryptfs-utils (Ubuntu Natty):
status: New → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers