For what it's worth, here is the backtrace from when I reproduced the bug using emacs/evince. Maybe it is helpful to look for similarities in the code path, though it certainly sounds like the crypto code in ecryptfs is the place to begin. I may try putting in lots of WARN_ON(irqs_disabled()).
Just as a note, from disassembly it doesn't appear that the aesni_intel module contains the cli instruction, so interrupts must get disabled somewhere else. As a wild guess, I speculate that somewhere there is a irq_enable/irq_disable pair with the possibility to erroneously jump out from the middle, and something about using the aesni_intel module makes that happen. Maybe in the generic crypto code that only calls aesni_intel if it's available?
For what it's worth, here is the backtrace from when I reproduced the bug using emacs/evince. Maybe it is helpful to look for similarities in the code path, though it certainly sounds like the crypto code in ecryptfs is the place to begin. I may try putting in lots of WARN_ON( irqs_disabled( )).
Just as a note, from disassembly it doesn't appear that the aesni_intel module contains the cli instruction, so interrupts must get disabled somewhere else. As a wild guess, I speculate that somewhere there is a irq_enable/ irq_disable pair with the possibility to erroneously jump out from the middle, and something about using the aesni_intel module makes that happen. Maybe in the generic crypto code that only calls aesni_intel if it's available?
[ 322.435871] ------------[ cut here ]------------ buildd/ linux-3. 11.0/fs/ buffer. c:1268! netbios_ ns nf_conntrack_ broadcast nf_nat_ftp nf_nat nf_conntrack_ftp nf_conntrack iptable_filter ip_tables x_tables bnep rfcomm bluetooth x86_pkg_ temp_thermal intel_powerclamp coretemp kvm crct10dif_pclmul crc32_pclmul ghash_clmulni_intel aesni_intel aes_x86_64 lrw gf128mul glue_helper ablk_helper cryptd hp_wmi sparse_keymap snd_hda_codec_hdmi snd_hda_codec_idt binfmt_misc uvcvideo videobuf2_vmalloc snd_hda_intel snd_hda_codec videobuf2_memops snd_hwdep videobuf2_core videodev snd_pcm lib80211_crypt_tkip snd_page_alloc snd_seq_midi snd_seq_midi_event snd_rawmidi snd_seq microcode wl(POF) snd_seq_device snd_timer lib80211 psmouse serio_raw cfg80211 rtsx_pci_ms snd memstick lpc_ich mei_me soundcore mei mac_hid rtsx_pci_sdmmc i915 i2c_algo_bit drm_kms_helper sdhci_pci sdhci drm ahci r8169 rtsx_pci mii libahci wmi video ffffffff816e3ef d>] [<ffffffff816e3 efd>] check_irqs_ on.part. 11+0x4/ 0x6 1534c8 EFLAGS: 00010046 0(0000) GS:ffff88014fac 0000(0000) knlGS:000000000 0000000 1a9>] __find_ get_block+ 0x229/0x230 1d4>] __getblk+0x24/0x2e0 230>] __ext4_ get_inode_ loc+0x110/ 0x3d0 f9d>] ext4_get_ inode_loc+ 0x1d/0x20 796>] ext4_reserve_ inode_write+ 0x26/0xa0 9b0>] ? ext4_dirty_ inode+0x40/ 0x60 854>] ext4_mark_ inode_dirty+ 0x44/0x1f0 9b0>] ext4_dirty_ inode+0x40/ 0x60 3b2>] __mark_ inode_dirty+ 0x1f2/0x2f0 b8e>] update_ time+0x8e/ 0xd0 d90>] file_update_ time+0x80/ 0xd0 d40>] __generic_ file_aio_ write+0x180/ 0x3d0 fed>] generic_ file_aio_ write+0x5d/ 0xc0 6f9>] ext4_file_ write+0x99/ 0x3f0 9f0>] do_sync_ write+0x80/ 0xb0 12d>] vfs_write+ 0xbd/0x1e0 888>] kernel_ write+0x38/ 0x50 b69>] ecryptfs_ write_lower+ 0x29/0x50 f6c>] ecryptfs_ encrypt_ page+0xec/ 0x180 084>] ecryptfs_ writepage+ 0x14/0x60 553>] __writepage+ 0x13/0x40 f31>] write_cache_ pages+0x241/ 0x4b0 599>] ? ttwu_do_ wakeup+ 0x19/0xd0 540>] ? global_ dirtyable_ memory+ 0x50/0x50 50b>] ? ep_poll_ callback+ 0x11b/0x170 77b>] ? srcu_readers_ seq_idx. isra.6+ 0x5b/0x80 5be>] ? _raw_spin_ lock+0xe/ 0x20 1e0>] generic_ writepages+ 0x40/0x60 695>] do_writepages+ 0x35/0x40 1e9>] __filemap_ fdatawrite_ range+0x59/ 0x60 24c>] filemap_ write_and_ wait+0x2c/ 0x60 d02>] ecryptfs_ put_lower_ file+0x32/ 0x60 fe2>] ecryptfs_ release+ 0x12/0x30 be1>] __fput+0xe1/0x230 d7e>] ____fput+0xe/0x10 3c4>] task_work_ run+0xc4/ 0xe0 257>] do_exit+0x2b7/0xa40 133>] ? __sigqueue_ free.part. 15+0x33/ 0x40 a5f>] do_group_ exit+0x3f/ 0xa0 2c0>] get_signal_ to_deliver+ 0x1d0/0x5e0 438>] do_signal+ 0x48/0x960 b0c>] ? SYSC_recvfrom+ 0x11c/0x160 609>] ? __switch_ to+0x169/ 0x4b0 3c0>] ? finish_ task_switch+ 0x50/0xf0 dc8>] do_notify_ resume+ 0x78/0xa0 4da>] int_signal+ 0x12/0x17 efd>] check_irqs_ on.part. 11+0x4/ 0x6
[ 322.435925] kernel BUG at /build/
[ 322.435979] invalid opcode: 0000 [#1] SMP
[ 322.436017] Modules linked in: xt_recent michael_mic arc4 dm_crypt joydev ip6t_REJECT xt_hl ip6t_rt nf_conntrack_ipv6 nf_defrag_ipv6 ipt_REJECT xt_comment xt_LOG parport_pc ppdev lp parport xt_limit xt_tcpudp xt_addrtype nf_conntrack_ipv4 nf_defrag_ipv4 xt_conntrack ip6table_filter ip6_tables nf_conntrack_
[ 322.437181] CPU: 3 PID: 3174 Comm: evince Tainted: PF O 3.11.0-15-generic #23-Ubuntu
[ 322.437266] Hardware name: Hewlett-Packard HP Folio 13 Notebook PC/17F8, BIOS F.0B 01/23/2013
[ 322.437353] task: ffff880146af2ee0 ti: ffff880144152000 task.ti: ffff880144152000
[ 322.437511] RIP: 0010:[<
[ 322.437699] RSP: 0018:ffff880144
[ 322.437805] RAX: 0000000000000086 RBX: 0000000000001000 RCX: ffff880144955800
[ 322.437937] RDX: 0000000000001000 RSI: 0000000000000554 RDI: ffff88014934a3c0
[ 322.438069] RBP: ffff8801441534c8 R08: 0000000000000000 R09: 0000000000000000
[ 322.438186] R10: ffff880144955800 R11: 0000000000001000 R12: ffff880144153650
[ 322.438262] R13: ffff8801438b9000 R14: ffff88014f8a8000 R15: ffff88014934a3c0
[ 322.438338] FS: 00007feab6487a0
[ 322.438425] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[ 322.438486] CR2: 00000000021aa1b8 CR3: 0000000001c0e000 CR4: 00000000000407e0
[ 322.438561] Stack:
[ 322.438584] ffff880144153538 ffffffff811d81a9 0000000000000000 0000000000000000
[ 322.438672] 0000000000000000 0000000000000000 0000000000000000 0000000000000000
[ 322.438757] 0000000000000000 0000000000000000 0000000000001000 ffff880144153650
[ 322.438842] Call Trace:
[ 322.438881] [<ffffffff811d8
[ 322.438948] [<ffffffff811d8
[ 322.439013] [<ffffffff81241
[ 322.439084] [<ffffffff81242
[ 322.439168] [<ffffffff81244
[ 322.439251] [<ffffffff81247
[ 322.439322] [<ffffffff81244
[ 322.439398] [<ffffffff81247
[ 322.439461] [<ffffffff811d1
[ 322.439529] [<ffffffff811c0
[ 322.439588] [<ffffffff811c0
[ 322.439658] [<ffffffff81140
[ 322.439730] [<ffffffff81140
[ 322.439800] [<ffffffff8123c
[ 322.439866] [<ffffffff811a6
[ 322.439927] [<ffffffff811a7
[ 322.439986] [<ffffffff811d2
[ 322.440049] [<ffffffff812aa
[ 322.440117] [<ffffffff812ab
[ 322.440186] [<ffffffff812aa
[ 322.443446] [<ffffffff81148
[ 322.446584] [<ffffffff81148
[ 322.449735] [<ffffffff81092
[ 322.453039] [<ffffffff81148
[ 322.455525] [<ffffffff811ed
[ 322.458577] [<ffffffff81089
[ 322.461975] [<ffffffff816ee
[ 322.463799] [<ffffffff81149
[ 322.466051] [<ffffffff8114a
[ 322.468529] [<ffffffff81140
[ 322.471404] [<ffffffff81140
[ 322.474554] [<ffffffff812a9
[ 322.476670] [<ffffffff812a6
[ 322.478669] [<ffffffff811a8
[ 322.481218] [<ffffffff811a8
[ 322.484676] [<ffffffff81081
[ 322.488118] [<ffffffff81064
[ 322.490307] [<ffffffff81071
[ 322.492447] [<ffffffff81064
[ 322.494632] [<ffffffff81074
[ 322.496851] [<ffffffff81012
[ 322.498977] [<ffffffff815d9
[ 322.500196] [<ffffffff81011
[ 322.502213] [<ffffffff81091
[ 322.504268] [<ffffffff81012
[ 322.506307] [<ffffffff816f7
[ 322.508366] Code: f0 2c a6 81 e8 b5 d9 ff ff 4d 85 e4 74 14 49 8d 7c 24 58 e8 b6 9f 96 ff 66 90 4c 89 e7 e8 bc 90 ad ff 5b 41 5c 5d c3 55 48 89 e5 <0f> 0b 55 48 89 e5 0f 0b 55 48 89 e5 0f 0b 55 48 89 e5 0f 0b 55
[ 322.513147] RIP [<ffffffff816e3
[ 322.515577] RSP <ffff8801441534c8>
[ 322.526687] ---[ end trace 37836371a7bce466 ]---
[ 322.526690] Fixing recursive fault but reboot is needed!