Skip to content

Commit

Permalink
nfscl: fix uninitialized memory in nfsv4_loadattr
Browse files Browse the repository at this point in the history
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
  • Loading branch information
asomers committed Sep 8, 2024
1 parent f93a50d commit 44328ab
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions sys/fs/nfs/nfs_commonsubs.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 44328ab

Please sign in to comment.