Comment 19 for bug 1670508

Pavel Shilovsky (pshilovsky) wrote :

Hi Kleber,

I tested the Xenial kernel from -proposed and got the following crash:

Jul 13 14:38:05 ubuntu-vm kernel: [ 770.262084] BUG: unable to handle kernel NULL pointer dereference at (null)
Jul 13 14:38:05 ubuntu-vm kernel: [ 770.262087] IP: [<ffffffffc034151c>] cifs_discard_remaining_data+0xc/0x70 [cifs]
Jul 13 14:38:05 ubuntu-vm kernel: [ 770.262098] PGD 7db4fb067 PUD 7d5e3a067 PMD 0
Jul 13 14:38:05 ubuntu-vm kernel: [ 770.262100] Oops: 0000 [#1] SMP
Jul 13 14:38:05 ubuntu-vm kernel: [ 770.262340] Modules linked in: cifs drbg ansi_cprng cmac arc4 md4 nls_utf8 ccm fscache crct10dif_pclmul crc32_pclmul ghash_clmulni_intel aesni_intel i2c_piix4 aes_x86_64 8250_fintek lrw hyperv_fb gf128mul hv_balloon glue_helper ablk_helper cryptd input_leds serio_raw joydev mac_hid nfsd auth_rpcgss nfs_acl lockd grace sunrpc parport_pc ppdev lp parport autofs4 hid_generic hv_netvsc hv_utils ptp hid_hyperv hv_storvsc pps_core hid scsi_transport_fc hyperv_keyboard psmouse pata_acpi hv_vmbus floppy fjes [last unloaded: cifs]
Jul 13 14:38:05 ubuntu-vm kernel: [ 770.262360] CPU: 2 PID: 18568 Comm: cifsd Not tainted 4.4.0-85-generic #108-Ubuntu
Jul 13 14:38:05 ubuntu-vm kernel: [ 770.262361] Hardware name: Microsoft Corporation Virtual Machine/Virtual Machine, BIOS 090006 01/06/2017
Jul 13 14:38:05 ubuntu-vm kernel: [ 770.262362] task: ffff8807e1440f00 ti: ffff8807da868000 task.ti: ffff8807da868000
Jul 13 14:38:05 ubuntu-vm kernel: [ 770.262363] RIP: 0010:[<ffffffffc034151c>] [<ffffffffc034151c>] cifs_discard_remaining_data+0xc/0x70 [cifs]
Jul 13 14:38:05 ubuntu-vm kernel: [ 770.262371] RSP: 0018:ffff8807da86bdc0 EFLAGS: 00010246
Jul 13 14:38:05 ubuntu-vm kernel: [ 770.262372] RAX: 00000000ffffffc3 RBX: ffff8807df0ae200 RCX: 0000000000000000
Jul 13 14:38:05 ubuntu-vm kernel: [ 770.262373] RDX: ffffffffc0390b80 RSI: 0000000000000000 RDI: ffff8807db71c000
Jul 13 14:38:05 ubuntu-vm kernel: [ 770.262373] RBP: ffff8807da86bdd0 R08: 000000000000004d R09: ffff8807da86bcfc
Jul 13 14:38:05 ubuntu-vm kernel: [ 770.262374] R10: 00000000000001fc R11: 0000000000000000 R12: 000000000000004d
Jul 13 14:38:05 ubuntu-vm kernel: [ 770.262375] R13: ffff8800f2fa1c00 R14: ffff8800f2fa1c00 R15: ffff8807df2ea680
Jul 13 14:38:05 ubuntu-vm kernel: [ 770.262376] FS: 0000000000000000(0000) GS:ffff8807e5680000(0000) knlGS:0000000000000000
Jul 13 14:38:05 ubuntu-vm kernel: [ 770.262377] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
Jul 13 14:38:05 ubuntu-vm kernel: [ 770.262377] CR2: 0000000000000000 CR3: 00000007de707000 CR4: 00000000003406e0
Jul 13 14:38:05 ubuntu-vm kernel: [ 770.262379] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
Jul 13 14:38:05 ubuntu-vm kernel: [ 770.262380] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Jul 13 14:38:05 ubuntu-vm kernel: [ 770.262380] Stack:
Jul 13 14:38:05 ubuntu-vm kernel: [ 770.262381] ffff8807df0ae200 000000000000004d ffff8807da86bdf8 ffffffffc034159e
Jul 13 14:38:05 ubuntu-vm kernel: [ 770.262382] ffff8807db71c000 000000000000004d ffff8807df0ae200 ffff8807da86be40
Jul 13 14:38:05 ubuntu-vm kernel: [ 770.262383] ffffffffc0341694 0000000000000000 0000000000000000 ffff8807e1440f00
Jul 13 14:38:05 ubuntu-vm kernel: [ 770.262385] Call Trace:
Jul 13 14:38:05 ubuntu-vm kernel: [ 770.262391] [<ffffffffc034159e>] cifs_readv_discard+0x1e/0x40 [cifs]
Jul 13 14:38:05 ubuntu-vm kernel: [ 770.262396] [<ffffffffc0341694>] cifs_readv_receive+0xd4/0x590 [cifs]
Jul 13 14:38:05 ubuntu-vm kernel: [ 770.262402] [<ffffffffc034f4f8>] cifs_demultiplex_thread+0x778/0xac0 [cifs]
Jul 13 14:38:05 ubuntu-vm kernel: [ 770.262408] [<ffffffffc034ed80>] ? cifs_handle_standard+0x130/0x130 [cifs]
Jul 13 14:38:05 ubuntu-vm kernel: [ 770.262410] [<ffffffff810a0c85>] kthread+0xe5/0x100
Jul 13 14:38:05 ubuntu-vm kernel: [ 770.262412] [<ffffffff810a0ba0>] ? kthread_create_on_node+0x1e0/0x1e0
Jul 13 14:38:05 ubuntu-vm kernel: [ 770.262414] [<ffffffff8184224f>] ret_from_fork+0x3f/0x70
Jul 13 14:38:05 ubuntu-vm kernel: [ 770.262415] [<ffffffff810a0ba0>] ? kthread_create_on_node+0x1e0/0x1e0
Jul 13 14:38:05 ubuntu-vm kernel: [ 770.262416] Code: 84 69 fe ff ff 44 89 f0 eb 92 41 81 4d 00 00 00 02 00 e9 31 ff ff ff e8 03 fc d3 c0 0f 1f 00 0f 1f 44 00 00 55 48 89 e5 41 54 53 <8b> 06 bb 04 00 00 00 2b 9f 60 03 00 00 49 89 fc 0f c8 25 ff ff
Jul 13 14:38:05 ubuntu-vm kernel: [ 770.262429] RIP [<ffffffffc034151c>] cifs_discard_remaining_data+0xc/0x70 [cifs]
Jul 13 14:38:05 ubuntu-vm kernel: [ 770.262435] RSP <ffff8807da86bdc0>
Jul 13 14:38:05 ubuntu-vm kernel: [ 770.262435] CR2: 0000000000000000
Jul 13 14:38:05 ubuntu-vm kernel: [ 770.262437] ---[ end trace 5ac5926a1424b7e6 ]---

I think this issue is caused by commit http://kernel.ubuntu.com/git/ubuntu/ubuntu-xenial.git/commit/?h=master-next&id=bdf2bdef7c7b61663266d942fabd528a4c7eddda which is a copy of upstream commit. In upstream the issue has been fixed by commit https://github.com/torvalds/linux/commit/350be257ea83029daee974c72b1fe2e6f1f8e615. I did cherry-picked it into your Xenial branch and run small tests - it went well. Can you please apply the latter commit as well to the proposed kernel?

Also, you might want to consider merging one more commit for encryption series to your branches (small bugfix) - https://github.com/torvalds/linux/commit/517a6e43c4872c89794af5b377fa085e47345952.