X-GM-THRID: 6210359704363728896 X-Received: by 10.28.88.135 with SMTP id m129mr4061627wmb.4.1446595451368; Tue, 03 Nov 2015 16:04:11 -0800 (PST) X-BeenThere: outreachy-kernel@googlegroups.com Received: by 10.28.136.143 with SMTP id k137ls975916wmd.28.canary; Tue, 03 Nov 2015 16:04:10 -0800 (PST) X-Received: by 10.28.87.15 with SMTP id l15mr4065588wmb.1.1446595450851; Tue, 03 Nov 2015 16:04:10 -0800 (PST) Return-Path: Received: from mout.kundenserver.de (mout.kundenserver.de. [212.227.17.24]) by gmr-mx.google.com with ESMTPS id l1si726491wmb.1.2015.11.03.16.04.10 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 03 Nov 2015 16:04:10 -0800 (PST) Received-SPF: neutral (google.com: 212.227.17.24 is neither permitted nor denied by best guess record for domain of arnd@arndb.de) client-ip=212.227.17.24; Authentication-Results: gmr-mx.google.com; spf=neutral (google.com: 212.227.17.24 is neither permitted nor denied by best guess record for domain of arnd@arndb.de) smtp.mailfrom=arnd@arndb.de Received: from wuerfel.localnet ([134.3.118.24]) by mrelayeu.kundenserver.de (mreue101) with ESMTPSA (Nemesis) id 0MUW15-1a2noa2FsZ-00RFh5; Wed, 04 Nov 2015 01:04:07 +0100 From: Arnd Bergmann To: y2038@lists.linaro.org Cc: Ksenija Stanojevic , outreachy-kernel@googlegroups.com Subject: Re: [Y2038] [PATCH 1/5] fs: nfsd: Replace time_t with u32 in boot_time Date: Wed, 04 Nov 2015 01:04:06 +0100 Message-ID: <16034171.mcXgMm0kJL@wuerfel> User-Agent: KMail/4.11.5 (Linux/3.16.0-10-generic; KDE/4.11.5; x86_64; ; ) In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Provags-ID: V03:K0:d6qDnCdLh0V1pDTxQJ838/3yCYZV4n5Rkvl2Xyn3u1i2JyNlXaB MwMc8eOJDbrvWyXn1Y2Kil3tR6S3eFzEMa/yp333lgbvQV5/Z6/YsFMW6XYyxXArHYE92r6 02XV9WDzBBQi0rp4dY9I0EqTmOsCgGarNQun4fSDb4IN1obEWp/fpwU/BAmsmFudL/mDMU2 TmJt/HzNH4R5586sMu6ug== X-UI-Out-Filterresults: notjunk:1;V01:K0:vhusSNv+9Hg=:4mrkk+20mWl+VCfvuT5fYK yZhEcwL+VdwMBjkA6DuLQkpY4rr6AAJ0tIErWLV5XG1Z5TxeLyVRIc2vN1f9qhLKbXHxpBG1n QmxHKjYOuzsPNlaYv483czjEAtGu/9crTG823hRO/6DenQ5o26c6BYLkQr+ScILEBfYfHH7M/ xPj9B7bvGQruY/J8fItNVHisPwP51UsXPepg38HmZ17cBDmiXAV7Lg1NGh/0VmDVmc4Vt4zPe IFc8bs8Dl8X6qtVBwcP9qdspfEuWdMMxPjubT6wdb7+Gc1hhEaFj/8iPDVHA/G5qxFnVvb8Mc gh4Vigm29ndLJR1pxVx8jbWcDavb+1FM1zVSTzhRLhG8WMMijRiULHtY2t2IKjMvYoPBsmXPw NcCotVnb3UmfBBXOlKNK2z0xWWv4Kfpcja8Zrj844qZsoY5xEWxH/0QsbjyEx+AKSgOHqGcRC UVvTKIHWgOsM0TAg6hYXETub3cBJGQqW9PI2ZOo3ovMv2uGw5M+7QHpb8F/2qN++ZGo96xZyA yTgL3/C3y3ogzCmF1c0sMDRoKni8aPr8xsNkRwPdKHBxI+CyVj2ew8O86D4OSSxtPqhaKKzf5 R+nPn8LM+a6hWczraD1XTyB8jEQY5STEi4iBhRYivn69COqbKad0x7fZYCzau4c1840SvNSez /S7uqKKejtdy56F+wfj64FR6TvL7TpApfK7QCJ7PqJCINZZLePRuaDI2qkdRUgYoaSgGBx0uM x/UzoUxRpIquV/xC On Tuesday 27 October 2015 09:08:35 Ksenija Stanojevic wrote: > Replace time_t type and get_seconds function which are not y2038 safe on > 32-bit systems. Function ktime_get_seconds use monotonic instead of real > time and therefore will not cause overflow. > > Signed-off-by: Ksenija Stanojevic I don't think using monotonic time is safe here: > diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c > index 0f1d569..8245236 100644 > --- a/fs/nfsd/nfs4state.c > +++ b/fs/nfsd/nfs4state.c > @@ -1612,9 +1612,9 @@ STALE_CLIENTID(clientid_t *clid, struct nfsd_net *nn) > * precisely 2^32 (about 136 years) before this one. That seems > * a safe assumption: > */ > - if (clid->cl_boot == (u32)nn->boot_time) > + if (clid->cl_boot == nn->boot_time) > return 0; It looks like clid->cl_boot comes from a machine on the other side of the network, and we need to ensure that the values are unique above all things. > --- a/fs/nfsd/state.h > +++ b/fs/nfsd/state.h > @@ -305,7 +305,7 @@ struct nfs4_client { > #endif > struct xdr_netobj cl_name; /* id generated by client */ > nfs4_verifier cl_verifier; /* generated by client */ > - time_t cl_time; /* time of last lease renewal */ > + u32 cl_time; /* time of last lease renewal */ > struct sockaddr_storage cl_addr; /* client ipaddress */ > bool cl_mach_cred; /* SP4_MACH_CRED in force */ > struct svc_cred cl_cred; /* setclientid principal */ > This change seems unrelated to the rest of this patch. Arnd