opnsense-src/sys/fs/nfsclient
Mark Johnston 1db8c60c4d 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
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D30090

(cherry picked from commit 8bde6d15d1)
2021-05-10 20:27:51 -04:00
..
nfs.h Remove "struct ucred*" argument from vtruncbuf 2019-05-24 20:27:50 +00:00
nfs_clbio.c nfsclient: add nfs node locking around uses of n_direofoffset 2021-03-15 12:34:13 -07:00
nfs_clcomsubs.c nfsclient: Copy only initialized fields in nfs_getattr() 2021-05-10 20:27:51 -04:00
nfs_clkdtrace.c fs: clean up empty lines in .c and .h files 2020-09-01 21:18:40 +00:00
nfs_clkrpc.c fs: clean up empty lines in .c and .h files 2020-09-01 21:18:40 +00:00
nfs_clnfsiod.c Mark more nodes as CTLFLAG_MPSAFE or CTLFLAG_NEEDGIANT (17 of many) 2020-02-26 14:26:36 +00:00
nfs_clnode.c vfs: drop the de facto curthread argument from VOP_INACTIVE 2020-10-20 07:19:03 +00:00
nfs_clport.c nfsclient: Copy only initialized fields in nfs_getattr() 2021-05-10 20:27:51 -04:00
nfs_clrpcops.c nfsv4 client: do the BindConnectionToSession as required 2021-04-29 17:43:50 -07:00
nfs_clstate.c nfscl: fix delegation recall when the file is not open 2021-05-08 19:55:16 -07:00
nfs_clsubs.c nfsclient: add nfs node locking around uses of n_direofoffset 2021-03-15 12:34:13 -07:00
nfs_clvfsops.c nfs client: depend on xdr 2021-04-23 14:14:09 +03:00
nfs_clvnops.c nfsclient: Copy only initialized fields in nfs_getattr() 2021-05-10 20:27:51 -04:00
nfs_kdtrace.h fs: clean up empty lines in .c and .h files 2020-09-01 21:18:40 +00:00
nfsmount.h Add a new "tlscertname" NFS mount option. 2020-12-23 13:42:55 -08:00
nfsnode.h Fix interface between nfsclient and vnode pager. 2019-10-22 16:17:38 +00:00
nlminfo.h