NetBSD-Bugs archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Re: kern/57279: 32 bit time_t leftover in NFS code
The following reply was made to PR kern/57279; it has been noted by GNATS.
From: Izumi Tsutsui <tsutsui%ceres.dti.ne.jp@localhost>
To: gnats-bugs%netbsd.org@localhost
Cc: tsutsui%ceres.dti.ne.jp@localhost
Subject: Re: kern/57279: 32 bit time_t leftover in NFS code
Date: Wed, 22 Mar 2023 00:37:02 +0900
mlelstv@ wrote:
> >--- sys/nfs/nfs_iod.c 3 Sep 2018 16:29:36 -0000 1.8
> >+++ sys/nfs/nfs_iod.c 21 Mar 2023 14:09:19 -0000
> >@@ -409,7 +409,8 @@ nfs_savenickauth(struct nfsmount *nmp, k
> > struct timeval ktvin, ktvout;
> > u_int32_t nick;
> > char *dpos = *dposp, *cp2;
> >- int deltasec, error = 0;
> >+ time_t deltasec;
> >+ int error = 0;
> >
> > memset(&ktvout, 0, sizeof ktvout); /* XXX gcc */
>
>
> That part doesn't look sufficient. The code is working with 32bit
> timestamps and probably needs some rewrite to operate correctly
> with 64bit timestamps.
Yes, it looks more code that uses long for tv_sec in XDR RPC:
https://github.com/NetBSD/src/blob/netbsd-9/sys/nfs/nfs_iod.c#L430-L431
> ktvout.tv_sec = fxdr_unsigned(long, ktvout.tv_sec);
https://github.com/NetBSD/src/blob/netbsd-9/sys/nfs/nfs_serv.c#L1006
> *tl++ = txdr_unsigned(boottime.tv_sec);
but at least "deltasec" should be time_t anyway.
---
Izumi Tsutsui
Home |
Main Index |
Thread Index |
Old Index