← Back to team overview

ecryptfs team mailing list archive

[Bug 415252] Re: Ecryptfs kernel BUG when saving file with Emacs

 

** Description changed:

  Binary package hint: linux-image
  
  Kernel BUG'ed on me when saving a file under ecryptfs directory
  ~/Private using Emacs.
  
  Here's the kernel log output:
  [204479.018768] ecryptfs_init_crypt_ctx: cryptfs: init_crypt_ctx(): Error initializing cipher [aes]
  [204479.018778] ecryptfs_new_file_context: Error initializing cryptographic context for cipher [aes]: rc = [-4]
  [204479.018785] ecryptfs_initialize_file: Error creating new file context; rc = [-4]
  [204479.018967] ------------[ cut here ]------------
  [204479.018973] kernel BUG at /build/buildd/linux-2.6.28/fs/ecryptfs/read_write.c:234!
- [204479.018978] invalid opcode: 0000 [#1] SMP 
+ [204479.018978] invalid opcode: 0000 [#1] SMP
  [204479.018985] last sysfs file: /sys/devices/pci0000:00/0000:00:1c.1/0000:03:00.0/rfkill/rfkill0/state
  [204479.018992] Dumping ftrace buffer:
  [204479.018997]    (ftrace buffer empty)
  [204479.019000] Modules linked in: aes_i586 aes_generic cdc_ether cdc_acm cdc_wdm usbnet mii usbhid binfmt_misc radeon ppdev drm bridge stp bnep input_polldev dm_crypt joydev lp parport snd_hda_intel arc4 ecb snd_pcm_oss snd_mixer_oss snd_pcm snd_seq_dummy snd_seq_oss snd_seq_midi iwl3945 snd_rawmidi snd_seq_midi_event pcmcia iTCO_wdt iTCO_vendor_support snd_seq mac80211 tifm_7xx1 psmouse snd_timer snd_seq_device pcspkr sdhci_pci sdhci video tifm_core output serio_raw yenta_socket rsrc_nonstatic pcmcia_core snd soundcore thinkpad_acpi led_class nvram intel_agp agpgart snd_page_alloc cfg80211 ohci1394 ieee1394 tg3 fbcon tileblit font bitblit softcursor
- [204479.019112] 
+ [204479.019112]
  [204479.019117] Pid: 18182, comm: emacs Not tainted (2.6.28-15-generic #48-Ubuntu) 94503HG
  [204479.019123] EIP: 0060:[<c026867d>] EFLAGS: 00010246 CPU: 0
  [204479.019133] EIP is at ecryptfs_read_lower+0x7d/0xb0
  [204479.019137] EAX: 00000000 EBX: 00000000 ECX: 00000000 EDX: 00000000
  [204479.019143] ESI: 00000000 EDI: f675c500 EBP: d367bda4 ESP: d367bd80
  [204479.019148]  DS: 007b ES: 007b FS: 00d8 GS: 0033 SS: 0068
  [204479.019153] Process emacs (pid: 18182, ti=d367a000 task=dbe27110 task.ti=d367a000)
  [204479.019158] Stack:
  [204479.019161]  d367bda4 00000296 c0269ea4 c200f23c ef873000 f675c65c ef873000 f675c740
  [204479.019174]  f675c500 d367bdc8 c0269ec6 00001000 f675c500 c4ed7330 f675c66c c4ed7330
  [204479.019189]  f675c740 d367be54 d367be04 c0266418 00000000 00000000 d367bde0 c05001f8
  [204479.019204] Call Trace:
  [204479.019208]  [<c0269ea4>] ? ecryptfs_read_metadata+0x44/0x160
  [204479.019217]  [<c0269ec6>] ? ecryptfs_read_metadata+0x66/0x160
  [204479.019225]  [<c0266418>] ? ecryptfs_setattr+0xf8/0x1e0
  [204479.019232]  [<c05001f8>] ? _spin_lock+0x8/0x10
  [204479.019240]  [<c01d15e4>] ? fnotify_change+0x384/0x3b0
  [204479.019248]  [<c01c548c>] ? path_permission+0x2c/0x40
  [204479.019256]  [<c01bc941>] ? do_truncate+0x71/0x90
  [204479.019263]  [<c02a978a>] ? apparmor_path_permission+0x5a/0x80
  [204479.019272]  [<c01c5cfb>] ? may_open+0x18b/0x200
  [204479.019279]  [<c01c90e2>] ? do_filp_open+0x192/0x7b0
  [204479.019287]  [<c01d2230>] ? alloc_fd+0xe0/0x100
  [204479.019294]  [<c01bb9af>] ? do_sys_open+0x5f/0x130
  [204479.019301]  [<c01bbae9>] ? sys_open+0x29/0x40
  [204479.019308]  [<c0103f6b>] ? sysenter_do_call+0x12/0x2f
- [204479.019316] Code: 55 ec e8 f7 58 f5 ff 89 c2 89 e0 25 00 e0 ff ff 89 58 18 31 db 85 d2 78 1d 8b 45 f0 e8 9d 68 29 00 89 d8 83 c4 18 5b 5e 5f 5d c3 <0f> 0b eb fe 8d b4 26 00 00 00 00 8b 45 08 bb ea ff ff ff 89 54 
+ [204479.019316] Code: 55 ec e8 f7 58 f5 ff 89 c2 89 e0 25 00 e0 ff ff 89 58 18 31 db 85 d2 78 1d 8b 45 f0 e8 9d 68 29 00 89 d8 83 c4 18 5b 5e 5f 5d c3 <0f> 0b eb fe 8d b4 26 00 00 00 00 8b 45 08 bb ea ff ff ff 89 54
  [204479.019397] EIP: [<c026867d>] ecryptfs_read_lower+0x7d/0xb0 SS:ESP 0068:d367bd80
  [204479.019409] ---[ end trace 4f4b2efc3a7aabf0 ]---
  
- 
  Using Ubuntu Jaunty.
  
- $ LANG=C apt-cache policy linux-image-2.6.28-15-generic 
+ $ LANG=C apt-cache policy linux-image-2.6.28-15-generic
  linux-image-2.6.28-15-generic:
-   Installed: 2.6.28-15.48
-   Candidate: 2.6.28-15.48
-   Version table:
-  *** 2.6.28-15.48 0
-         500 http://archive.ubuntu.com jaunty-updates/main Packages
-         100 /var/lib/dpkg/status
+   Installed: 2.6.28-15.48
+   Candidate: 2.6.28-15.48
+   Version table:
+  *** 2.6.28-15.48 0
+         500 http://archive.ubuntu.com jaunty-updates/main Packages
+         100 /var/lib/dpkg/status
  
- $ LANG=C apt-cache policy ecryptfs-utils 
+ $ LANG=C apt-cache policy ecryptfs-utils
  ecryptfs-utils:
-   Installed: 73-0ubuntu6.1
-   Candidate: 73-0ubuntu6.1
-   Version table:
-  *** 73-0ubuntu6.1 0
-         500 http://archive.ubuntu.com jaunty-updates/main Packages
-         500 http://archive.ubuntu.com jaunty-security/main Packages
-         100 /var/lib/dpkg/status
-      73-0ubuntu6 0
-         500 http://archive.ubuntu.com jaunty/main Packages
+   Installed: 73-0ubuntu6.1
+   Candidate: 73-0ubuntu6.1
+   Version table:
+  *** 73-0ubuntu6.1 0
+         500 http://archive.ubuntu.com jaunty-updates/main Packages
+         500 http://archive.ubuntu.com jaunty-security/main Packages
+         100 /var/lib/dpkg/status
+      73-0ubuntu6 0
+         500 http://archive.ubuntu.com jaunty/main Packages

-- 
Ecryptfs kernel BUG when saving file with Emacs
https://bugs.launchpad.net/bugs/415252
You received this bug notification because you are a member of eCryptfs,
which is subscribed to ecryptfs-utils in ubuntu.

Status in eCryptfs - Enterprise Cryptographic Filesystem: Fix Released
Status in “ecryptfs-utils” package in Ubuntu: Invalid
Status in “linux” package in Ubuntu: Fix Released
Status in ecryptfs-utils in Ubuntu Jaunty: New
Status in linux in Ubuntu Jaunty: In Progress

Bug description:
SRU  Justification: 

Impact:  Bug in the Ecryptfs disallowed saving the file under the ecryptfs directory ~/Private using Emacs.

Fix: The cherry picked patch from the upstream commit id "b0105eaefa7cce8f4a941d0fc6354b250d30e745" fixed this bug. Previous to this fix a cipher code was not recognized and as a result memory was not allocated to some pointer. However this pointer was freed without allocation. This fix, prevents the freeing of memory when it is not allocated for the case of this particular cipher.

Testcase: The reporter of the bug, has verified that this patch has fixed this bug for him.

===

Binary package hint: linux-image

Kernel BUG'ed on me when saving a file under ecryptfs directory ~/Private using Emacs.

Here's the kernel log output:
[204479.018768] ecryptfs_init_crypt_ctx: cryptfs: init_crypt_ctx(): Error initializing cipher [aes]
[204479.018778] ecryptfs_new_file_context: Error initializing cryptographic context for cipher [aes]: rc = [-4]
[204479.018785] ecryptfs_initialize_file: Error creating new file context; rc = [-4]
[204479.018967] ------------[ cut here ]------------
[204479.018973] kernel BUG at /build/buildd/linux-2.6.28/fs/ecryptfs/read_write.c:234!
[204479.018978] invalid opcode: 0000 [#1] SMP
[204479.018985] last sysfs file: /sys/devices/pci0000:00/0000:00:1c.1/0000:03:00.0/rfkill/rfkill0/state
[204479.018992] Dumping ftrace buffer:
[204479.018997]    (ftrace buffer empty)
[204479.019000] Modules linked in: aes_i586 aes_generic cdc_ether cdc_acm cdc_wdm usbnet mii usbhid binfmt_misc radeon ppdev drm bridge stp bnep input_polldev dm_crypt joydev lp parport snd_hda_intel arc4 ecb snd_pcm_oss snd_mixer_oss snd_pcm snd_seq_dummy snd_seq_oss snd_seq_midi iwl3945 snd_rawmidi snd_seq_midi_event pcmcia iTCO_wdt iTCO_vendor_support snd_seq mac80211 tifm_7xx1 psmouse snd_timer snd_seq_device pcspkr sdhci_pci sdhci video tifm_core output serio_raw yenta_socket rsrc_nonstatic pcmcia_core snd soundcore thinkpad_acpi led_class nvram intel_agp agpgart snd_page_alloc cfg80211 ohci1394 ieee1394 tg3 fbcon tileblit font bitblit softcursor
[204479.019112]
[204479.019117] Pid: 18182, comm: emacs Not tainted (2.6.28-15-generic #48-Ubuntu) 94503HG
[204479.019123] EIP: 0060:[<c026867d>] EFLAGS: 00010246 CPU: 0
[204479.019133] EIP is at ecryptfs_read_lower+0x7d/0xb0
[204479.019137] EAX: 00000000 EBX: 00000000 ECX: 00000000 EDX: 00000000
[204479.019143] ESI: 00000000 EDI: f675c500 EBP: d367bda4 ESP: d367bd80
[204479.019148]  DS: 007b ES: 007b FS: 00d8 GS: 0033 SS: 0068
[204479.019153] Process emacs (pid: 18182, ti=d367a000 task=dbe27110 task.ti=d367a000)
[204479.019158] Stack:
[204479.019161]  d367bda4 00000296 c0269ea4 c200f23c ef873000 f675c65c ef873000 f675c740
[204479.019174]  f675c500 d367bdc8 c0269ec6 00001000 f675c500 c4ed7330 f675c66c c4ed7330
[204479.019189]  f675c740 d367be54 d367be04 c0266418 00000000 00000000 d367bde0 c05001f8
[204479.019204] Call Trace:
[204479.019208]  [<c0269ea4>] ? ecryptfs_read_metadata+0x44/0x160
[204479.019217]  [<c0269ec6>] ? ecryptfs_read_metadata+0x66/0x160
[204479.019225]  [<c0266418>] ? ecryptfs_setattr+0xf8/0x1e0
[204479.019232]  [<c05001f8>] ? _spin_lock+0x8/0x10
[204479.019240]  [<c01d15e4>] ? fnotify_change+0x384/0x3b0
[204479.019248]  [<c01c548c>] ? path_permission+0x2c/0x40
[204479.019256]  [<c01bc941>] ? do_truncate+0x71/0x90
[204479.019263]  [<c02a978a>] ? apparmor_path_permission+0x5a/0x80
[204479.019272]  [<c01c5cfb>] ? may_open+0x18b/0x200
[204479.019279]  [<c01c90e2>] ? do_filp_open+0x192/0x7b0
[204479.019287]  [<c01d2230>] ? alloc_fd+0xe0/0x100
[204479.019294]  [<c01bb9af>] ? do_sys_open+0x5f/0x130
[204479.019301]  [<c01bbae9>] ? sys_open+0x29/0x40
[204479.019308]  [<c0103f6b>] ? sysenter_do_call+0x12/0x2f
[204479.019316] Code: 55 ec e8 f7 58 f5 ff 89 c2 89 e0 25 00 e0 ff ff 89 58 18 31 db 85 d2 78 1d 8b 45 f0 e8 9d 68 29 00 89 d8 83 c4 18 5b 5e 5f 5d c3 <0f> 0b eb fe 8d b4 26 00 00 00 00 8b 45 08 bb ea ff ff ff 89 54
[204479.019397] EIP: [<c026867d>] ecryptfs_read_lower+0x7d/0xb0 SS:ESP 0068:d367bd80
[204479.019409] ---[ end trace 4f4b2efc3a7aabf0 ]---

Using Ubuntu Jaunty.

$ LANG=C apt-cache policy linux-image-2.6.28-15-generic
linux-image-2.6.28-15-generic:
  Installed: 2.6.28-15.48
  Candidate: 2.6.28-15.48
  Version table:
 *** 2.6.28-15.48 0
        500 http://archive.ubuntu.com jaunty-updates/main Packages
        100 /var/lib/dpkg/status

$ LANG=C apt-cache policy ecryptfs-utils
ecryptfs-utils:
  Installed: 73-0ubuntu6.1
  Candidate: 73-0ubuntu6.1
  Version table:
 *** 73-0ubuntu6.1 0
        500 http://archive.ubuntu.com jaunty-updates/main Packages
        500 http://archive.ubuntu.com jaunty-security/main Packages
        100 /var/lib/dpkg/status
     73-0ubuntu6 0
        500 http://archive.ubuntu.com jaunty/main Packages