Proper cipher support isn't checked at mount time

Bug #338914 reported by Tyler Hicks
4
Affects Status Importance Assigned to Milestone
eCryptfs
Fix Released
Low
Tim Sally
linux (Ubuntu)
Fix Released
Undecided
Tim Gardner
Lucid
Fix Released
Undecided
Colin Ian King
Oneiric
Fix Released
Undecided
Colin Ian King
Precise
Fix Released
Undecided
Colin Ian King
Quantal
Fix Released
Undecided
Tim Gardner

Bug Description

eCryptfs should check to see if we have the appropriate cipher code (as defined in RFC 2440) for a given cipher at mount time. We are currently waiting all the way until a write occurs to detect if we know of the proper cipher code.

To reproduce:
---
gentoo-virt mnt # mount -it ecryptfs /mnt/.ecryptfs-ext3 /mnt/ecryptfs-ext3/ -o \
ecryptfs_sig=7fa06f4b66fcde02,ecryptfs_cipher=camellia,ecryptfs_key_bytes=16,rw,noauto
gentoo-virt ecryptfs-ext3 # echo "camellia cipher test" > /mnt/ecryptfs-ext3/test
-bash: /mnt/ecryptfs-ext3/test: Invalid argument
---

Relevant log entries:
---
Mar 6 10:15:57 gentoo-virt kernel: write_tag_3_packet: Unable to generate code for cipher [camellia]
Mar 6 10:15:57 gentoo-virt kernel: ecryptfs_generate_key_packet_set: Error writing tag 3 packet
Mar 6 10:15:57 gentoo-virt kernel: ecryptfs_write_headers_virt: Error generating key packet set; rc = [-22]
Mar 6 10:15:57 gentoo-virt kernel: ecryptfs_write_metadata: Error whilst writing headers; rc = [-22]
Mar 6 10:15:57 gentoo-virt kernel: Error writing headers; rc = [-22]
---

Tyler Hicks (tyhicks)
Changed in ecryptfs:
assignee: nobody → tyhicks
importance: Undecided → Medium
status: New → Triaged
Revision history for this message
Tyler Hicks (tyhicks) wrote :

Making this low importance, we don't handle it too bad currently, but it would be nice for the check to be done at mount time.

Changed in ecryptfs:
importance: Medium → Low
tags: added: kernel
Revision history for this message
Tim Sally (tsally) wrote :
Tim Sally (tsally)
Changed in ecryptfs:
assignee: Tyler Hicks (tyhicks) → Tim Sally (tsally)
Revision history for this message
Tyler Hicks (tyhicks) wrote :

Committed to the eCryptfs next branch. Thanks again, Tim!

Changed in ecryptfs:
status: Triaged → Fix Committed
Revision history for this message
Tyler Hicks (tyhicks) wrote :

This fix was merged into Linus' tree. It should be released in 3.6-rc1.

http://git.kernel.org/linus/5f5b331d5c21228a6519dcb793fc1629646c51a6

Tyler Hicks (tyhicks)
Changed in ecryptfs:
status: Fix Committed → Fix Released
Tim Gardner (timg-tpi)
Changed in linux (Ubuntu Quantal):
assignee: nobody → Tim Gardner (timg-tpi)
status: New → Fix Committed
Revision history for this message
Launchpad Janitor (janitor) wrote :

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

---------------
linux (3.5.0-15.21) quantal; urgency=low

  [ Tim Gardner ]

  * ubuntu: AUFS -- update to 18e455787597579fe144cdb2f18aa6a0a32c46a4
  * [Config] Enable aufs
    - LP: #908784

  [ Upstream Kernel Changes ]

  * eCryptfs: check for eCryptfs cipher support at mount
    - LP: #338914
  * drm/i915: pnv has a backlight polarity control bit, too
    - LP: #954661
  * drm/i915: clear up backlight #define confusion on gen4+
    - LP: #954661
  * drm/i915: properly enable the blc controller on the right pipe
    - LP: #954661
  * drm/i915: allow pipe A for lvds on gen4
    - LP: #954661
 -- Tim Gardner <email address hidden> Tue, 18 Sep 2012 08:37:51 -0400

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

Tested Lucid -proposed: Linux ubuntu 2.6.32-45-server #100-Ubuntu SMP Wed Nov 14 11:02:27 UTC 2012 x86_64 GNU/Linux

tested by:

1. mount using:
   mount -t ecryptfs /lower /upper
2. umount
3. add the mount password into the kernel keyring using ecryptfs-add-passphrase
4. try to remount using the sig from step 1 and the camellia cipher:

mount -it ecryptfs /lower /upper -o ecryptfs_sig=xxxxxxxxxxxxxxx,ecryptfs_cipher=camellia

without the fix /upper is mounted and then the kernel complains when we write a file to /upper. With the fix, the kernel does not mount (as expected) and the kernel error message appears:

[ 120.784003] ecryptfs_parse_options: eCryptfs doesn't support cipher: camellia

..so this passes the test for Lucid -proposed.

