From patchwork Mon Nov 11 20:16:38 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 179130 Delivered-To: patch@linaro.org Received: by 2002:a92:38d5:0:0:0:0:0 with SMTP id g82csp7142810ilf; Mon, 11 Nov 2019 12:17:22 -0800 (PST) X-Google-Smtp-Source: APXvYqyaiCEXi8V/0pOJnSOW8MJlbveU4h0R3dKeAHv9UHgUIGuVoUJkU1NMwlTlWfuYkqMHHBRU X-Received: by 2002:a50:fb8d:: with SMTP id e13mr27907712edq.213.1573503441843; Mon, 11 Nov 2019 12:17:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573503441; cv=none; d=google.com; s=arc-20160816; b=JJAQkyaXwVOLka1ni6lCfnpH6uBKNsEXo2I9/NCKZTLe1LK5yt9G0RFJloDgPY90nL o39GMO0OLBik6rOCX1AR1INxPB6LbNYSJRntML/hPoqrFn8bzrfpci28Sb2oU2FEI8UU Dlc5zAtIlXevX481KttscekH5f6KYcV7i5kXITjUHh7wUH70SOlT+llBXK7ngl+O3pek yEWOYs9B0+QsB6rVcN2Z5jhwwsXOiq0P6/QKqUnWHAefxhZFk+gjJlhE/EGjxalCl9l3 bjLTgq8VB80rF/kr5Iz4K4HTIocnMCudOSFfOSX7lQsyx39fbblADGEPKRcEwm5HXR2c DlQg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=OqYbjmIJzt7lEdwMnYpEAS/QwUMH5BbFgt3BMU5l97o=; b=bo8L2CJQZ7qWbq189CIyUKUpqQIvmFSIVV4/HFj5WnLh5exVtyE7ZPKKLov2/9MC+U FAQVvoWVYiIikjuUW4Mf5WEhOr2qBCm3P5SWsxDld6AjkWf2X6XrMo3pDyl26hF7KcbA EYi2w5Q32+xoP+3m+DiE7WK6FViUbbXgV10inajnQBVOVFH7DeKHN/IEF7YaJYhuaL0o +Je765XYn13jbESYeSLpWTqPO4n5E0WpDp28svWRUpPRD9GkKFfXiuiwnekB3mRts5N9 3tqE5hHo9MUUFY6yp0SnqxpQnX6M/xHhpuVlQvdLsA2/GcrP1W+bmMNEhR0VJfipgsnf PQpA== 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 gr19si2263040ejb.232.2019.11.11.12.17.21; Mon, 11 Nov 2019 12:17:21 -0800 (PST) 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 S1727709AbfKKURT (ORCPT + 26 others); Mon, 11 Nov 2019 15:17:19 -0500 Received: from mout.kundenserver.de ([212.227.17.10]:54213 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727103AbfKKURK (ORCPT ); Mon, 11 Nov 2019 15:17:10 -0500 Received: from threadripper.lan ([149.172.19.189]) by mrelayeu.kundenserver.de (mreue108 [212.227.15.145]) with ESMTPA (Nemesis) id 1Mate1-1ht0Yh12Ed-00cNxc; Mon, 11 Nov 2019 21:16:52 +0100 From: Arnd Bergmann To: linux-nfs@vger.kernel.org, "J. Bruce Fields" , Chuck Lever , Trond Myklebust , Anna Schumaker Cc: y2038@lists.linaro.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, Arnd Bergmann Subject: [PATCH 18/19] nfsd: use ktime_get_real_seconds() in nfs4_verifier Date: Mon, 11 Nov 2019 21:16:38 +0100 Message-Id: <20191111201639.2240623-19-arnd@arndb.de> X-Mailer: git-send-email 2.20.0 In-Reply-To: <20191111201639.2240623-1-arnd@arndb.de> References: <20191111201639.2240623-1-arnd@arndb.de> MIME-Version: 1.0 X-Provags-ID: V03:K1:3MZ/g5jxoKowkWLqlAfuJN7w4g+Y5UGMW9ve+71EABUtr76lYR3 6Aay31QafEpf1haodQTU7BXFpmYpzicHHH9yi4z7JPgP9ViZds/DpxNh5frARpPdRQqm+0R uktE0QcKl8CDcOeJWR27whgguX5Bw1UmVC4KfMw63AZdZMR9XkwlMcxMafA6QE28cAdQ32o s8VXRovcg4h4RrRCsiSxQ== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1; V03:K0:z0WOA+1LHJI=:5SchLrpliskcZbSi2buxVb lagvOeB0sNZIRBE0oR0YRFXsSzh+M15xiFTdplHM7hJNqWffA4CiwxDahtpYjI1Cu4zvwJBh5 s3TEaHVY8I0BOC/LrzvFmOBR0AkQbYWT+VQmCzPHE4f2cx6ZmZwEwl2SpPpoW7W+qdA802jPA xBgX3qoLC5ORVM4cV4AIvbH0uxobO/xbris+BxQYjLtsIKucEfo628TurEeKTXc8Aw3SPq5I7 5aGa0C9ZP/oVAixGYOD1tk6Rrjy5ACuaYCvoXm08x6k9u6BvtiSXyAv0DAWyDwATt+eDXFdAF kWhvy0HOdxsKY592R5ZOgf1qMgW2PXrfRlI0PKEM5rO5tLpuP2Ibtst7IqJJOSuXgDUftc7+N R7Rpl5LjZaMdj7p1ZLK4NtzLLqbfPAmdD2O5tul8BvSI5JMtqu3JxCjEirGYPKrKj/8nJ3mqd LuNMzhM8gMIN2VFYXZBVGkXUabcolx3XriQh9GrTBoqCqR+8YF0Le0L5sj32DkUyDKCEYUSPL R8V2kJoq0UDrY3rAKCckZ+3DwpIEw9IEeCTTfdVcDXcWxRYs96aX/aivEzlBSA11M68ieMoOg U4kQtBQfHaBb1tpafDDBD5Ci3Xgqy9eK05C6Amr6689o+2WNdmGDZdXJW9HOGcD2x9xe2FSoD LTaRkXo1Q7b8498ijT6YhTvWh9rDBLFYCvK4UqBhGPLZBVhy0gLKaRjHKeAbqoLDGWM80r5So 8ljr6kfb6W8AS9FMXTQ/2vcLpn5vVqeztV/Jab1Xo0DSbZTR5zFV3p+w0w/ljKXhKxFGCA/c6 /p2f5wL7A0IxlZhHS8JUTCkqnJcjqqfef7ybbRnkloDRAHNcmSIudCh1NLRqs0cz+KVXf41NS IHAZvSYCDqlyofiEiSNQ== Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org gen_confirm() generates a unique identifier based on the current time. This overflows in year 2038, but that is harmless since it generally does not lead to duplicates, as long as the time has been initialized by a real-time clock or NTP. Using ktime_get_boottime_seconds() or ktime_get_seconds() would avoid the overflow, but it would be more likely to result in non-unique numbers. Signed-off-by: Arnd Bergmann --- fs/nfsd/nfs4state.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.20.0 diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c index 885a09b3a2c0..cb416b9f6536 100644 --- a/fs/nfsd/nfs4state.c +++ b/fs/nfsd/nfs4state.c @@ -2215,7 +2215,7 @@ static void gen_confirm(struct nfs4_client *clp, struct nfsd_net *nn) * This is opaque to client, so no need to byte-swap. Use * __force to keep sparse happy */ - verf[0] = (__force __be32)get_seconds(); + verf[0] = (__force __be32)(u32)ktime_get_real_seconds(); verf[1] = (__force __be32)nn->clverifier_counter++; memcpy(clp->cl_confirm.data, verf, sizeof(clp->cl_confirm.data)); }