CVE-2024-46695: selinux,smack: don't bypass permissions check in inode_setsecctx hook

Published Sep 13, 2024
·
Updated

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

selinux,smack: don't bypass permissions check in inodesetsecctx 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 imutex 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 securityinodesetxattr() and its related LSM hooks do.

Since nfsdsetattr() is the only consumer of securityinodesetsecctx(), 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.

Other sources

selinuxsmack: don't bypass permissions check in inodesetsecctx hook

Microsoft

Affected Software

14 affected componentsFixes available
Linux Linux kernel<6.6.49
Linux Linux kernel>=6.7<6.10.8
Linux Linux kernel=6.11-rc1
Linux Linux kernel=6.11-rc2
Linux Linux kernel=6.11-rc3
Linux Linux kernel=6.11-rc4
Linux Linux kernel=6.11-rc5
debian/linux<=5.10.223-1
5.10.234-16.1.129-16.1.135-16.12.25-16.12.27-1
debian/linux-6.1
6.1.129-1~deb11u1
Microsoft cbl2 kernel 5.15.182.1-1
Microsoft cbl2 kernel 5.15.182.1-1
Microsoft azl3 kernel 6.6.51.1-5
Microsoft azl3 kernel 6.6.47.1-1
Microsoft cbl2 kernel 5.15.176.3-1

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade debian/linux to a version that resolves this vulnerability.

    Fixed in 5.10.234-1Fixed in 6.1.129-1Fixed in 6.1.135-1Fixed in 6.12.25-1Fixed in 6.12.27-1
  2. Upgrade

    Upgrade debian/linux-6.1 to a version that resolves this vulnerability.

    Fixed in 6.1.129-1~deb11u1
  3. Configuration

    Update the Linux kernel code so the inode_setsecctx hook uses __vfs_setxattr_locked() instead of __vfs_setxattr_noperm(), ensuring i_mutex is held and permission checks are not bypassed.

    Linux kernel (NFS security label change path) Replace __vfs_setxattr_noperm() call with __vfs_setxattr_locked() in the security_inode_setsecctx (inode_setsecctx) hook consumer path = __vfs_setxattr_locked()

Event History

Sep 13, 2024
CVE Published
via MITRE·05:29 AM
Data Sourced
via MITRE·05:29 AM
DescriptionSeverity
Data Sourced
via NVD·06:15 AM
RemedyDescriptionSeverityWeaknessAffected Software
Data Sourced
via Red Hat·06:21 AM
DescriptionSeverityAffected Software
Oct 16, 2024
Data Sourced
via Microsoft·07:00 AM
DescriptionSeverityWeakness
Data Sourced
via Microsoft·07:00 AM
Affected Software
Updated
via Microsoft·07:00 AM
SeverityAffected Software
Updated
via Microsoft·07:00 AM
Affected Software
Updated
via Microsoft·07:00 AM
DescriptionSeverity
Apr 27, 2025
Data Sourced
via Ubuntu·08:37 PM
RemedyDescriptionSeverityAffected Software

Frequently Asked Questions

1

What is the severity of CVE-2024-46695?

CVE-2024-46695 has a medium severity rating due to its potential impact on file security in NFS environments.

2

How do I fix CVE-2024-46695?

To fix CVE-2024-46695, update the Linux kernel to version 6.1.123-1 or later.

3

Which Linux kernel versions are affected by CVE-2024-46695?

CVE-2024-46695 affects Linux kernel versions from 6.7 up to 6.6.49 as well as certain release candidates.

4

Can a root user exploit CVE-2024-46695?

Yes, a root user on an NFS client can change security labels on exported files, which constitutes an exploitation of CVE-2024-46695.

5

What is the importance of fixing CVE-2024-46695?

Fixing CVE-2024-46695 is important to prevent unauthorized changes to file security labels that could compromise system integrity.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203