CVE-2024-46695

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

9.8 critical EPSS 0.53%

Published 13 Sep 2024 Updated 5 Aug 2026 CNA: Linux

Check your servers for CVE-2024-46695

The Vulnpocalypse collector sends the package list of each Linux server and of its container images once a day. Vulnpocalypse shows every server where CVE-2024-46695 affects the running kernel, with the command that installs the fix. The free plan covers one server and one domain and does not need a credit card.

Check my servers

Description

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 __vfs_setxattr_noperm() 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.

nfsd_setattr() does do permissions checking via fh_verify() and nfsd_permission(), but those don't do all the same permissions checks that are done by security_inode_setxattr() and its related LSM hooks do.

Since nfsd_setattr() is the only consumer of security_inode_setsecctx(), simplest solution appears to be to replace the call to __vfs_setxattr_noperm() with a call to __vfs_setxattr_locked(). 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.

Severity (CVSS)

9.8 critical CVSS 3.1 from Linux (CNA)
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
Attack vector
network: an attacker can reach the vulnerable part over the network, often from the internet
Attack complexity
low: an attack works without special conditions
Privileges required
none: the attacker does not need an account
User interaction
none: nobody has to click or open anything
Scope
unchanged: the damage stays inside the vulnerable component
Impact
confidentiality high, integrity high, availability high: what an attacker can read (confidentiality), change (integrity) or stop (availability)

Exploitation

EPSS 0.53%: the probability of exploitation activity in the next 30 days, from the EPSS model of FIRST. The score is higher than 46.3% of all scored CVEs. Scores of 1 Dec 2026.

The assessment of CISA (SSVC, 29 Sep 2024):

Exploitation
none: CISA did not find evidence of exploitation or a public proof of concept
Automatable
no: each attack takes manual steps
Technical impact
partial: limited control or limited data

Affected products

As the CNA lists them.

ProductVersions
Linux
affected from 18032ca062e621e15683cb61c066ef3dc5414a7b, before 2dbc4b7bac60b02cc6e70d05bf6a7dfd551f9dda
affected from 18032ca062e621e15683cb61c066ef3dc5414a7b, before fe0cd53791119f6287b6532af8ce41576d664930
affected from 18032ca062e621e15683cb61c066ef3dc5414a7b, before eebec98791d0137e455cc006411bb92a54250924
affected from 18032ca062e621e15683cb61c066ef3dc5414a7b, before 459584258d47ec3cc6245a82e8a49c9d08eb8b57
affected from 18032ca062e621e15683cb61c066ef3dc5414a7b, before f71ec019257ba4f7ab198bd948c5902a207bad96
affected from 18032ca062e621e15683cb61c066ef3dc5414a7b, before 76a0e79bc84f466999fa501fce5bf7a07641b8a7
Other versions: unaffected
Linux
affected 3.11
unaffected before 3.11
unaffected from 5.10.227 up to and including 5.10.*
unaffected from 5.15.168 up to and including 5.15.*
unaffected from 6.1.113 up to and including 6.1.*
unaffected from 6.6.49 up to and including 6.6.*
unaffected from 6.10.8 up to and including 6.10.*
unaffected 6.11 and later
Other versions: affected

Is my server affected?

This CVE is in the Linux kernel. Compare the running kernel with the fixed kernel version of your distribution, and reboot after a kernel update:

uname -r
# Debian, Ubuntu: does the changelog of the running kernel name the CVE?
zgrep -l CVE-2024-46695 /usr/share/doc/linux-image-$(uname -r)/changelog.Debian.gz
# RHEL, Rocky, Alma
rpm -q --changelog kernel | grep CVE-2024-46695

With Trivy, on the host and for a container image. When a package is affected, it prints the installed and the fixed version:

trivy rootfs --scanners vuln / | grep CVE-2024-46695
trivy image --scanners vuln IMAGE | grep CVE-2024-46695

Vulnpocalypse makes this comparison every day for the package lists of your servers and container images, including language packages (npm, PyPI, Go, Maven and others), and sends the command that installs the fix. Start free with one server and one domain or read how to install the collector.

References

Other references

Source: the record CVE-2024-46695 of the CVE List (CVE Program), CVE Terms of Use; the CISA KEV catalog and the CISA ADP container; EPSS of FIRST. The text of the record is shown as published. Data sources and licences.