eCryptfs: Revert to a writethrough cache model

Bug #1034012 reported by Tim Gardner
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
linux (Ubuntu)
Fix Released
Undecided
Colin Ian King
Oneiric
Fix Released
Undecided
Colin Ian King
Precise
Fix Released
Undecided
Colin Ian King
Quantal
Fix Released
Undecided
Colin Ian King

Bug Description

    A change was made about a year ago to get eCryptfs to better utilize its
    page cache during writes. The idea was to do the page encryption
    operations during page writeback, rather than doing them when initially
    writing into the page cache, to reduce the number of page encryption
    operations during sequential writes. This meant that the encrypted page
    would only be written to the lower filesystem during page writeback,
    which was a change from how eCryptfs had previously wrote to the lower
    filesystem in ecryptfs_write_end().

    The change caused a few eCryptfs-internal bugs that were shook out.
    Unfortunately, more grave side effects have been identified that will
    force changes outside of eCryptfs. Because the lower filesystem isn't
    consulted until page writeback, eCryptfs has no way to pass lower write
    errors (ENOSPC, mainly) back to userspace. Additionaly, it was reported
    that quotas could be bypassed because of the way eCryptfs may sometimes
    open the lower filesystem using a privileged kthread.

    It would be nice to resolve the latest issues, but it is best if the
    eCryptfs commits be reverted to the old behavior in the meantime.

    This reverts:
    32001d6f "eCryptfs: Flush file in vma close"
    5be79de2 "eCryptfs: Flush dirty pages in setattr"
    57db4e8d "ecryptfs: modify write path to encrypt page in writepage"

Tim Gardner (timg-tpi)
Changed in linux (Ubuntu Quantal):
assignee: nobody → Colin King (colin-king)
status: New → Fix Committed
Changed in linux (Ubuntu Precise):
assignee: nobody → Colin King (colin-king)
status: New → In Progress
Changed in linux (Ubuntu Oneiric):
assignee: nobody → Colin King (colin-king)
status: New → In Progress
Tim Gardner (timg-tpi)
Changed in linux (Ubuntu Precise):
status: In Progress → Fix Committed
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package linux - 3.5.0-9.9

---------------
linux (3.5.0-9.9) quantal-proposed; urgency=low

  [ Daniel P. Berrange ]

  * SAUCE: (drop after 3.6) Forbid invocation of kexec_load() outside
    initial PID namespace
    - LP: #1034125

  [ Douglas Bagnall ]

  * SAUCE: Unlock the rc_dev lock when the raw device is missing
    - LP: #1015836

  [ Ike Panhc ]

  * [Config] Enable EDAC/CLK for highbank
    - LP: #1008345

  [ Leann Ogasawara ]

  * Revert "ubuntu: AUFS -- reenable"

  [ Rob Herring ]

  * SAUCE: net: calxedaxgmac: add write barriers around setting owner bit
    - LP: #1008345
  * SAUCE: ARM smp_twd: add back "arm,smp-twd" compatible property
    - LP: #1008345
  * SAUCE: ARM: highbank: add soft power and reset key event handling
    - LP: #1008345
  * SAUCE: ARM: highbank: use writel_relaxed variant for pwr requests
    - LP: #1008345
  * SAUCE: ahci: un-staticize ahci_dev_classify
    - LP: #1008345
  * SAUCE: ahci_platform: add custom hard reset for Calxeda ahci ctrlr
    - LP: #1008345

  [ Upstream Kernel Changes ]

  * rt2x00: Add support for BUFFALO WLI-UC-GNM2 to rt2800usb.
    - LP: #871904
  * Avoid sysfs oops when an rc_dev's raw device is absent
    - LP: #1015836
  * eCryptfs: Copy up POSIX ACL and read-only flags from lower mount
  * clk: add DT clock binding support
    - LP: #1008345
  * clk: add DT fixed-clock binding support
    - LP: #1008345
  * clk: add highbank clock support
  * edac: add support for Calxeda highbank memory controller
    - LP: #1008345
  * edac: add support for Calxeda highbank L2 cache ecc
    - LP: #1008345
  * net: calxedaxgmac: enable rx cut-thru mode
    - LP: #1008345
  * net: calxedaxgmac: fix hang on rx refill
    - LP: #1008345
  * eCryptfs: Revert to a writethrough cache model
    - LP: #1034012
  * eCryptfs: Initialize empty lower files when opening them
    - LP: #911507
  * eCryptfs: Unlink lower inode when ecryptfs_create() fails
    - LP: #872905
 -- Leann Ogasawara <email address hidden> Wed, 08 Aug 2012 08:39:42 -0700

Changed in linux (Ubuntu Quantal):
status: Fix Committed → Fix Released
Tim Gardner (timg-tpi)
Changed in linux (Ubuntu Oneiric):
status: In Progress → Fix Committed
Revision history for this message
Luis Henriques (henrix) wrote :

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

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

