freebsd-dev/sys/fs/nfs
Mark Johnston 8bde6d15d1 nfsclient: Copy only initialized fields in nfs_getattr()
When loading attributes from the cache, the NFS client is careful to
copy only the fields that it initialized.  After fetching attributes
from the server, however, it would copy the entire vattr structure
initialized from the RPC response, so uninitialized stack bytes would
end up being copied to userspace.  In particular, va_birthtime (v2 and
v3) and va_gen (v3) had this problem.

Use a common subroutine to copy fields provided by the NFS client, and
ensure that we provide a dummy va_gen for the v3 case.

Reviewed by:	rmacklem
Reported by:	KMSAN
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D30090
2021-05-04 08:53:57 -04:00
..
nfs_commonacl.c nfs: Remove APPLESTATIC macro 2020-05-12 13:23:25 +00:00
nfs_commonkrpc.c nfscl: fix the handling of NFSERR_DELAY for Open/LayoutGet RPCs 2021-04-26 17:48:21 -07:00
nfs_commonport.c Fix diroffdiroff, probably copy/paste bug. 2021-02-28 09:08:31 -05:00
nfs_commonsubs.c nfsd: fix the slot sequence# when a callback fails 2021-04-26 16:24:10 -07:00
nfs_var.h nfsd: fix the slot sequence# when a callback fails 2021-04-26 16:24:10 -07:00
nfs.h nfsd: fix NFSv4.0 seqid handling for ERELOOKUP 2021-01-01 14:21:51 -08:00
nfscl.h nfsv4 client: do the BindConnectionToSession as required 2021-04-11 14:34:57 -07:00
nfsclstate.h Add support for NFSv4.2 to the NFS client and server. 2019-12-12 23:22:55 +00:00
nfsdport.h Do not copy vp into f_data for DTYPE_VNODE files. 2020-09-15 21:55:21 +00:00
nfskpiport.h Remove vfs_statfs and vnode_mount macros from NFS 2020-06-17 16:20:19 +00:00
nfsm_subs.h fs: clean up empty lines in .c and .h files 2020-09-01 21:18:40 +00:00
nfsport.h nfsclient: Copy only initialized fields in nfs_getattr() 2021-05-04 08:53:57 -04:00
nfsproto.h nfsv4 client: do the BindConnectionToSession as required 2021-04-11 14:34:57 -07:00
nfsrvcache.h Replace all instances of the typedef mbuf_t with "struct mbuf *". 2020-04-17 21:17:51 +00:00
nfsrvstate.h nfsd: make the server repeat CB_RECALL every couple of seconds 2021-04-04 18:15:54 -07:00
nfsv4_errstr.h Add missing comma in nfsv4_errstr 2020-01-13 21:49:27 +00:00
rpcv2.h fs: clean up empty lines in .c and .h files 2020-09-01 21:18:40 +00:00
xdr_subs.h sys: further adoption of SPDX licensing ID tags. 2017-11-20 19:43:44 +00:00