Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp3055609imm; Sun, 1 Jul 2018 11:12:03 -0700 (PDT) X-Google-Smtp-Source: AAOMgpfFd4UmRuQBbnYIxfDJ5Lc+u4OG6gqIwP/s0P2Rso9DIfu9yJkadog4PKiUILSbOXyniX1x X-Received: by 2002:a62:1e81:: with SMTP id e123-v6mr22203875pfe.188.1530468723004; Sun, 01 Jul 2018 11:12:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530468722; cv=none; d=google.com; s=arc-20160816; b=0dDrbQbvTipaGwWhMwzF4QVMYE/hgNpQJpdFqaiVJkDAw05zw3X0/v0iOyGriUWFTL FVL8hkENNV3gx6cOw4Z9OOnNTFV5YRrGsOBZ2eRuF4UAHSvIijhAIdTH1YlEnrBY8tmy 42AAGInQvLzbvqdOpgdQCNA62aPm5nsxaE/0D3CYpK9optINrV4SC3mPyN1KCaQ78e3z wq/+BAE1FcVF30slgbTOG1OiMCy5/ZYltddCMyGOM1xhce8HIeiWM+NacZIekGpOwwIz UxkYkYjTJuis8cGx+Nw5qXI8Swih62y/MVingZ34+Ma94y4D5wMilLCtJHHw1XTJ/vpZ vygg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=PDtFB3AoJ3GdkTg5T7sNBpdueD9fneeKz037AShs6ok=; b=iVFWm4rHP9HLV1FOPNfqsUXog+h3oFRUyAE5Uz2Il6ZpagdV+CrmrVoo9pBOqIxqBJ jpFmyuPQayW9TMk99LJe/xo/+0UOc/tqOIFDZn2XxhUjhU5GCmMC6wPC7hRQzr9R6m6v EU7dVNKDgr1vT91XgrG8zL6Hiz87+T6MSXs15J9ToxOrX7Vf77EWq/kucS8y+7ADS+0C oYA0BlPCg0LgbgD2FYT9UZCpERX1OM04eUsguKGh6C72WlZkZEDy7oJj28AQhOOddv3D c7ZdYld7CJVaqj0xcKYJT93c4wfrOijYamFJSJmOnAwUrlTQ0Nexusg8efz24kot5VU+ mH/w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h2-v6si9315048pfg.126.2018.07.01.11.11.48; Sun, 01 Jul 2018 11:12:02 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1030235AbeGASJh (ORCPT + 99 others); Sun, 1 Jul 2018 14:09:37 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:34260 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S965630AbeGAQ2I (ORCPT ); Sun, 1 Jul 2018 12:28:08 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 3143B92B; Sun, 1 Jul 2018 16:28:06 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Trond Myklebust Subject: [PATCH 4.9 086/101] NFSv4: Revert commit 5f83d86cf531d ("NFSv4.x: Fix wraparound issues..") Date: Sun, 1 Jul 2018 18:22:12 +0200 Message-Id: <20180701160800.600914361@linuxfoundation.org> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180701160757.138608453@linuxfoundation.org> References: <20180701160757.138608453@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.9-stable review patch. If anyone has any objections, please let me know. ------------------ From: Trond Myklebust commit fc40724fc6731d90cc7fb6d62d66135f85a33dd2 upstream. The correct behaviour for NFSv4 sequence IDs is to wrap around to the value 0 after 0xffffffff. See https://tools.ietf.org/html/rfc5661#section-2.10.6.1 Fixes: 5f83d86cf531d ("NFSv4.x: Fix wraparound issues when validing...") Cc: stable@vger.kernel.org # 4.6+ Signed-off-by: Trond Myklebust Signed-off-by: Greg Kroah-Hartman --- fs/nfs/callback_proc.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) --- a/fs/nfs/callback_proc.c +++ b/fs/nfs/callback_proc.c @@ -402,11 +402,8 @@ validate_seqid(const struct nfs4_slot_ta return htonl(NFS4ERR_SEQ_FALSE_RETRY); } - /* Wraparound */ - if (unlikely(slot->seq_nr == 0xFFFFFFFFU)) { - if (args->csa_sequenceid == 1) - return htonl(NFS4_OK); - } else if (likely(args->csa_sequenceid == slot->seq_nr + 1)) + /* Note: wraparound relies on seq_nr being of type u32 */ + if (likely(args->csa_sequenceid == slot->seq_nr + 1)) return htonl(NFS4_OK); /* Misordered request */