Tested with ext2,ext3,ext4,xfs and btrfs lower file systems, passed, Linux ubuntu 3.2.0-30-generic #47-Ubuntu SMP Wed Aug 15 19:30:10 UTC 2012 x86_64 x86_64 x86_64 GNU/Linux

sudo ./tests/run_tests.sh -K -c safe -b 1000000 -D /tmp/image -l /lower -u /upper -t enospc.sh -f ext2,ext3,ext4,xfs,btrfs
Running eCryptfs filesystem tests on ext2
enospc pass
Running eCryptfs filesystem tests on ext3
enospc pass
Running eCryptfs filesystem tests on ext4
enospc pass
Running eCryptfs filesystem tests on xfs
enospc pass
Running eCryptfs filesystem tests on btrfs
enospc pass

Test Summary:
5 passed
0 failed

tags: added: verification-done-precise
removed: verification-needed-precise
Revision history for this message
Launchpad Janitor (janitor) wrote :
Download full text (13.6 KiB)

This bug was fixed in the package linux - 3.2.0-30.48

---------------
linux (3.2.0-30.48) precise-proposed; urgency=low

  [Luis Henriques]

  * Release Tracking Bug
    - LP: #1041217

  [ Upstream Kernel Changes ]

  * mutex: Place lock in contended state after fastpath_lock failure
    - LP: #1041114

linux (3.2.0-30.47) precise-proposed; urgency=low

  [Luis Henriques]

  * Release Tracking Bug
    - LP: #1036581

  [ Andy Whitcroft ]

  * add support for generating binary device trees and install them in
    /lib/firmware
    - LP: #1030600
  * [Config] add dtb_file configuration for highbank
    - LP: #1030600

  [ Chris Van Hoof ]

  * SAUCE: dell-laptop: additional rfkill blacklist Dell XPS 13
    - LP: #1030957
  * [Config] Add cifs support to the nfs-modules list
    - LP: #1031398

  [ Daniel P. Berrange ]

  * SAUCE: (drop after 3.6) Forbid invocation of kexec_load() outside
    initial PID namespace
    - LP: #1034125

  [ Dann Frazier ]

  * [Config] Compile the rtc-pl031 driver builtin on the highbank kernel
    flavour
    - LP: #1035110

  [ Douglas Bagnall ]

  * SAUCE: Unlock the rc_dev lock when the raw device is missing
    - LP: #1015836

  [ Rob Herring ]

  * SAUCE: ARM: highbank: add soft power and reset key event handling
    - LP: #1033853
  * SAUCE: ARM: highbank: use writel_relaxed variant for pwr requests
    - LP: #1033853
  * SAUCE: ahci: un-staticize ahci_dev_classify
    - LP: #1033853
  * SAUCE: ahci_platform: add custom hard reset for Calxeda ahci ctrlr
    - LP: #1033853

  [ Stefan Bader ]

  * (pre-stable) KVM: VMX: Set CPU_BASED_RDPMC_EXITING for nested
    - LP: #1031090

  [ Tim Gardner ]

  * [Config] updateconfigs

  [ Upstream Kernel Changes ]

  * ideapad: generate valid key event only
    - LP: #1029834
  * mm: reduce the amount of work done when updating min_free_kbytes
    - LP: #1032640
  * mm: compaction: allow compaction to isolate dirty pages
    - LP: #1032640
  * mm: compaction: determine if dirty pages can be migrated without
    blocking within ->migratepage
    - LP: #1032640
  * mm: page allocator: do not call direct reclaim for THP allocations
    while compaction is deferred
    - LP: #1032640
  * mm: compaction: make isolate_lru_page() filter-aware again
    - LP: #1032640
  * mm: compaction: introduce sync-light migration for use by compaction
    - LP: #1032640
  * mm: vmscan: when reclaiming for compaction, ensure there are sufficient
    free pages available
    - LP: #1032640
  * mm: vmscan: do not OOM if aborting reclaim to start compaction
    - LP: #1032640
  * mm: vmscan: check if reclaim should really abort even if
    compaction_ready() is true for one zone
    - LP: #1032640
  * vmscan: promote shared file mapped pages
    - LP: #1032640
  * vmscan: activate executable pages after first usage
    - LP: #1032640
  * mm/vmscan.c: consider swap space when deciding whether to continue
    reclaim
    - LP: #1032640
  * mm: test PageSwapBacked in lumpy reclaim
    - LP: #1032640
  * mm: vmscan: convert global reclaim to per-memcg LRU lists
    - LP: #1032640
  * cpuset: mm: reduce large amounts of memory barrier related damage v3
    - LP: #1032640
  * mm/hugetlb: fix warni...

Changed in linux (Ubuntu Precise):
status: Fix Committed → Fix Released
Revision history for this message
Chris Halse Rogers (raof) wrote : Update Released

