nfsd: gate nfs2 setacl by argp->mask
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ a257cdd0e2179630d3201c32ba14d7fcb3c3a055 · < f951b22dbeec46f2e0fba81cb80d1b0c686b61eb| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
nfsd: gate nfs2 setacl by argp->mask
The NFSACL v2 SETACL path shares the decoder convention used by its v3 sibling: nfsaclsvc_decode_setaclargs() fills in argp->acl_access only when NFS_ACL is set in the request mask and argp->acl_default only when NFS_DFACL is set, leaving the other pointer NULL because the argument buffer is zeroed up to pc_argzero before decode.
nfsacld_proc_setacl() then hands both pointers to set_posix_acl() unconditionally. set_posix_acl(idmap, dentry, type, NULL) is the VFS "remove this ACL type" operation, so an omitted arm is indistinguishable from an explicit request to delete that ACL. A SETACL carrying only NFS_ACL silently strips the directory's default ACL; mask=0 strips both.
This is the same defect just fixed in nfsd3_proc_setacl(); apply the same remedy. Gate each set_posix_acl() call on its mask bit and initialize error to 0 so that a request with neither bit set leaves the on-disk ACLs untouched and returns success. The out_drop_lock path and the unconditional posix_acl_release() in nfsaclsvc_release_setacl() already tolerate the skipped arms.
From the CVE record · Linux
The Linux kernel's NFSACL v2 SETACL handler can delete directory ACLs that a request did not ask to change. A remote requester who can send a SETACL request can strip the default ACL by specifying only NFS_ACL, or strip both ACLs with a zero mask. The input does not specify authentication or user-interaction requirements.
Operators running Linux kernels with the affected NFSACL v2 SETACL handler should check their kernel versions; affected versions are not specified.