{
  "schema_version": "1.6.1",
  "id": "RPI-CVE-2024-42318",
  "modified": "2026-10-09T11:39:44Z",
  "upstream": [
    "CVE-2024-42318"
  ],
  "published": "2024-08-17T09:11:20Z",
  "summary": "landlock: Don't lose track of restrictions on cred_transfer",
  "details": "In the Linux kernel, the following vulnerability has been resolved:\n\nlandlock: Don't lose track of restrictions on cred_transfer\n\nWhen a process' cred struct is replaced, this _almost_ always invokes\nthe cred_prepare LSM hook; but in one special case (when\nKEYCTL_SESSION_TO_PARENT updates the parent's credentials), the\ncred_transfer LSM hook is used instead.  Landlock only implements the\ncred_prepare hook, not cred_transfer, so KEYCTL_SESSION_TO_PARENT causes\nall information on Landlock restrictions to be lost.\n\nThis basically means that a process with the ability to use the fork()\nand keyctl() syscalls can get rid of all Landlock restrictions on\nitself.\n\nFix it by adding a cred_transfer hook that does the same thing as the\nexisting cred_prepare hook. (Implemented by having hook_cred_prepare()\ncall hook_cred_transfer() so that the two functions are less likely to\naccidentally diverge in the future.)",
  "severity": [
    {
      "type": "CVSS_V3",
      "score": "CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:H"
    }
  ],
  "affected": [
    {
      "package": {
        "ecosystem": "Raspberry Pi OS:12",
        "name": "linux"
      },
      "versions": [
        "1:6.1.47-1+rpt4"
      ],
      "ecosystem_specific": {
        "binaries": [
          {
            "binary_name": "linux-image-6.1.0-rpi3-rpi-2712",
            "binary_version": "1:6.1.47-1+rpt4"
          },
          {
            "binary_name": "linux-image-6.1.0-rpi3-rpi-v6",
            "binary_version": "1:6.1.47-1+rpt4"
          },
          {
            "binary_name": "linux-image-6.1.0-rpi3-rpi-v7",
            "binary_version": "1:6.1.47-1+rpt4"
          },
          {
            "binary_name": "linux-image-6.1.0-rpi3-rpi-v7l",
            "binary_version": "1:6.1.47-1+rpt4"
          },
          {
            "binary_name": "linux-image-6.1.0-rpi3-rpi-v8",
            "binary_version": "1:6.1.47-1+rpt4"
          }
        ]
      },
      "database_specific": {
        "per_version": {
          "1:6.1.47-1+rpt4": {
            "linux_commit": "655fc658a15ae7a6f37103754adb39ba52a9a14e",
            "upstream_version": "6.1.47",
            "assessment": "commit ancestry (strak rule)",
            "upstream_fixed": "6.1.103",
            "compiled_filter": false
          }
        }
      }
    }
  ],
  "references": [
    {
      "type": "ADVISORY",
      "url": "https://www.cve.org/CVERecord?id=CVE-2024-42318"
    },
    {
      "type": "FIX",
      "url": "https://git.kernel.org/stable/c/916c648323fa53b89eedb34a0988ddaf01406117"
    },
    {
      "type": "FIX",
      "url": "https://git.kernel.org/stable/c/0d74fd54db0bd0c0c224bef0da8fc95ea9c9f36c"
    },
    {
      "type": "FIX",
      "url": "https://git.kernel.org/stable/c/16896914bace82d7811c62f3b6d5320132384f49"
    },
    {
      "type": "FIX",
      "url": "https://git.kernel.org/stable/c/b14cc2cf313bd29056fadbc8ecd7f957cf5791ff"
    },
    {
      "type": "FIX",
      "url": "https://git.kernel.org/stable/c/39705a6c29f8a2b93cf5b99528a55366c50014d1"
    }
  ],
  "database_specific": {
    "source": "https://git.kernel.org/pub/scm/linux/security/vulns.git",
    "upstream_modified": "2026-08-05T11:52:36Z",
    "severity": {
      "source": "kernel CNA",
      "cvss_v3_score": 8.8,
      "cvss_v3_severity": "High",
      "scenario": "AV:L - Exploitation requires executing local syscalls (`fork()` plus `keyctl(KEYCTL_JOIN_SESSION_KEYRING)` / `keyctl(KEYCTL_SESSION_TO_PARENT)`) on the target system; there is no remote or adjacent-network entry point into the credential-transfer path.\nAC:L - The attacker controls every precondition \u2014 the parent/child relationship, single-threadedness, matching uid/gid, and the distinct session keyrings \u2014 and the upstream selftest demonstrates the escape is 100% deterministic with no race, memory-layout, or timing dependency.\nPR:L - Only the ability to run code as an ordinary local user is needed; Landlock sandboxing and `keyctl()` are entirely unprivileged (the selftest explicitly calls `drop_caps()` before reproducing the escape), and in fact the attacker starts from a *less*-than-normal privilege level inside the sandbox.\nUI:N - The \"victim\" whose credentials are rewritten is the attacker's own parent process, driven entirely by the attacker's task_work; no action by any other user is required.\nS:C - This is a sandbox escape \u2014 the confined process breaks out of the Landlock domain imposed by a separate security authority (the sandboxing supervisor/policy), gaining access to filesystem and network resources managed outside the vulnerable component's security scope.\nC:H - All Landlock restrictions are dropped at once, so the escaped process can read every file and directory the policy was specifically deployed to hide from it, a total loss of the confidentiality guarantee of the impacted component.\nI:H - The escape restores unrestricted write, create, rename, link and (ABI 3+) truncate access plus network bind/connect, letting the process arbitrarily modify data the sandbox policy protected.\nA:H - With every restriction removed the process can delete and truncate files the Landlock policy existed to protect, destroying the availability of the sandboxed resources; the protection is permanently and completely lost for the lifetime of the process and all its descendants."
    }
  }
}
