CVE-2024-46695 (GCVE-0-2024-46695)
Vulnerability from cvelistv5
Published
2024-09-13 05:29
Modified
2026-08-05 11:37
Severity ?
Summary
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.
Impacted products
Vendor Product Version
Linux Linux Version: 18032ca062e621e15683cb61c066ef3dc5414a7b
Version: 18032ca062e621e15683cb61c066ef3dc5414a7b
Version: 18032ca062e621e15683cb61c066ef3dc5414a7b
Version: 18032ca062e621e15683cb61c066ef3dc5414a7b
Version: 18032ca062e621e15683cb61c066ef3dc5414a7b
Version: 18032ca062e621e15683cb61c066ef3dc5414a7b
Create a notification for this product.
Show details on NVD website


{
  "containers": {
    "adp": [
      {
        "metrics": [
          {
            "other": {
              "content": {
                "id": "CVE-2024-46695",
                "options": [
                  {
                    "Exploitation": "none"
                  },
                  {
                    "Automatable": "no"
                  },
                  {
                    "Technical Impact": "partial"
                  }
                ],
                "role": "CISA Coordinator",
                "timestamp": "2024-09-29T15:05:47.775114Z",
                "version": "2.0.3"
              },
              "type": "ssvc"
            }
          }
        ],
        "providerMetadata": {
          "dateUpdated": "2024-09-29T15:06:01.561Z",
          "orgId": "134c704f-9b21-4f2e-91b3-4a467353bcc0",
          "shortName": "CISA-ADP"
        },
        "title": "CISA ADP Vulnrichment"
      },
      {
        "providerMetadata": {
          "dateUpdated": "2025-11-03T22:16:30.596Z",
          "orgId": "af854a3a-2127-422b-91ae-364da2661108",
          "shortName": "CVE"
        },
        "references": [
          {
            "url": "https://lists.debian.org/debian-lts-announce/2025/03/msg00002.html"
          },
          {
            "url": "https://lists.debian.org/debian-lts-announce/2025/01/msg00001.html"
          }
        ],
        "title": "CVE Program Container"
      }
    ],
    "cna": {
      "affected": [
        {
          "defaultStatus": "unaffected",
          "product": "Linux",
          "programFiles": [
            "security/selinux/hooks.c",
            "security/smack/smack_lsm.c"
          ],
          "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
          "vendor": "Linux",
          "versions": [
            {
              "lessThan": "2dbc4b7bac60b02cc6e70d05bf6a7dfd551f9dda",
              "status": "affected",
              "version": "18032ca062e621e15683cb61c066ef3dc5414a7b",
              "versionType": "git"
            },
            {
              "lessThan": "fe0cd53791119f6287b6532af8ce41576d664930",
              "status": "affected",
              "version": "18032ca062e621e15683cb61c066ef3dc5414a7b",
              "versionType": "git"
            },
            {
              "lessThan": "eebec98791d0137e455cc006411bb92a54250924",
              "status": "affected",
              "version": "18032ca062e621e15683cb61c066ef3dc5414a7b",
              "versionType": "git"
            },
            {
              "lessThan": "459584258d47ec3cc6245a82e8a49c9d08eb8b57",
              "status": "affected",
              "version": "18032ca062e621e15683cb61c066ef3dc5414a7b",
              "versionType": "git"
            },
            {
              "lessThan": "f71ec019257ba4f7ab198bd948c5902a207bad96",
              "status": "affected",
              "version": "18032ca062e621e15683cb61c066ef3dc5414a7b",
              "versionType": "git"
            },
            {
              "lessThan": "76a0e79bc84f466999fa501fce5bf7a07641b8a7",
              "status": "affected",
              "version": "18032ca062e621e15683cb61c066ef3dc5414a7b",
              "versionType": "git"
            }
          ]
        },
        {
          "defaultStatus": "affected",
          "product": "Linux",
          "programFiles": [
            "security/selinux/hooks.c",
            "security/smack/smack_lsm.c"
          ],
          "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
          "vendor": "Linux",
          "versions": [
            {
              "status": "affected",
              "version": "3.11"
            },
            {
              "lessThan": "3.11",
              "status": "unaffected",
              "version": "0",
              "versionType": "semver"
            },
            {
              "lessThanOrEqual": "5.10.*",
              "status": "unaffected",
              "version": "5.10.227",
              "versionType": "semver"
            },
            {
              "lessThanOrEqual": "5.15.*",
              "status": "unaffected",
              "version": "5.15.168",
              "versionType": "semver"
            },
            {
              "lessThanOrEqual": "6.1.*",
              "status": "unaffected",
              "version": "6.1.113",
              "versionType": "semver"
            },
            {
              "lessThanOrEqual": "6.6.*",
              "status": "unaffected",
              "version": "6.6.49",
              "versionType": "semver"
            },
            {
              "lessThanOrEqual": "6.10.*",
              "status": "unaffected",
              "version": "6.10.8",
              "versionType": "semver"
            },
            {
              "lessThanOrEqual": "*",
              "status": "unaffected",
              "version": "6.11",
              "versionType": "original_commit_for_fix"
            }
          ]
        }
      ],
      "cpeApplicability": [
        {
          "nodes": [
            {
              "cpeMatch": [
                {
                  "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                  "versionEndExcluding": "5.10.227",
                  "versionStartIncluding": "3.11",
                  "vulnerable": true
                },
                {
                  "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                  "versionEndExcluding": "5.15.168",
                  "versionStartIncluding": "3.11",
                  "vulnerable": true
                },
                {
                  "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                  "versionEndExcluding": "6.1.113",
                  "versionStartIncluding": "3.11",
                  "vulnerable": true
                },
                {
                  "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                  "versionEndExcluding": "6.6.49",
                  "versionStartIncluding": "3.11",
                  "vulnerable": true
                },
                {
                  "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                  "versionEndExcluding": "6.10.8",
                  "versionStartIncluding": "3.11",
                  "vulnerable": true
                },
                {
                  "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                  "versionEndExcluding": "6.11",
                  "versionStartIncluding": "3.11",
                  "vulnerable": true
                }
              ],
              "negate": false,
              "operator": "OR"
            }
          ]
        }
      ],
      "descriptions": [
        {
          "lang": "en",
          "value": "In the Linux kernel, the following vulnerability has been resolved:\n\nselinux,smack: don\u0027t bypass permissions check in inode_setsecctx hook\n\nMarek Gresko reports that the root user on an NFS client is able to\nchange the security labels on files on an NFS filesystem that is\nexported with root squashing enabled.\n\nThe end of the kerneldoc comment for __vfs_setxattr_noperm() states:\n\n *  This function requires the caller to lock the inode\u0027s i_mutex before it\n *  is executed. It also assumes that the caller will make the appropriate\n *  permission checks.\n\nnfsd_setattr() does do permissions checking via fh_verify() and\nnfsd_permission(), but those don\u0027t do all the same permissions checks\nthat are done by security_inode_setxattr() and its related LSM hooks do.\n\nSince nfsd_setattr() is the only consumer of security_inode_setsecctx(),\nsimplest solution appears to be to replace the call to\n__vfs_setxattr_noperm() with a call to __vfs_setxattr_locked().  This\nfixes the above issue and has the added benefit of causing nfsd to\nrecall conflicting delegations on a file when a client tries to change\nits security label."
        }
      ],
      "metrics": [
        {
          "cvssV3_1": {
            "baseScore": 9.8,
            "baseSeverity": "CRITICAL",
            "vectorString": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H",
            "version": "3.1"
          },
          "scenarios": [
            {
              "lang": "en",
              "value": "AV:N - The vulnerable code is reached only through the in-kernel NFS server, via an NFSv4.2 SETATTR/OPEN compound carrying the FATTR4_WORD2_SECURITY_LABEL attribute over TCP/2049. Per kernel CNA guidance nfsd bugs are Network.\nAC:L - A single, fully attacker-controlled SETATTR RPC deterministically writes the label; there is no race, no memory-layout dependency, and no retry needed. The only precondition is the standard labeled-NFS deployment (CONFIG_NFSD_V4_SECURITY_LABEL plus the `security_label` export option), which is the configuration being scored.\nPR:N - The essence of the bug is that all permission checks are skipped: nfsd_permission() is invoked with an effective mask of 0 and the LSM relabel/CAP_MAC_ADMIN/ownership checks never run, so any asserted AUTH_SYS uid works \u2014 including the squashed anonymous uid. The attacker needs no account or credential on the server; export IP filtering and the reserved-port `secure` check are network-level controls, not privileges on the vulnerable component.\nUI:N - The attacker issues the RPC directly against the server; no administrator or user on the server has to open a file, mount anything, or take any action.\nS:U - The bypassed checks and the corrupted security labels are both enforced and consumed by the same kernel/LSM security authority on the NFS server; no hypervisor, IOMMU, or sandbox boundary is crossed.\nC:H - Arbitrary relabeling defeats the MAC confidentiality controls that are the primary protection on such systems \u2014 an MLS-labeled file can be dropped to a lower level, or a protected file relabeled to a type readable by an untrusted or attacker-influenced domain, and the httpd_sys_script_exec_t-style relabel yields code execution on the server with arbitrary read.\nI:H - An unauthenticated client can write arbitrary SELinux contexts or Smack labels onto any file in the export, bypassing inode_owner_or_capable(), FILE__RELABELFROM/RELABELTO policy, CAP_MAC_ADMIN, immutable/append-only flags, and root squashing \u2014 a complete compromise of security-critical metadata that can be escalated to code execution on the server.\nA:H - Relabeling files to a type or invalid context that legitimate confined domains cannot access denies those services their data and breaks them, and the same primitive escalates to code execution allowing the server to be rendered inoperable."
            }
          ]
        }
      ],
      "providerMetadata": {
        "dateUpdated": "2026-08-05T11:37:59.963Z",
        "orgId": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
        "shortName": "Linux"
      },
      "references": [
        {
          "url": "https://git.kernel.org/stable/c/2dbc4b7bac60b02cc6e70d05bf6a7dfd551f9dda"
        },
        {
          "url": "https://git.kernel.org/stable/c/fe0cd53791119f6287b6532af8ce41576d664930"
        },
        {
          "url": "https://git.kernel.org/stable/c/eebec98791d0137e455cc006411bb92a54250924"
        },
        {
          "url": "https://git.kernel.org/stable/c/459584258d47ec3cc6245a82e8a49c9d08eb8b57"
        },
        {
          "url": "https://git.kernel.org/stable/c/f71ec019257ba4f7ab198bd948c5902a207bad96"
        },
        {
          "url": "https://git.kernel.org/stable/c/76a0e79bc84f466999fa501fce5bf7a07641b8a7"
        }
      ],
      "title": "selinux,smack: don\u0027t bypass permissions check in inode_setsecctx hook",
      "x_generator": {
        "engine": "bippy-1.2.0"
      }
    }
  },
  "cveMetadata": {
    "assignerOrgId": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
    "assignerShortName": "Linux",
    "cveId": "CVE-2024-46695",
    "datePublished": "2024-09-13T05:29:23.506Z",
    "dateReserved": "2024-09-11T15:12:18.249Z",
    "dateUpdated": "2026-08-05T11:37:59.963Z",
    "state": "PUBLISHED"
  },
  "dataType": "CVE_RECORD",
  "dataVersion": "5.2",
  "vulnerability-lookup:meta": {
    "vulnrichment": {
      "containers": "{\"adp\": [{\"title\": \"CISA ADP Vulnrichment\", \"metrics\": [{\"other\": {\"type\": \"ssvc\", \"content\": {\"id\": \"CVE-2024-46695\", \"role\": \"CISA Coordinator\", \"options\": [{\"Exploitation\": \"none\"}, {\"Automatable\": \"no\"}, {\"Technical Impact\": \"partial\"}], \"version\": \"2.0.3\", \"timestamp\": \"2024-09-29T15:05:47.775114Z\"}}}], \"providerMetadata\": {\"orgId\": \"134c704f-9b21-4f2e-91b3-4a467353bcc0\", \"shortName\": \"CISA-ADP\", \"dateUpdated\": \"2024-09-29T15:05:51.859Z\"}}], \"cna\": {\"title\": \"selinux,smack: don\u0027t bypass permissions check in inode_setsecctx hook\", \"affected\": [{\"repo\": \"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git\", \"vendor\": \"Linux\", \"product\": \"Linux\", \"versions\": [{\"status\": \"affected\", \"version\": \"18032ca062e621e15683cb61c066ef3dc5414a7b\", \"lessThan\": \"2dbc4b7bac60b02cc6e70d05bf6a7dfd551f9dda\", \"versionType\": \"git\"}, {\"status\": \"affected\", \"version\": \"18032ca062e621e15683cb61c066ef3dc5414a7b\", \"lessThan\": \"fe0cd53791119f6287b6532af8ce41576d664930\", \"versionType\": \"git\"}, {\"status\": \"affected\", \"version\": \"18032ca062e621e15683cb61c066ef3dc5414a7b\", \"lessThan\": \"eebec98791d0137e455cc006411bb92a54250924\", \"versionType\": \"git\"}, {\"status\": \"affected\", \"version\": \"18032ca062e621e15683cb61c066ef3dc5414a7b\", \"lessThan\": \"459584258d47ec3cc6245a82e8a49c9d08eb8b57\", \"versionType\": \"git\"}, {\"status\": \"affected\", \"version\": \"18032ca062e621e15683cb61c066ef3dc5414a7b\", \"lessThan\": \"f71ec019257ba4f7ab198bd948c5902a207bad96\", \"versionType\": \"git\"}, {\"status\": \"affected\", \"version\": \"18032ca062e621e15683cb61c066ef3dc5414a7b\", \"lessThan\": \"76a0e79bc84f466999fa501fce5bf7a07641b8a7\", \"versionType\": \"git\"}], \"programFiles\": [\"security/selinux/hooks.c\", \"security/smack/smack_lsm.c\"], \"defaultStatus\": \"unaffected\"}, {\"repo\": \"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git\", \"vendor\": \"Linux\", \"product\": \"Linux\", \"versions\": [{\"status\": \"affected\", \"version\": \"3.11\"}, {\"status\": \"unaffected\", \"version\": \"0\", \"lessThan\": \"3.11\", \"versionType\": \"semver\"}, {\"status\": \"unaffected\", \"version\": \"5.10.227\", \"versionType\": \"semver\", \"lessThanOrEqual\": \"5.10.*\"}, {\"status\": \"unaffected\", \"version\": \"5.15.168\", \"versionType\": \"semver\", \"lessThanOrEqual\": \"5.15.*\"}, {\"status\": \"unaffected\", \"version\": \"6.1.113\", \"versionType\": \"semver\", \"lessThanOrEqual\": \"6.1.*\"}, {\"status\": \"unaffected\", \"version\": \"6.6.49\", \"versionType\": \"semver\", \"lessThanOrEqual\": \"6.6.*\"}, {\"status\": \"unaffected\", \"version\": \"6.10.8\", \"versionType\": \"semver\", \"lessThanOrEqual\": \"6.10.*\"}, {\"status\": \"unaffected\", \"version\": \"6.11\", \"versionType\": \"original_commit_for_fix\", \"lessThanOrEqual\": \"*\"}], \"programFiles\": [\"security/selinux/hooks.c\", \"security/smack/smack_lsm.c\"], \"defaultStatus\": \"affected\"}], \"references\": [{\"url\": \"https://git.kernel.org/stable/c/2dbc4b7bac60b02cc6e70d05bf6a7dfd551f9dda\"}, {\"url\": \"https://git.kernel.org/stable/c/fe0cd53791119f6287b6532af8ce41576d664930\"}, {\"url\": \"https://git.kernel.org/stable/c/eebec98791d0137e455cc006411bb92a54250924\"}, {\"url\": \"https://git.kernel.org/stable/c/459584258d47ec3cc6245a82e8a49c9d08eb8b57\"}, {\"url\": \"https://git.kernel.org/stable/c/f71ec019257ba4f7ab198bd948c5902a207bad96\"}, {\"url\": \"https://git.kernel.org/stable/c/76a0e79bc84f466999fa501fce5bf7a07641b8a7\"}], \"x_generator\": {\"engine\": \"bippy-1.2.0\"}, \"descriptions\": [{\"lang\": \"en\", \"value\": \"In the Linux kernel, the following vulnerability has been resolved:\\n\\nselinux,smack: don\u0027t bypass permissions check in inode_setsecctx hook\\n\\nMarek Gresko reports that the root user on an NFS client is able to\\nchange the security labels on files on an NFS filesystem that is\\nexported with root squashing enabled.\\n\\nThe end of the kerneldoc comment for __vfs_setxattr_noperm() states:\\n\\n *  This function requires the caller to lock the inode\u0027s i_mutex before it\\n *  is executed. It also assumes that the caller will make the appropriate\\n *  permission checks.\\n\\nnfsd_setattr() does do permissions checking via fh_verify() and\\nnfsd_permission(), but those don\u0027t do all the same permissions checks\\nthat are done by security_inode_setxattr() and its related LSM hooks do.\\n\\nSince nfsd_setattr() is the only consumer of security_inode_setsecctx(),\\nsimplest solution appears to be to replace the call to\\n__vfs_setxattr_noperm() with a call to __vfs_setxattr_locked().  This\\nfixes the above issue and has the added benefit of causing nfsd to\\nrecall conflicting delegations on a file when a client tries to change\\nits security label.\"}], \"cpeApplicability\": [{\"nodes\": [{\"negate\": false, \"cpeMatch\": [{\"criteria\": \"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*\", \"vulnerable\": true, \"versionEndExcluding\": \"5.10.227\", \"versionStartIncluding\": \"3.11\"}, {\"criteria\": \"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*\", \"vulnerable\": true, \"versionEndExcluding\": \"5.15.168\", \"versionStartIncluding\": \"3.11\"}, {\"criteria\": \"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*\", \"vulnerable\": true, \"versionEndExcluding\": \"6.1.113\", \"versionStartIncluding\": \"3.11\"}, {\"criteria\": \"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*\", \"vulnerable\": true, \"versionEndExcluding\": \"6.6.49\", \"versionStartIncluding\": \"3.11\"}, {\"criteria\": \"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*\", \"vulnerable\": true, \"versionEndExcluding\": \"6.10.8\", \"versionStartIncluding\": \"3.11\"}, {\"criteria\": \"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*\", \"vulnerable\": true, \"versionEndExcluding\": \"6.11\", \"versionStartIncluding\": \"3.11\"}], \"operator\": \"OR\"}]}], \"providerMetadata\": {\"orgId\": \"416baaa9-dc9f-4396-8d5f-8c081fb06d67\", \"shortName\": \"Linux\", \"dateUpdated\": \"2025-06-19T12:56:39.963Z\"}}}",
      "cveMetadata": "{\"cveId\": \"CVE-2024-46695\", \"state\": \"PUBLISHED\", \"dateUpdated\": \"2025-06-19T12:56:39.963Z\", \"dateReserved\": \"2024-09-11T15:12:18.249Z\", \"assignerOrgId\": \"416baaa9-dc9f-4396-8d5f-8c081fb06d67\", \"datePublished\": \"2024-09-13T05:29:23.506Z\", \"assignerShortName\": \"Linux\"}",
      "dataType": "CVE_RECORD",
      "dataVersion": "5.1"
    }
  }
}


Log in or create an account to share your comment.




Tags
Taxonomy of the tags.


Loading…

Loading…

Loading…

Sightings

Author Source Type Date

Nomenclature

  • Seen: The vulnerability was mentioned, discussed, or seen somewhere by the user.
  • Confirmed: The vulnerability is confirmed from an analyst perspective.
  • Published Proof of Concept: A public proof of concept is available for this vulnerability.
  • Exploited: This vulnerability was exploited and seen by the user reporting the sighting.
  • Patched: This vulnerability was successfully patched by the user reporting the sighting.
  • Not exploited: This vulnerability was not exploited or seen by the user reporting the sighting.
  • Not confirmed: The user expresses doubt about the veracity of the vulnerability.
  • Not patched: This vulnerability was not successfully patched by the user reporting the sighting.


Loading…

Loading…