nfscl: fix uninitialized memory in nfsv4_loadattr

When processing an RPC response that did not include any Owner
attribute, nfsv4_loadattr would return na_uid and na_gid uninitialized.
The uninitialized values could then make their way into the NFS
attribute cache via nfscl_loadattrcache.

PR:		281279
Reported by:	KMSAN
MFC after:	2 weeks
Reviewed by:	rmacklem
Sponsored by:	Axcient
This commit is contained in:
Alan Somers
2024-09-08 14:42:38 -06:00
parent f93a50d69d
commit 44328abfb7
+1
View File
@@ -1322,6 +1322,7 @@ nfsv4_loadattr(struct nfsrv_descript *nd, vnode_t vp,
* Just set default values to some of the important ones.
*/
if (nap != NULL) {
VATTR_NULL(&nap->na_vattr);
nap->na_type = VREG;
nap->na_mode = 0;
nap->na_rdev = (NFSDEV_T)0;