From patchwork Sat Mar 28 15:49:44 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kinglong Mee X-Patchwork-Id: 6114191 Return-Path: X-Original-To: patchwork-linux-nfs@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id DA8509F1BE for ; Sat, 28 Mar 2015 15:49:56 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 154362039C for ; Sat, 28 Mar 2015 15:49:56 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 320022038E for ; Sat, 28 Mar 2015 15:49:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752195AbbC1Pty (ORCPT ); Sat, 28 Mar 2015 11:49:54 -0400 Received: from mail-pa0-f45.google.com ([209.85.220.45]:33687 "EHLO mail-pa0-f45.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750881AbbC1Ptx (ORCPT ); Sat, 28 Mar 2015 11:49:53 -0400 Received: by pabxg6 with SMTP id xg6so124268317pab.0 for ; Sat, 28 Mar 2015 08:49:53 -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 :references:in-reply-to:content-type:content-transfer-encoding; bh=6nYZrRFOmJyoRnFQ1jtgRMb6JbFIhhS0/ljCGc5E/8w=; b=ZZGesImMIfMa9RNMfIU57/xFs/UhkI84PY4AAGHqmM7TTjWcHi6/iFREL6efYzhR5f +hL3Hg96uqbJ4raNJe1Dw7WiymWlg75us/C1kGFQE+ddZPIyzzMAErDyfNZ32DVFJSIw lsO7HHpwyn/krxxHgU2acDSU0dF3IhZ1gVQPBqGznM2uDJJ+WP7taKrz5IMIxOjFthi7 uHyHKnlv3xCxFMaeRX3/0RBDY9XSxRljz2oTFzPuHwJxoXwuzkiBDHvxzUGZqM13PCKr wKAOHBRmxklQ+G0iioJzrLnnweUpQqITaWjborrA4wg2siN7FvhVDddONIjDcLF7aGC9 g77w== X-Received: by 10.66.193.226 with SMTP id hr2mr45013541pac.47.1427557793412; Sat, 28 Mar 2015 08:49:53 -0700 (PDT) Received: from [192.168.99.4] ([104.143.41.79]) by mx.google.com with ESMTPSA id dr5sm5411859pdb.48.2015.03.28.08.49.48 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 28 Mar 2015 08:49:52 -0700 (PDT) Message-ID: <5516CD98.70706@gmail.com> Date: Sat, 28 Mar 2015 23:49:44 +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: "J. Bruce Fields" , Trond Myklebust CC: Linux NFS Mailing List , Kinglong Mee Subject: [PATCH 2/4] nfs: use NFS4_MAXTAGLEN for cb_taglen checking References: <5516CCDB.4020509@gmail.com> In-Reply-To: <5516CCDB.4020509@gmail.com> 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 Signed-off-by: Kinglong Mee --- fs/nfs/callback_xdr.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/fs/nfs/callback_xdr.c b/fs/nfs/callback_xdr.c index 1737c2e..ea6d4de 100644 --- a/fs/nfs/callback_xdr.c +++ b/fs/nfs/callback_xdr.c @@ -18,8 +18,7 @@ #include "internal.h" #include "nfs4session.h" -#define CB_OP_TAGLEN_MAXSZ (512) -#define CB_OP_HDR_RES_MAXSZ (2 + CB_OP_TAGLEN_MAXSZ) +#define CB_OP_HDR_RES_MAXSZ (2 + NFS4_MAXTAGLEN) #define CB_OP_GETATTR_BITMAP_MAXSZ (4) #define CB_OP_GETATTR_RES_MAXSZ (CB_OP_HDR_RES_MAXSZ + \ CB_OP_GETATTR_BITMAP_MAXSZ + \ @@ -157,7 +156,7 @@ 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) { + if (hdr->taglen > NFS4_MAXTAGLEN) { printk("NFS: NFSv4 CALLBACK %s: server sents tag of length %u\n", __func__, hdr->taglen); return htonl(NFS4ERR_RESOURCE);