CVE-2024-46695

Source
https://cve.org/CVERecord?id=CVE-2024-46695
Import Source
https://storage.googleapis.com/osv-test-cve-osv-conversion/osv-output/CVE-2024-46695.json
JSON Data
https://api.test.osv.dev/v1/vulns/CVE-2024-46695
Downstream
Related
Published
2024-09-13T05:29:23.506Z
Modified
2026-03-20T12:39:05.749025Z
Summary
selinux,smack: don't bypass permissions check in inode_setsecctx hook
Details

In the Linux kernel, the following vulnerability has been resolved:

selinux,smack: don't bypass permissions check in inode_setsecctx hook

Marek Gresko reports that the root user on an NFS client is able to change the security labels on files on an NFS filesystem that is exported with root squashing enabled.

The end of the kerneldoc comment for __vfssetxattrnoperm() states:

  • This function requires the caller to lock the inode's i_mutex before it
  • is executed. It also assumes that the caller will make the appropriate
  • permission checks.

nfsdsetattr() does do permissions checking via fhverify() and nfsdpermission(), but those don't do all the same permissions checks that are done by securityinode_setxattr() and its related LSM hooks do.

Since nfsdsetattr() is the only consumer of securityinode_setsecctx(), simplest solution appears to be to replace the call to __vfssetxattrnoperm() with a call to __vfssetxattrlocked(). This fixes the above issue and has the added benefit of causing nfsd to recall conflicting delegations on a file when a client tries to change its security label.

Database specific
{
    "cna_assigner": "Linux",
    "osv_generated_from": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2024/46xxx/CVE-2024-46695.json"
}
References

Affected packages

Git / git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git

Affected ranges

Type
GIT
Repo
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
Events
Introduced
18032ca062e621e15683cb61c066ef3dc5414a7b
Fixed
2dbc4b7bac60b02cc6e70d05bf6a7dfd551f9dda
Fixed
fe0cd53791119f6287b6532af8ce41576d664930
Fixed
eebec98791d0137e455cc006411bb92a54250924
Fixed
459584258d47ec3cc6245a82e8a49c9d08eb8b57
Fixed
f71ec019257ba4f7ab198bd948c5902a207bad96
Fixed
76a0e79bc84f466999fa501fce5bf7a07641b8a7

Database specific

source
"https://storage.googleapis.com/osv-test-cve-osv-conversion/osv-output/CVE-2024-46695.json"