tags: added: verification-done-lucid
Revision history for this message
Herton R. Krzesinski (herton) wrote :

This bug is awaiting verification that the kernels for Oneiric (3.0.0-28.45) and Precise (3.2.0-34.53) in -proposed solves the problem. Please test the kernel and update this bug with the results. If the problem is solved, change the tag 'verification-needed-<releasename>' to 'verification-done-<releasename>'.

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

Tested Oneiric -proposed: Linux ubuntu 3.0.0-28-server #45-Ubuntu SMP Wed Nov 14 22:15:34

Repeated the test (see comment #6). Without the fix /upper is mounted and then the kernel complains when we write a file to /upper. With the fix, the kernel does not mount (as expected) and the kernel error message appears:

[ 69.717985] ecryptfs_parse_options: eCryptfs: unrecognized option [ecyptfs_cipher=camellia]

..so this passes the test for Oneiric -proposed.

tags: added: verification-done-oneiric
removed: verification-needed-oneiric
Revision history for this message
Colin Ian King (colin-king) wrote :

Tested Precise -proposed: Linux ubuntu 3.2.0-34-generic #53-Ubuntu SMP Thu Nov 15 10:48:16

Repeated the test (see comment #6). Without the fix /upper is mounted and then the kernel complains when we write a file to /upper. With the fix, the kernel does not mount (as expected) and the kernel error message appears:

[ 74.298508] ecryptfs_parse_options: eCryptfs doesn't support cipher: camellia

tags: added: verification-done-precise
removed: verification-needed-precise
Revision history for this message
Herton R. Krzesinski (herton) wrote :

Thanks for the quick verification Colin. Oneiric is now free for testing, Precise still has some other SRUs to be verified.

Revision history for this message
Adam Conrad (adconrad) 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
Launchpad Janitor (janitor) wrote :
Download full text (15.0 KiB)

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

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

  [Luis Henriques]

  * Release Tracking Bug
    - LP: #1078663

  [ Tim Gardner ]

  * [Config] updateconfigs for stable updates

  [ Upstream Kernel Changes ]

  * Revert "SUNRPC: Ensure we close the socket on EPIPE errors too..."
    - LP: #1075332
  * mn10300: only add -mmem-funcs to KBUILD_CFLAGS if gcc supports it
    - LP: #1067857
  * kbuild: make: fix if_changed when command contains backslashes
    - LP: #1067857
  * media: rc: ite-cir: Initialise ite_dev::rdev earlier
    - LP: #1067857
  * ACPI: run _OSC after ACPI_FULL_INITIALIZATION
    - LP: #1067857
  * PCI: acpiphp: check whether _ADR evaluation succeeded
    - LP: #1067857
  * lib/gcd.c: prevent possible div by 0
    - LP: #1067857
  * kernel/sys.c: call disable_nonboot_cpus() in kernel_restart()
    - LP: #1067857
  * drivers/scsi/atp870u.c: fix bad use of udelay
    - LP: #1067857
  * workqueue: add missing smp_wmb() in process_one_work()
    - LP: #1067857
  * xfrm: Workaround incompatibility of ESN and async crypto
    - LP: #1067857
  * xfrm_user: return error pointer instead of NULL
    - LP: #1067857
  * xfrm_user: return error pointer instead of NULL #2
    - LP: #1067857
  * xfrm: fix a read lock imbalance in make_blackhole
    - LP: #1067857
  * xfrm_user: fix info leak in copy_to_user_auth()
    - LP: #1067857
  * xfrm_user: fix info leak in copy_to_user_state()
    - LP: #1067857
  * xfrm_user: fix info leak in copy_to_user_policy()
    - LP: #1067857
  * xfrm_user: fix info leak in copy_to_user_tmpl()
    - LP: #1067857
  * xfrm_user: don't copy esn replay window twice for new states
    - LP: #1067857
  * xfrm_user: ensure user supplied esn replay window is valid
    - LP: #1067857
  * net: ethernet: davinci_cpdma: decrease the desc count when cleaning up
    the remaining packets
    - LP: #1067857
  * ixp4xx_hss: fix build failure due to missing linux/module.h inclusion
    - LP: #1067857
  * netxen: check for root bus in netxen_mask_aer_correctable
    - LP: #1067857
  * net-sched: sch_cbq: avoid infinite loop
    - LP: #1067857
  * pkt_sched: fix virtual-start-time update in QFQ
    - LP: #1067857
  * sierra_net: Endianess bug fix.
    - LP: #1067857
  * 8021q: fix mac_len recomputation in vlan_untag()
    - LP: #1067857
  * ipv6: release reference of ip6_null_entry's dst entry in __ip6_del_rt
    - LP: #1067857
  * tcp: flush DMA queue before sk_wait_data if rcv_wnd is zero
    - LP: #1067857
  * sctp: Don't charge for data in sndbuf again when transmitting packet
    - LP: #1067857
  * pppoe: drop PPPOX_ZOMBIEs in pppoe_release
    - LP: #1067857
  * net: small bug on rxhash calculation
    - LP: #1067857
  * net: guard tcp_set_keepalive() to tcp sockets
    - LP: #1067857
  * ipv4: raw: fix icmp_filter()
    - LP: #1067857
  * ipv6: raw: fix icmpv6_filter()
    - LP: #1067857
  * ipv6: mip6: fix mip6_mh_filter()
    - LP: #1067857
  * l2tp: fix a typo in l2tp_eth_dev_recv()
    - LP: #1067857
  * netrom: copy_datagram_iovec can fail
    - LP: #1067857
  * net: do not disable sg for packets requiring no checksum
    - LP: #1067857
  * ...

Changed in linux (Ubuntu Oneiric):
status: Fix Committed → Fix Released
Revision history for this message
Launchpad Janitor (janitor) wrote :

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

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

  [Luis Henriques]

  * Release Tracking Bug
    - LP: #1078385

  [ Upstream Kernel Changes ]

  * eCryptfs: check for eCryptfs cipher support at mount
    - LP: #338914
  * net: fix divide by zero in tcp algorithm illinois
    - LP: #1077091
    - CVE-2012-4565
 -- Luis Henriques <email address hidden> Tue, 13 Nov 2012 17:53:05 +0000

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

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

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

  [Luis Henriques]

  * Release Tracking Bug
    - LP: #1078760

  [ Kamal Mostafa ]

  * SAUCE: input: Cypress PS/2 Trackpad list additional contributors

  [ Kyle Fazzari ]

  * SAUCE: input: Cypress PS/2 Trackpad fix multi-source, double-click
    - LP: #1055788
  * SAUCE: input: Cypress PS/2 Trackpad fix lost sync upon palm contact
    - LP: #1048258
  * SAUCE: input: Cypress PS/2 Trackpad fix taps turning into hardware
    clicks
    - LP: #1064086

  [ Tim Gardner ]

  * [Config] remove ndiswrapper from Provides:
    - LP: #1076395
  * [Config] CONFIG_HP_WATCHDOG=m for x86en
    - LP: #1076342

  [ Upstream Kernel Changes ]

  * Revert "SUNRPC: Ensure we close the socket on EPIPE errors too..."
    - LP: #1075355
  * Revert "ath9k_hw: Updated AR9003 tx gain table for 5GHz"
    - LP: #1075355
  * eCryptfs: check for eCryptfs cipher support at mount
    - LP: #338914
  * isci: fix isci_pci_probe() generates warning on efi failure path
    - LP: #1068162
  * mtd: nand: Use the mirror BBT descriptor when reading its version
    - LP: #1068162
  * drm/i915: prevent possible pin leak on error path
    - LP: #1068162
  * workqueue: add missing smp_wmb() in process_one_work()
    - LP: #1068162
  * TTY: ttyprintk, don't touch behind tty->write_buf
    - LP: #1068162
  * Remove BUG_ON from n_tty_read()
    - LP: #1068162
  * n_gsm.c: Implement 3GPP27.010 DLC start-up procedure in MUX
    - LP: #1068162
  * n_gsm: uplink SKBs accumulate on list
    - LP: #1068162
  * n_gsm : Flow control handling in Mux driver
    - LP: #1068162
  * char: n_gsm: remove message filtering for contipated DLCI
    - LP: #1068162
  * n_gsm: added interlocking for gsm_data_lock for certain code paths
    - LP: #1068162
  * n_gsm: avoid accessing freed memory during CMD_FCOFF condition
    - LP: #1068162
  * n_gsm: replace kfree_skb w/ appropriate dev_* versions
    - LP: #1068162
  * n_gsm: memory leak in uplink error path
    - LP: #1068162
  * UBI: fix autoresize handling in R/O mode
    - LP: #1068162
  * UBI: erase free PEB with bitflip in EC header
    - LP: #1068162
  * firmware: Add missing attributes to EFI variable attribute print out
    from sysfs
    - LP: #1068162
  * tools/hv: Fix exit() error code
    - LP: #1068162
  * slab: fix the DEADLOCK issue on l3 alien lock
    - LP: #1068162
  * gspca_pac7302: Add usb-id for 145f:013c
    - LP: #1068162
  * gspca_pac7302: add support for device 1ae7:2001 Speedlink Snappy
    Microphone SL-6825-SBK
    - LP: #1068162
  * xhci: Warn when hosts don't halt.
    - LP: #1068162
  * xHCI: add cmd_ring_state
    - LP: #1068162
  * xHCI: add aborting command ring function
    - LP: #1068162
  * xHCI: cancel command after command timeout
    - LP: #1068162
  * hpsa: Use LUN reset instead of target reset
    - LP: #1068162
  * rc: ite-cir: Initialise ite_dev::rdev earlier
    - LP: #1068162
  * staging: speakup_soft: Fix reading of init string
    - LP: #1068162
  * target: fix return code in target_core_init_configfs error path
    - LP: #1068162
  * powerpc/eeh: Lock module while handling EEH event
  ...

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