From patchwork Thu Mar 23 18:36:20 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Olga Kornievskaia X-Patchwork-Id: 9641787 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 5236760327 for ; Thu, 23 Mar 2017 18:36:25 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4626525404 for ; Thu, 23 Mar 2017 18:36:25 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3A7B5283F3; Thu, 23 Mar 2017 18:36:25 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.3 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 900A425404 for ; Thu, 23 Mar 2017 18:36:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932304AbdCWSgY (ORCPT ); Thu, 23 Mar 2017 14:36:24 -0400 Received: from mail-io0-f182.google.com ([209.85.223.182]:33620 "EHLO mail-io0-f182.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932128AbdCWSgW (ORCPT ); Thu, 23 Mar 2017 14:36:22 -0400 Received: by mail-io0-f182.google.com with SMTP id f84so3042548ioj.0 for ; Thu, 23 Mar 2017 11:36:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:sender:from:date:message-id:subject:to; bh=8IFEbLSMGIEwi+D+h7L363fmgaauGT9fyBf5CP1Lxis=; b=T70AX3+AB0DyZqPUhjjG3K53DZtsVwgLAnNdiYDseo3xPGQOl9VX81rjCf47IWGALz NpjZ1/rdAh8FwOl6ak7InIY4E5Mvb+JWJTwZRg/E4yGwi9mwD6iLrWaBo/sO3cdnlIr0 nBs5i29ssVVnuMBKMpRkNYmVc36+9H0bMDa/wwlUbYIdBHSNZMiNHSkN0d3w+lAhqK5P NMCDtq1L1EIg7Y4aE6+WzWBVn+09D3eAzO2xyhYlZ8Hy0pNy7V0iWibtkAc6rS0+g1Zf UBtwTFitPrrtWEMhDBSpq0cBiPwNeaZYoEneckRtq243Fj4Hxlt+fov6TgBmdi8ByWUX 71CA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:from:date:message-id:subject :to; bh=8IFEbLSMGIEwi+D+h7L363fmgaauGT9fyBf5CP1Lxis=; b=CHmfUb/laXT0MfN69vRX+nKzYCOzkK6zgPflioJfoJQxXUOhHzBISZtU3v/pIU6bwN ofY+0FxyCAHDaywKKckPql4JBN7Lql4nkXvOjfHA8e7GmKCV+UnBSq2dkDq4G/bqhwKC gexGR8AVK//H4yLV/DNr72QePAOX3/2i4/IdKzBCBaApT6bw4z1+cr55swfbynkB9GtV U5Itc7bUYc/kbZuseL0DephdEaCxJI61xnpRYUuvkmANkkyq/tA/XG1eydga1U2AiCKe tLaTcfGoToL7wdDcsVoK10oAZd/bbc5izr06UHYOTKfvnzNG90atlKEst1Gx4XafbF9y bqGQ== X-Gm-Message-State: AFeK/H3R8FX9AyxOdA/iexioYzv5vCK7Kh7O0Dbk/QNvEpgmOOoSgzreXlj9Byt3tm8P68Tovg4Eyf6PFcLkqQ== X-Received: by 10.107.32.83 with SMTP id g80mr3963213iog.234.1490294181314; Thu, 23 Mar 2017 11:36:21 -0700 (PDT) MIME-Version: 1.0 Received: by 10.107.10.41 with HTTP; Thu, 23 Mar 2017 11:36:20 -0700 (PDT) From: Olga Kornievskaia Date: Thu, 23 Mar 2017 14:36:20 -0400 X-Google-Sender-Auth: QVuURixl9miMa4BC6OaNgnzGCWM Message-ID: Subject: NFSD oops when it receives operation it doesn't support To: "J. Bruce Fields" , linux-nfs Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Hi Bruce, I'm getting this oops when client sends an operation the server doesn't support. in nfsd4_max_reply() it checks for NULL rsize_bop but non-supported operation wouldn't have that set. So maybe something like this for the fix: localhost login: [ 1004.944784] ------------[ cut here ]------------ [ 1004.948710] kernel BUG at fs/nfsd/nfs4proc.c:2495! [ 1004.950640] invalid opcode: 0000 [#1] SMP [ 1004.951821] Modules linked in: rfcomm fuse xt_CHECKSUM ipt_MASQUERADE nf_nat_masquerade_ipv4 tun ip6t_rpfilter ipt_REJECT nf_reject_ipv4 ip6t_REJECT nf_reject_ipv6 xt_conntrack ip_set nfnetlink ebtable_nat ebtable_broute bridge stp llc ip6table_nat nf_conntrack_ipv6 nf_defrag_ipv6 nf_nat_ipv6 ip6table_mangle ip6table_security ip6table_raw iptable_nat nf_conntrack_ipv4 nf_defrag_ipv4 nf_nat_ipv4 nf_nat nf_conntrack iptable_mangle iptable_security iptable_raw ebtable_filter ebtables ip6table_filter ip6_tables iptable_filter vmw_vsock_vmci_transport vsock bnep snd_seq_midi snd_seq_midi_event coretemp crct10dif_pclmul crc32_pclmul ghash_clmulni_intel pcbc snd_ens1371 snd_ac97_codec aesni_intel ac97_bus snd_seq ppdev uvcvideo crypto_simd cryptd glue_helper vmw_balloon snd_pcm videobuf2_vmalloc btusb videobuf2_memops [ 1004.967749] btrtl videobuf2_v4l2 btbcm pcspkr btintel videobuf2_core videodev bluetooth snd_rawmidi snd_timer nfit snd_seq_device snd sg libnvdimm vmw_vmci shpchp i2c_piix4 soundcore rfkill parport_pc parport acpi_cpufreq nfsd auth_rpcgss nfs_acl lockd grace sunrpc ip_tables xfs libcrc32c sr_mod cdrom ata_generic sd_mod pata_acpi crc32c_intel serio_raw vmwgfx drm_kms_helper syscopyarea sysfillrect sysimgblt ata_piix ahci libahci e1000 fb_sys_fops ttm mptspi scsi_transport_spi mptscsih mptbase drm i2c_core libata fjes dm_mirror dm_region_hash dm_log dm_mod [ 1004.979347] CPU: 0 PID: 5532 Comm: nfsd Tainted: G W 4.11.0-rc3 #2 [ 1004.981579] Hardware name: VMware, Inc. VMware Virtual Platform/440BX Desktop Reference Platform, BIOS 6.00 07/02/2015 [ 1004.984473] task: ffff880073125a00 task.stack: ffffc900054a8000 [ 1004.986033] RIP: 0010:nfsd4_max_reply+0x31/0x40 [nfsd] [ 1004.987259] RSP: 0018:ffffc900054abdc8 EFLAGS: 00010246 [ 1004.988466] RAX: 0000000000000000 RBX: 0000000000000040 RCX: 0000000000000003 [ 1004.989993] RDX: 0000000000000006 RSI: ffff880075dc93c0 RDI: ffff8800792a0000 [ 1004.991395] RBP: ffffc900054abe08 R08: ffffffffa04371e0 R09: ffff880043f8de00 [ 1004.992807] R10: ffff880075dca000 R11: 00000000fffffff5 R12: 0000000000000002 [ 1004.994178] R13: 0000000000000000 R14: ffff880075dc93c0 R15: ffff880075dc9000 [ 1004.995548] FS: 0000000000000000(0000) GS:ffff88007b600000(0000) knlGS:0000000000000000 [ 1004.997104] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 1004.998263] CR2: 0000557ccbfee698 CR3: 000000002b072000 CR4: 00000000001406f0 [ 1004.999663] Call Trace: [ 1005.000159] ? nfs4svc_decode_compoundargs+0x1c5/0x540 [nfsd] [ 1005.001273] nfsd_dispatch+0x54/0x1f0 [nfsd] [ 1005.002139] svc_process_common+0x387/0x740 [sunrpc] [ 1005.003150] svc_process+0x105/0x1c0 [sunrpc] [ 1005.004002] nfsd+0xe9/0x160 [nfsd] [ 1005.004749] kthread+0x101/0x140 [ 1005.005431] ? nfsd_destroy+0x60/0x60 [nfsd] [ 1005.006294] ? kthread_park+0x90/0x90 [ 1005.007013] ret_from_fork+0x2c/0x40 [ 1005.007738] Code: 63 06 3d 3c 27 00 00 74 1c 48 8d 04 40 48 c1 e0 04 48 8b 80 98 72 43 a0 48 85 c0 74 0e 55 48 89 e5 ff d0 5d c3 b8 08 00 00 00 c3 <0f> 0b 0f 1f 00 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 00 00 8b [ 1005.011446] RIP: nfsd4_max_reply+0x31/0x40 [nfsd] RSP: ffffc900054abdc8 --- To unsubscribe from this list: send the line "unsubscribe linux-nfs" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/fs/nfsd/nfs4proc.c b/fs/nfsd/nfs4proc.c index cbeeda1..d86031b 100644 --- a/fs/nfsd/nfs4proc.c +++ b/fs/nfsd/nfs4proc.c @@ -2489,7 +2489,7 @@ bool nfsd4_spo_must_allow(struct svc_rqst *rqstp) int nfsd4_max_reply(struct svc_rqst *rqstp, struct nfsd4_op *op) { - if (op->opnum == OP_ILLEGAL) + if (op->opnum == OP_ILLEGAL || op->status == nfserr_notsupp) return op_encode_hdr_size * sizeof(__be32); BUG_ON(OPDESC(op)->op_rsize_bop == NULL);