The verification of this Stable Release Update has completed successfully and the package has now been released to -updates. Subsequently, the Ubuntu Stable Release Updates Team is being unsubscribed and will not receive messages about this bug report. In the event that you encounter a regression using the package from -updates please report a new bug using ubuntu-bug and tag the bug report regression-update so we can easily find any regresssions.

Revision history for this message
Colin Ian King (colin-king) wrote :

Tested on -proposed kernel Linux ubuntu 3.0.0-26-server #42-Ubuntu SMP Wed Sep 5 08:55:42 UTC 2012 x86_64 x86_64 x86_64 GNU/Linux

sudo ./tests/run_tests.sh -K -c safe -b 1000000 -D /tmp/image -l /lower -u /upper -t enospc.sh -f ext2,ext3,ext4,xfs,btrfs
Running eCryptfs filesystem tests on ext2
enospc pass
Running eCryptfs filesystem tests on ext3
enospc pass
Running eCryptfs filesystem tests on ext4
enospc pass
Running eCryptfs filesystem tests on xfs
enospc pass
Running eCryptfs filesystem tests on btrfs
enospc pass

Test Summary:
5 passed
0 failed

tags: added: verification-done-oneiric
Revision history for this message
Launchpad Janitor (janitor) wrote :
Download full text (5.4 KiB)

This bug was fixed in the package linux - 3.0.0-26.42

---------------
linux (3.0.0-26.42) oneiric-proposed; urgency=low

  [Luis Henriques]

  * Release Tracking Bug
    - LP: #1045707

  [ Upstream Kernel Changes ]

  * rds: set correct msg_namelen
    - LP: #1031112
    - CVE-2012-3430
  * x86: Simplify code by removing a !SMP #ifdefs from 'struct cpuinfo_x86'
    - LP: #1037281
  * Redefine ATOMIC_INIT and ATOMIC64_INIT to drop the casts
    - LP: #1037281
  * SUNRPC: return negative value in case rpcbind client creation error
    - LP: #1037281
  * nilfs2: fix deadlock issue between chcp and thaw ioctls
    - LP: #1037281
  * pcdp: use early_ioremap/early_iounmap to access pcdp table
    - LP: #1037281
  * mm: fix wrong argument of migrate_huge_pages() in
    soft_offline_huge_page()
    - LP: #1037281
  * ARM: 7478/1: errata: extend workaround for erratum #720789
    - LP: #1037281
  * ARM: 7479/1: mm: avoid NULL dereference when flushing gate_vma with
    VIVT caches
    - LP: #1037281
  * mm: mmu_notifier: fix freed page still mapped in secondary MMU
    - LP: #1037281
  * mac80211: cancel mesh path timer
    - LP: #1037281
  * x86, nops: Missing break resulting in incorrect selection on Intel
    - LP: #1037281
  * random: Add support for architectural random hooks
    - LP: #1037281
  * fix typo/thinko in get_random_bytes()
    - LP: #1037281
  * random: Use arch_get_random_int instead of cycle counter if avail
    - LP: #1037281
  * random: Use arch-specific RNG to initialize the entropy store
    - LP: #1037281
  * random: Adjust the number of loops when initializing
    - LP: #1037281
  * drivers/char/random.c: fix boot id uniqueness race
    - LP: #1037281
  * random: make 'add_interrupt_randomness()' do something sane
    - LP: #1037281
  * random: use lockless techniques in the interrupt path
    - LP: #1037281
  * random: create add_device_randomness() interface
    - LP: #1037281
  * usb: feed USB device information to the /dev/random driver
    - LP: #1037281
  * net: feed /dev/random with the MAC address when registering a device
    - LP: #1037281
  * random: use the arch-specific rng in xfer_secondary_pool
    - LP: #1037281
  * random: add new get_random_bytes_arch() function
    - LP: #1037281
  * random: add tracepoints for easier debugging and verification
    - LP: #1037281
  * MAINTAINERS: Theodore Ts'o is taking over the random driver
    - LP: #1037281
  * rtc: wm831x: Feed the write counter into device_add_randomness()
    - LP: #1037281
  * mfd: wm831x: Feed the device UUID into device_add_randomness()
    - LP: #1037281
  * random: remove rand_initialize_irq()
    - LP: #1037281
  * random: Add comment to random_initialize()
    - LP: #1037281
  * dmi: Feed DMI table to /dev/random driver
    - LP: #1037281
  * random: mix in architectural randomness in extract_buf()
    - LP: #1037281
  * x86, microcode: microcode_core.c simple_strtoul cleanup
    - LP: #1037281
  * x86, microcode: Sanitize per-cpu microcode reloading interface
    - LP: #1037281
  * mm: hugetlbfs: close race during teardown of hugetlbfs shared page
    tables
    - LP: #1037281
  * ARM: mxs: Remove MMAP_MIN_ADDR setting from mxs_defconfig
  ...

Read more...

Changed in linux (Ubuntu Oneiric):
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.