From patchwork Thu Sep 24 12:58:16 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kinglong Mee X-Patchwork-Id: 7256491 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 DBED89F30C for ; Thu, 24 Sep 2015 12:58:30 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 0A4C520830 for ; Thu, 24 Sep 2015 12:58:30 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 2F43E2082E for ; Thu, 24 Sep 2015 12:58:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754136AbbIXM62 (ORCPT ); Thu, 24 Sep 2015 08:58:28 -0400 Received: from mail-pa0-f49.google.com ([209.85.220.49]:36470 "EHLO mail-pa0-f49.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753627AbbIXM61 (ORCPT ); Thu, 24 Sep 2015 08:58:27 -0400 Received: by pacgz1 with SMTP id gz1so6161857pac.3 for ; Thu, 24 Sep 2015 05:58:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=subject:to:references:cc:from:message-id:date:user-agent :mime-version:in-reply-to:content-type:content-transfer-encoding; bh=YPLclPQXiXD3thPPJvgfTRLVBOcZxHwXkME9/Oeaxv8=; b=mIUctyZ437SqfyW9RGm9e13iddqZ/jHMvzweZ/g73jvAHylBo9IuzXB2mzuQ5zyjhM pg289Zh+/53xxRhk+ZknlsMc77oNOXqC3noMo5znOTLICEZheAIlaGuYIqzBA/tjQh+9 yO8nRvUudFJXpk+MKXcy+o4cA0fjPUf9NBi0TranfJUXjiX8dFdemuyMuElE103LiZ5Y ac0ipwRPzfIbgjmm+OIJnA7+BcxcXhIzGWtsQAnZvwr8ot+swMDnixPA4wE2IjwSspla k1ie/XthnJbnm9C/RWfTXqtw0KFQi6rQvjuBGEiVkzYp19HEZmczOtBbu64uGxkix/yc xigw== X-Received: by 10.68.184.5 with SMTP id eq5mr44869501pbc.130.1443099507380; Thu, 24 Sep 2015 05:58:27 -0700 (PDT) Received: from [192.168.99.26] ([104.143.41.79]) by smtp.googlemail.com with ESMTPSA id jw6sm13590992pbb.86.2015.09.24.05.58.23 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 24 Sep 2015 05:58:26 -0700 (PDT) Subject: [PATCH 7/8] NFS: Fix bad checking of max taglen in callback request To: Trond Myklebust References: <5603F269.9060102@gmail.com> Cc: "linux-nfs@vger.kernel.org" , kinglongmee@gmail.com From: Kinglong Mee Message-ID: <5603F368.1080304@gmail.com> Date: Thu, 24 Sep 2015 20:58:16 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.2.0 MIME-Version: 1.0 In-Reply-To: <5603F269.9060102@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, RP_MATCHES_RCVD, T_DKIM_INVALID, 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 The taglen should be checked with CB_OP_TAGLEN_MAXSZ directly. Signed-off-by: Kinglong Mee --- fs/nfs/callback_xdr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/nfs/callback_xdr.c b/fs/nfs/callback_xdr.c index 9f0f0f6..4ad39fe 100644 --- a/fs/nfs/callback_xdr.c +++ b/fs/nfs/callback_xdr.c @@ -159,7 +159,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 - 12) { + if (hdr->taglen > CB_OP_TAGLEN_MAXSZ) { printk("NFS: NFSv4 CALLBACK %s: client sent tag of length %u\n", __func__, hdr->taglen); return htonl(NFS4ERR_RESOURCE);