When writing a file and exiting, vim sometimes segfaults and a kernel bug is logged on the console when the file in question is inside an ecryptfs encrypted filesystem. When trying to switch out of the affected terminal (using screen inside guake), the whole session freezes and the computer can only be switched off using the power button. ay 20 12:55:31 localhost kernel: ------------[ cut here ]------------ May 20 12:55:31 localhost kernel: kernel BUG at fs/namei.c:2460! May 20 12:55:31 localhost kernel: invalid opcode: 0000 [#1] PREEMPT SMP~ May 20 12:55:31 localhost kernel: Modules linked in: vfat fat ecryptfs uvcvideo videobuf2_vmalloc videobuf2_memops videobuf2_core btusb iwlmvm serio_raw iwlwifi xhci_pci ehci_pci efivars efivarfs fuse hid_generic xhci_hcd ehci_hcd btrfs raid6_pq lzo_compress xor May 20 12:55:31 localhost kernel: CPU: 2 PID: 31667 Comm: vi Not tainted 4.0.3-ck #1 May 20 12:55:31 localhost kernel: Hardware name: SAMSUNG ELECTRONICS CO., LTD. 940X3G/930X3G/NP940X3G-K03DE, BIOS P05ACJ.128.140819.dg 08/19/2014 May 20 12:55:31 localhost kernel: task: ffff8800516c0790 ti: ffff8800194d0000 task.ti: ffff8800194d0000 May 20 12:55:31 localhost kernel: RIP: 0010:[<ffffffff8114cd99>] [<ffffffff8114cd99>] may_delete+0x34/0x108 May 20 12:55:31 localhost kernel: RSP: 0018:ffff8800194d3d88 EFLAGS: 00010293 May 20 12:55:31 localhost kernel: RAX: ffff88007aa81b40 RBX: ffff88006fc13540 RCX: 0000000000000002 May 20 12:55:31 localhost kernel: RDX: 0000000000000000 RSI: ffff88006fc13540 RDI: ffff8800aa31ebf8 May 20 12:55:31 localhost kernel: RBP: ffff88007aa598c0 R08: 0000000000090009 R09: ffff8800a90303c8 May 20 12:55:31 localhost kernel: R10: ffff880025e76032 R11: 1f1efeff6f76722d R12: ffff880093a5efd0 May 20 12:55:31 localhost kernel: R13: ffff8800aa31ebf8 R14: 0000000000000000 R15: ffff8800aa31ebf8 May 20 12:55:31 localhost kernel: FS: 00007f7dd5b05780(0000) GS:ffff88011fb00000(0000) knlGS:0000000000000000 May 20 12:55:31 localhost kernel: CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 May 20 12:55:31 localhost kernel: CR2: 0000000000822a60 CR3: 000000001d277000 CR4: 00000000001406e0 May 20 12:55:31 localhost kernel: Stack: May 20 12:55:31 localhost kernel: 0000000000000002 ffff88006fc13540 ffff8800888a4400 ffff880093a5efd0 May 20 12:55:31 localhost kernel: ffff8800aa31ebf8 ffffffff8114ce8c 0000000000000002 ffff88006fc13540 May 20 12:55:31 localhost kernel: ffff8800888a4400 ffff880086f7b000 ffff880086f7b000 ffff8800a90303c0 May 20 12:55:31 localhost kernel: Call Trace: May 20 12:55:31 localhost kernel: [<ffffffff8114ce8c>] ? vfs_unlink+0x1f/0x163 May 20 12:55:31 localhost kernel: [<ffffffffa019ebc1>] ? ecryptfs_do_unlink+0x4e/0xf1 [ecryptfs] May 20 12:55:31 localhost kernel: [<ffffffff8114cf3e>] ? vfs_unlink+0xd1/0x163 May 20 12:55:31 localhost kernel: [<ffffffff8115128f>] ? do_unlinkat+0xf9/0x210 May 20 12:55:31 localhost kernel: [<ffffffff8115cf2a>] ? mntput_no_expire+0xc/0x172 May 20 12:55:31 localhost kernel: [<ffffffff810a9a20>] ? task_work_run+0x89/0x98 May 20 12:55:31 localhost kernel: [<ffffffff810337d9>] ? do_notify_resume+0x3b/0x48 May 20 12:55:31 localhost kernel: [<ffffffff8168cdf2>] ? system_call_fastpath+0x12/0x17 May 20 12:55:31 localhost kernel: Code: 51 f7 06 00 00 70 00 4c 8b 66 30 75 0a b8 fe ff ff ff e9 e0 00 00 00 4d 85 e4 75 02 0f 0b 48 8b 46 18 48 8b 68 30 48 39 fd 74 02 <0f> 0b 65 48 8b 04 25 80 aa 00 00 48 8b 80 f0 05 00 00 41 89 d5~ May 20 12:55:31 localhost kernel: RIP [<ffffffff8114cd99>] may_delete+0x34/0x108 May 20 12:55:31 localhost kernel: RSP <ffff8800194d3d88> May 20 12:55:31 localhost kernel: ---[ end trace 5ecccf0762ce1764 ]--- Reproducible: Sometimes Steps to Reproduce: 1. Open file in VIM 2. Change something 3. Write and exit using :wq Actual Results: VIM Segfaults, attached stacktrace shows up in dmesg Expected Results: VIM closes and writes the file Kernel: ck-sources-4.0.3 VIM 7.4 uname -r -v -m -p -i: 4.0.3-ck #1 SMP PREEMPT x86_64 Intel(R) Core(TM) i5-4200U CPU @ 1.60GHz GenuineIntel
Still valid with newer versions?
I will investigate. I have a workaround (where I move the files I work on outside the affected directory), so I would not have noticed if this is still the case.
I could not reproduce the bug with ck-sources-4.6.2.