From patchwork Sat Mar 28 15:46:20 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kinglong Mee X-Patchwork-Id: 6114171 Return-Path: X-Original-To: patchwork-linux-nfs@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 66E0BBF4A6 for ; Sat, 28 Mar 2015 15:46:34 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 961D42038E for ; Sat, 28 Mar 2015 15:46:33 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 8A83820386 for ; Sat, 28 Mar 2015 15:46:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751530AbbC1Pq3 (ORCPT ); Sat, 28 Mar 2015 11:46:29 -0400 Received: from mail-pd0-f169.google.com ([209.85.192.169]:33727 "EHLO mail-pd0-f169.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750829AbbC1Pq2 (ORCPT ); Sat, 28 Mar 2015 11:46:28 -0400 Received: by pdnc3 with SMTP id c3so127362031pdn.0 for ; Sat, 28 Mar 2015 08:46:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:cc:subject :content-type:content-transfer-encoding; bh=ctcEPzDny52EfHMSRDu6gHKsRznTkAKUT0f9dC/88ug=; b=rAVnxBPOBWXISVbN9LMNihrGDgHS8dZ2GkEnTH/YcwPMj+Fwx/1zgZLOy/79Ksusfi KUALCmDlrVDyPYYDAywb7UEae+Iu9nmrOt2i6Dj02S7WM7s3lN37Yd9lgn+gjI1fkbpd FyYgNBdRajNtp4aA6lJtDVOzFqiezGluOhfgcGav3MZcvZRuaxJd9y9a9KX6ofEUVcal ajRx45/fPk/Fp1uZyMZasMNd33TqZYjMvfniXiNHMdFD2fSDvGQLQ8oidwToCN6qeu3v Fs0eamevzdFYGO8t/sNGrxkEupv2WRjKrTCcjXevrZsXYuh98M3nwoNdtqm0HLgWJ3ND tJJw== X-Received: by 10.67.14.73 with SMTP id fe9mr44819800pad.10.1427557588249; Sat, 28 Mar 2015 08:46:28 -0700 (PDT) Received: from [192.168.99.4] ([104.143.41.79]) by mx.google.com with ESMTPSA id ms7sm5417505pdb.8.2015.03.28.08.46.24 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 28 Mar 2015 08:46:27 -0700 (PDT) Message-ID: <5516CCCC.7060509@gmail.com> Date: Sat, 28 Mar 2015 23:46:20 +0800 From: Kinglong Mee User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.5.0 MIME-Version: 1.0 To: Trond Myklebust CC: Linux NFS Mailing List , kinglongmee@gmail.com Subject: [PATCH] nfs: fix bad checking of callback operation's taglen Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Does not need decrease of 12 here. Signed-off-by: Kinglong Mee --- fs/nfs/callback_xdr.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fs/nfs/callback_xdr.c b/fs/nfs/callback_xdr.c index 19ca95c..1737c2e 100644 --- a/fs/nfs/callback_xdr.c +++ b/fs/nfs/callback_xdr.c @@ -157,8 +157,8 @@ static __be32 decode_compound_hdr_arg(struct xdr_stream *xdr, struct cb_compound if (unlikely(status != 0)) return status; /* We do not like overly long tags! */ - if (hdr->taglen > CB_OP_TAGLEN_MAXSZ - 12) { - printk("NFS: NFSv4 CALLBACK %s: client sent tag of length %u\n", + if (hdr->taglen > CB_OP_TAGLEN_MAXSZ) { + printk("NFS: NFSv4 CALLBACK %s: server sents tag of length %u\n", __func__, hdr->taglen); return htonl(NFS4ERR_RESOURCE); }