From patchwork Sat Mar 28 15:50:52 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kinglong Mee X-Patchwork-Id: 6114201 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 E7D749F1BE for ; Sat, 28 Mar 2015 15:51:05 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 286142038E for ; Sat, 28 Mar 2015 15:51:05 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 0C51D20386 for ; Sat, 28 Mar 2015 15:51:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752253AbbC1PvD (ORCPT ); Sat, 28 Mar 2015 11:51:03 -0400 Received: from mail-pa0-f50.google.com ([209.85.220.50]:35104 "EHLO mail-pa0-f50.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752192AbbC1PvC (ORCPT ); Sat, 28 Mar 2015 11:51:02 -0400 Received: by pacwz10 with SMTP id wz10so73185014pac.2 for ; Sat, 28 Mar 2015 08:51:01 -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=9kghexNY6GoyAJ2ju+dSZrY5rk3RlZC1oZHRLi51eCo=; b=tdQt5xv33JM06snD4wvG7s9n/0xTUIhAqPcO6xcwBRr38qNp/JtvXJa/lCFAiNGgCs Hfd+hB7pEoacD+CddTFgS/qfv2lz0wUKVOb0Sw/z1U5Jj6H417VN+GUVKWuHe4C/8+vB RkWx7TWwh/1hENHHAkLXCA8AP1kUiKWJVKiDdyHaF47i1T1iG5yFUoAOtQ+rfzV8yTXM +RQFtiUOsS+TxZHnYzeor6dCDdXNlNTEvyzA0ei3tBUjsvY8dxcydws9XnIW9/SAa8zh J8uisdOjuBYi4xkXvdwfT65HTfC8VFqbUkWCWtd2JGJAOfCV5DiP5eSLCl+CnCvDq+v+ pAxw== X-Received: by 10.70.100.170 with SMTP id ez10mr44127750pdb.109.1427557861255; Sat, 28 Mar 2015 08:51:01 -0700 (PDT) Received: from [192.168.99.4] ([104.143.41.79]) by mx.google.com with ESMTPSA id z14sm5414783pbt.21.2015.03.28.08.50.56 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 28 Mar 2015 08:51:00 -0700 (PDT) Message-ID: <5516CDDC.9030000@gmail.com> Date: Sat, 28 Mar 2015 23:50:52 +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 3/4] nfsd: use NFS4_MAXTAGLEN for 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/nfsd/nfs4xdr.c | 2 +- fs/nfsd/xdr4.h | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/fs/nfsd/nfs4xdr.c b/fs/nfsd/nfs4xdr.c index eff0a94..4db519e 100644 --- a/fs/nfsd/nfs4xdr.c +++ b/fs/nfsd/nfs4xdr.c @@ -1808,7 +1808,7 @@ nfsd4_decode_compound(struct nfsd4_compoundargs *argp) argp->opcnt = be32_to_cpup(p++); max_reply += 4 + (XDR_QUADLEN(argp->taglen) << 2); - if (argp->taglen > NFSD4_MAX_TAGLEN) + if (argp->taglen > NFS4_MAXTAGLEN) goto xdr_error; if (argp->opcnt > 100) goto xdr_error; diff --git a/fs/nfsd/xdr4.h b/fs/nfsd/xdr4.h index 8bae5d8..613cece 100644 --- a/fs/nfsd/xdr4.h +++ b/fs/nfsd/xdr4.h @@ -40,7 +40,6 @@ #include "state.h" #include "nfsd.h" -#define NFSD4_MAX_TAGLEN 128 #define XDR_LEN(n) (((n) + 3) & ~3) #define CURRENT_STATE_ID_FLAG (1<<0)