Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp2996055imm; Sun, 1 Jul 2018 09:58:36 -0700 (PDT) X-Google-Smtp-Source: ADUXVKKl6fnbJskNqsQsW39/3UxU7CCgczsDa7K5zRyuDKCEkL1iqrRybPQlLUT2tmKy3S7Vj4bR X-Received: by 2002:a17:902:8210:: with SMTP id x16-v6mr22672123pln.307.1530464316127; Sun, 01 Jul 2018 09:58:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530464316; cv=none; d=google.com; s=arc-20160816; b=nPo+QbqJrDv6EkCIAUG4klFrHvkYQ9O9JUWYzN/wXnwlg3EaBfKZ7O8DJhjnfaQWoM lAG9mgxA09HxGePub86tstutJ8VJqQQzl7Il+WWrBPOpI8FAEK5Cybi1dZQ0jQwUnJSp tglfwjuP1O/OkfLNJhtF+UP1zUwmEEJMUGC/s5cwh+KJYpeoT6VTukeikZsCDnesdHKV HUe08TnVynTL1XSrC5p9MbrWexw4o9C39PLm5mbphf2nIXWm/2tu/4PucLODix35XA8v +SjBt8SB2h401iWmlt946OmjeMkqof0Z792sPNaCabg0SWlf6PkkplSRtbsHd3fMbzK/ HWgA== 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=22y/gqHeaXLAKxDcgEXu4UIamD7wUY1srVHesOKb5J4=; b=KjPQkwgwzFl3fdP7hDedOUejB7ypSI/vpgOkblQQYhOiye/TQwVV8e8LtWq19ySNWQ XpW2JtpEVYHiPzL++doLyRo0Z6RYmupDQsW89Fk37zvcmLYYq42OvHcjKmDk2po5dt2f i1Dbxhd3XMXmDiBxKeDVMFuFMNt0EonUH47Xd/HyayslbNsrjWDccoqI60w8+43WVHV1 NQeCbuAF0L2fuaMSy0rx1JAmgmQH4HK0+UlNTOggzVj/7UoE0rbCyWLY/ubDmoU3wkdF porXkD0TehuzHy7FMoyeFNmNkgWSzw3Cd3s7ecvTlTshmtT0lUVCEzFxX6Hfi/kRrNwu JSBw== 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 v6-v6si9758341ply.300.2018.07.01.09.58.21; Sun, 01 Jul 2018 09:58:36 -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 S1753351AbeGAQ4F (ORCPT + 99 others); Sun, 1 Jul 2018 12:56:05 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:38140 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932433AbeGAQo6 (ORCPT ); Sun, 1 Jul 2018 12:44:58 -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 38633A73; Sun, 1 Jul 2018 16:44:57 +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.17 182/220] NFSv4: Revert commit 5f83d86cf531d ("NFSv4.x: Fix wraparound issues..") Date: Sun, 1 Jul 2018 18:23:26 +0200 Message-Id: <20180701160915.816469875@linuxfoundation.org> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180701160908.272447118@linuxfoundation.org> References: <20180701160908.272447118@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.17-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 @@ -420,11 +420,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 */