GCVE Workshop - 22 September 2026 (14:00-18:00), Luxembourg Before The Vulnopticon Conference - Registration

CVE-2024-47794 (GCVE-0-2024-47794)

Vulnerability from cvelistv5 – Published: 2025-01-11 12:25 – Updated: 2026-08-05 11:39
VLAI
Title
bpf: Prevent tailcall infinite loop caused by freplace
Summary
In the Linux kernel, the following vulnerability has been resolved: bpf: Prevent tailcall infinite loop caused by freplace There is a potential infinite loop issue that can occur when using a combination of tail calls and freplace. In an upcoming selftest, the attach target for entry_freplace of tailcall_freplace.c is subprog_tc of tc_bpf2bpf.c, while the tail call in entry_freplace leads to entry_tc. This results in an infinite loop: entry_tc -> subprog_tc -> entry_freplace --tailcall-> entry_tc. The problem arises because the tail_call_cnt in entry_freplace resets to zero each time entry_freplace is executed, causing the tail call mechanism to never terminate, eventually leading to a kernel panic. To fix this issue, the solution is twofold: 1. Prevent updating a program extended by an freplace program to a prog_array map. 2. Prevent extending a program that is already part of a prog_array map with an freplace program. This ensures that: * If a program or its subprogram has been extended by an freplace program, it can no longer be updated to a prog_array map. * If a program has been added to a prog_array map, neither it nor its subprograms can be extended by an freplace program. Moreover, an extension program should not be tailcalled. As such, return -EINVAL if the program has a type of BPF_PROG_TYPE_EXT when adding it to a prog_array map. Additionally, fix a minor code style issue by replacing eight spaces with a tab for proper formatting.
Impacted products
Vendor Product Version CPE status
Linux Linux Affected: be8704ff07d2374bcc5c675526f95e70c6459683 , < 987aa730bad3e1ef66d9f30182294daa78f6387d (git)
Affected: be8704ff07d2374bcc5c675526f95e70c6459683 , < d6083f040d5d8f8d748462c77e90547097df936e (git)
guessed Create a notification for this product.
Linux Linux Affected: 5.6
Unaffected: 0 , < 5.6 (semver)
Unaffected: 6.12.5 , ≤ 6.12.* (semver)
Unaffected: 6.13 , ≤ * (original_commit_for_fix)
guessed Create a notification for this product.
Show details on NVD website

{
  "containers": {
    "cna": {
      "affected": [
        {
          "defaultStatus": "unaffected",
          "product": "Linux",
          "programFiles": [
            "include/linux/bpf.h",
            "kernel/bpf/arraymap.c",
            "kernel/bpf/core.c",
            "kernel/bpf/syscall.c",
            "kernel/bpf/trampoline.c"
          ],
          "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
          "vendor": "Linux",
          "versions": [
            {
              "lessThan": "987aa730bad3e1ef66d9f30182294daa78f6387d",
              "status": "affected",
              "version": "be8704ff07d2374bcc5c675526f95e70c6459683",
              "versionType": "git"
            },
            {
              "lessThan": "d6083f040d5d8f8d748462c77e90547097df936e",
              "status": "affected",
              "version": "be8704ff07d2374bcc5c675526f95e70c6459683",
              "versionType": "git"
            }
          ]
        },
        {
          "defaultStatus": "affected",
          "product": "Linux",
          "programFiles": [
            "include/linux/bpf.h",
            "kernel/bpf/arraymap.c",
            "kernel/bpf/core.c",
            "kernel/bpf/syscall.c",
            "kernel/bpf/trampoline.c"
          ],
          "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
          "vendor": "Linux",
          "versions": [
            {
              "status": "affected",
              "version": "5.6"
            },
            {
              "lessThan": "5.6",
              "status": "unaffected",
              "version": "0",
              "versionType": "semver"
            },
            {
              "lessThanOrEqual": "6.12.*",
              "status": "unaffected",
              "version": "6.12.5",
              "versionType": "semver"
            },
            {
              "lessThanOrEqual": "*",
              "status": "unaffected",
              "version": "6.13",
              "versionType": "original_commit_for_fix"
            }
          ]
        }
      ],
      "cpeApplicability": [
        {
          "nodes": [
            {
              "cpeMatch": [
                {
                  "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                  "versionEndExcluding": "6.12.5",
                  "versionStartIncluding": "5.6",
                  "vulnerable": true
                },
                {
                  "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                  "versionEndExcluding": "6.13",
                  "versionStartIncluding": "5.6",
                  "vulnerable": true
                }
              ],
              "negate": false,
              "operator": "OR"
            }
          ]
        }
      ],
      "descriptions": [
        {
          "lang": "en",
          "value": "In the Linux kernel, the following vulnerability has been resolved:\n\nbpf: Prevent tailcall infinite loop caused by freplace\n\nThere is a potential infinite loop issue that can occur when using a\ncombination of tail calls and freplace.\n\nIn an upcoming selftest, the attach target for entry_freplace of\ntailcall_freplace.c is subprog_tc of tc_bpf2bpf.c, while the tail call in\nentry_freplace leads to entry_tc. This results in an infinite loop:\n\nentry_tc -\u003e subprog_tc -\u003e entry_freplace --tailcall-\u003e entry_tc.\n\nThe problem arises because the tail_call_cnt in entry_freplace resets to\nzero each time entry_freplace is executed, causing the tail call mechanism\nto never terminate, eventually leading to a kernel panic.\n\nTo fix this issue, the solution is twofold:\n\n1. Prevent updating a program extended by an freplace program to a\n   prog_array map.\n2. Prevent extending a program that is already part of a prog_array map\n   with an freplace program.\n\nThis ensures that:\n\n* If a program or its subprogram has been extended by an freplace program,\n  it can no longer be updated to a prog_array map.\n* If a program has been added to a prog_array map, neither it nor its\n  subprograms can be extended by an freplace program.\n\nMoreover, an extension program should not be tailcalled. As such, return\n-EINVAL if the program has a type of BPF_PROG_TYPE_EXT when adding it to a\nprog_array map.\n\nAdditionally, fix a minor code style issue by replacing eight spaces with a\ntab for proper formatting."
        }
      ],
      "metrics": [
        {
          "cvssV3_1": {
            "baseScore": 7.8,
            "baseSeverity": "HIGH",
            "vectorString": "CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H",
            "version": "3.1"
          },
          "scenarios": [
            {
              "lang": "en",
              "value": "AV:L - The entire attack is built and triggered through the local `bpf(2)` syscall \u2014 two `BPF_PROG_LOAD` calls, a `BPF_LINK_CREATE` freplace attach, a `PROG_ARRAY` map update, and `BPF_PROG_TEST_RUN`. No network peer or remote input is involved, and no netdev attachment is required.\nAC:L - The attacker constructs every component of the loop (target prog, its bpf2bpf subprog, the freplace extension, and the prog_array entry) and fires it deterministically; there is no race, no memory-layout dependency, and no state outside the attacker\u0027s control. Every invocation reproduces the runaway tail-call chain.\nPR:L - Loading `BPF_PROG_TYPE_EXT` goes through `bpf_token_capable()` for CAP_BPF/CAP_NET_ADMIN/CAP_PERFMON, which grants only `ns_capable()`-level checks when a BPF token is delegated to a user namespace via bpffs `delegate_cmds`/`delegate_progs` \u2014 so a low-privileged container process with a delegated token can reach it, and no real init-namespace root is strictly needed.\nUI:N - The attacker loads, attaches, and executes the programs entirely on its own via `BPF_PROG_TEST_RUN` or by attaching the classifier and sending itself a packet. No victim action of any kind is required.\nS:U - The corruption and the crash both occur in the kernel\u0027s own stack within the same security authority; there is no VM, IOMMU, or sandbox boundary crossed.\nC:H - The unbounded recursion is an out-of-bounds write past the kernel stack limit with attacker-chosen BPF stack contents; on builds without CONFIG_VMAP_STACK (e.g. KASAN_GENERIC configs, where `arch/Kconfig` disables it) the overflow spills into adjacent kernel memory, yielding a corruption primitive usable for disclosing kernel data.\nI:H - Same stack overflow gives an unbounded, attacker-controlled out-of-bounds write past the stack guard limit, which on non-VMAP_STACK configurations overwrites adjacent kernel structures and is leverageable for control-flow hijack; per guidance any OOB write scores High.\nA:H - The commit states the tail-call mechanism \"never terminate[s], eventually leading to a kernel panic\" \u2014 the stack grows every cycle until it hits the guard page, producing an immediate double-fault panic (or silent corruption) within microseconds, and it can be re-triggered on every packet if the classifier is attached to a live interface."
            }
          ]
        }
      ],
      "providerMetadata": {
        "dateUpdated": "2026-08-05T11:39:59.232Z",
        "orgId": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
        "shortName": "Linux"
      },
      "references": [
        {
          "url": "https://git.kernel.org/stable/c/987aa730bad3e1ef66d9f30182294daa78f6387d"
        },
        {
          "url": "https://git.kernel.org/stable/c/d6083f040d5d8f8d748462c77e90547097df936e"
        }
      ],
      "title": "bpf: Prevent tailcall infinite loop caused by freplace",
      "x_generator": {
        "engine": "bippy-1.2.0"
      }
    }
  },
  "cveMetadata": {
    "assignerOrgId": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
    "assignerShortName": "Linux",
    "cveId": "CVE-2024-47794",
    "datePublished": "2025-01-11T12:25:14.419Z",
    "dateReserved": "2025-01-09T09:49:29.737Z",
    "dateUpdated": "2026-08-05T11:39:59.232Z",
    "state": "PUBLISHED"
  },
  "dataType": "CVE_RECORD",
  "dataVersion": "5.2",
  "vulnerability-lookup:meta": {
    "epss": {
      "cve": "CVE-2024-47794",
      "date": "2026-09-16",
      "epss": "0.00204",
      "percentile": "0.10609"
    },
    "fkie_nvd": {
      "descriptions": "[{\"lang\": \"en\", \"value\": \"In the Linux kernel, the following vulnerability has been resolved:\\n\\nbpf: Prevent tailcall infinite loop caused by freplace\\n\\nThere is a potential infinite loop issue that can occur when using a\\ncombination of tail calls and freplace.\\n\\nIn an upcoming selftest, the attach target for entry_freplace of\\ntailcall_freplace.c is subprog_tc of tc_bpf2bpf.c, while the tail call in\\nentry_freplace leads to entry_tc. This results in an infinite loop:\\n\\nentry_tc -\u003e subprog_tc -\u003e entry_freplace --tailcall-\u003e entry_tc.\\n\\nThe problem arises because the tail_call_cnt in entry_freplace resets to\\nzero each time entry_freplace is executed, causing the tail call mechanism\\nto never terminate, eventually leading to a kernel panic.\\n\\nTo fix this issue, the solution is twofold:\\n\\n1. Prevent updating a program extended by an freplace program to a\\n   prog_array map.\\n2. Prevent extending a program that is already part of a prog_array map\\n   with an freplace program.\\n\\nThis ensures that:\\n\\n* If a program or its subprogram has been extended by an freplace program,\\n  it can no longer be updated to a prog_array map.\\n* If a program has been added to a prog_array map, neither it nor its\\n  subprograms can be extended by an freplace program.\\n\\nMoreover, an extension program should not be tailcalled. As such, return\\n-EINVAL if the program has a type of BPF_PROG_TYPE_EXT when adding it to a\\nprog_array map.\\n\\nAdditionally, fix a minor code style issue by replacing eight spaces with a\\ntab for proper formatting.\"}]",
      "id": "CVE-2024-47794",
      "lastModified": "2025-01-11T13:15:22.390",
      "published": "2025-01-11T13:15:22.390",
      "references": "[{\"url\": \"https://git.kernel.org/stable/c/987aa730bad3e1ef66d9f30182294daa78f6387d\", \"source\": \"416baaa9-dc9f-4396-8d5f-8c081fb06d67\"}, {\"url\": \"https://git.kernel.org/stable/c/d6083f040d5d8f8d748462c77e90547097df936e\", \"source\": \"416baaa9-dc9f-4396-8d5f-8c081fb06d67\"}]",
      "sourceIdentifier": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
      "vulnStatus": "Received"
    },
    "microsoft_vex": {
      "current_release_date": "2026-06-28T01:55:52.000Z",
      "cve": "CVE-2024-47794",
      "id": "msrc_CVE-2024-47794",
      "initial_release_date": "2025-01-02T00:00:00.000Z",
      "product_status:known_affected": "3",
      "product_status:under_investigation": "16",
      "source": "Microsoft CSAF VEX",
      "status": "final",
      "title": "bpf: Prevent tailcall infinite loop caused by freplace",
      "url": "https://msrc.microsoft.com/csaf/vex/2025/msrc_cve-2024-47794.json",
      "version": "14"
    },
    "nvd": "{\"cve\":{\"id\":\"CVE-2024-47794\",\"sourceIdentifier\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\",\"published\":\"2025-01-11T13:15:22.390\",\"lastModified\":\"2026-08-04T11:20:49.140\",\"vulnStatus\":\"Modified\",\"cveTags\":[],\"descriptions\":[{\"lang\":\"en\",\"value\":\"In the Linux kernel, the following vulnerability has been resolved:\\n\\nbpf: Prevent tailcall infinite loop caused by freplace\\n\\nThere is a potential infinite loop issue that can occur when using a\\ncombination of tail calls and freplace.\\n\\nIn an upcoming selftest, the attach target for entry_freplace of\\ntailcall_freplace.c is subprog_tc of tc_bpf2bpf.c, while the tail call in\\nentry_freplace leads to entry_tc. This results in an infinite loop:\\n\\nentry_tc -\u003e subprog_tc -\u003e entry_freplace --tailcall-\u003e entry_tc.\\n\\nThe problem arises because the tail_call_cnt in entry_freplace resets to\\nzero each time entry_freplace is executed, causing the tail call mechanism\\nto never terminate, eventually leading to a kernel panic.\\n\\nTo fix this issue, the solution is twofold:\\n\\n1. Prevent updating a program extended by an freplace program to a\\n   prog_array map.\\n2. Prevent extending a program that is already part of a prog_array map\\n   with an freplace program.\\n\\nThis ensures that:\\n\\n* If a program or its subprogram has been extended by an freplace program,\\n  it can no longer be updated to a prog_array map.\\n* If a program has been added to a prog_array map, neither it nor its\\n  subprograms can be extended by an freplace program.\\n\\nMoreover, an extension program should not be tailcalled. As such, return\\n-EINVAL if the program has a type of BPF_PROG_TYPE_EXT when adding it to a\\nprog_array map.\\n\\nAdditionally, fix a minor code style issue by replacing eight spaces with a\\ntab for proper formatting.\"},{\"lang\":\"es\",\"value\":\"En el kernel de Linux, se ha resuelto la siguiente vulnerabilidad: bpf: Evitar bucle infinito de tailcall causado por freplace Existe un posible problema de bucle infinito que puede ocurrir al usar una combinaci\u00f3n de llamadas de cola y freplace. En una pr\u00f3xima autoprueba, el objetivo de conexi\u00f3n para entry_freplace de tailcall_freplace.c es subprog_tc de tc_bpf2bpf.c, mientras que la llamada de cola en entry_freplace conduce a entry_tc. Esto da como resultado un bucle infinito: entry_tc -\u0026gt; subprog_tc -\u0026gt; entry_freplace --tailcall-\u0026gt; entry_tc. El problema surge porque tail_call_cnt en entry_freplace se restablece a cero cada vez que se ejecuta entry_freplace, lo que hace que el mecanismo de llamada de cola nunca finalice, lo que finalmente conduce a un p\u00e1nico del kernel. Para solucionar este problema, la soluci\u00f3n es doble: 1. Evitar actualizar un programa extendido por un programa freplace a un mapa prog_array. 2. Evite extender un programa que ya es parte de un mapa prog_array con un programa freplace. Esto garantiza que: * Si un programa o su subprograma ha sido extendido por un programa freplace, ya no puede actualizarse a un mapa prog_array. * Si un programa ha sido agregado a un mapa prog_array, ni \u00e9l ni sus subprogramas pueden ser extendidos por un programa freplace. Adem\u00e1s, un programa de extensi\u00f3n no debe ser llamado al final. Como tal, devuelva -EINVAL si el programa tiene un tipo de BPF_PROG_TYPE_EXT al agregarlo a un mapa prog_array. Adem\u00e1s, solucione un problema menor de estilo de c\u00f3digo reemplazando ocho espacios con una tabulaci\u00f3n para un formato adecuado.\"}],\"affected\":[{\"source\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\",\"affectedData\":[{\"vendor\":\"Linux\",\"product\":\"Linux\",\"defaultStatus\":\"unaffected\",\"programFiles\":[\"include/linux/bpf.h\",\"kernel/bpf/arraymap.c\",\"kernel/bpf/core.c\",\"kernel/bpf/syscall.c\",\"kernel/bpf/trampoline.c\"],\"repo\":\"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git\",\"versions\":[{\"version\":\"be8704ff07d2374bcc5c675526f95e70c6459683\",\"lessThan\":\"987aa730bad3e1ef66d9f30182294daa78f6387d\",\"versionType\":\"git\",\"status\":\"affected\"},{\"version\":\"be8704ff07d2374bcc5c675526f95e70c6459683\",\"lessThan\":\"d6083f040d5d8f8d748462c77e90547097df936e\",\"versionType\":\"git\",\"status\":\"affected\"}]},{\"vendor\":\"Linux\",\"product\":\"Linux\",\"defaultStatus\":\"affected\",\"programFiles\":[\"include/linux/bpf.h\",\"kernel/bpf/arraymap.c\",\"kernel/bpf/core.c\",\"kernel/bpf/syscall.c\",\"kernel/bpf/trampoline.c\"],\"repo\":\"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git\",\"versions\":[{\"version\":\"5.6\",\"status\":\"affected\"},{\"version\":\"0\",\"lessThan\":\"5.6\",\"versionType\":\"semver\",\"status\":\"unaffected\"},{\"version\":\"6.12.5\",\"lessThanOrEqual\":\"6.12.*\",\"versionType\":\"semver\",\"status\":\"unaffected\"},{\"version\":\"6.13\",\"lessThanOrEqual\":\"*\",\"versionType\":\"original_commit_for_fix\",\"status\":\"unaffected\"}]}]}],\"metrics\":{\"cvssMetricV31\":[{\"source\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\",\"type\":\"Secondary\",\"cvssData\":{\"version\":\"3.1\",\"vectorString\":\"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H\",\"baseScore\":7.8,\"baseSeverity\":\"HIGH\",\"attackVector\":\"LOCAL\",\"attackComplexity\":\"LOW\",\"privilegesRequired\":\"LOW\",\"userInteraction\":\"NONE\",\"scope\":\"UNCHANGED\",\"confidentialityImpact\":\"HIGH\",\"integrityImpact\":\"HIGH\",\"availabilityImpact\":\"HIGH\"},\"exploitabilityScore\":1.8,\"impactScore\":5.9},{\"source\":\"nvd@nist.gov\",\"type\":\"Primary\",\"cvssData\":{\"version\":\"3.1\",\"vectorString\":\"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H\",\"baseScore\":5.5,\"baseSeverity\":\"MEDIUM\",\"attackVector\":\"LOCAL\",\"attackComplexity\":\"LOW\",\"privilegesRequired\":\"LOW\",\"userInteraction\":\"NONE\",\"scope\":\"UNCHANGED\",\"confidentialityImpact\":\"NONE\",\"integrityImpact\":\"NONE\",\"availabilityImpact\":\"HIGH\"},\"exploitabilityScore\":1.8,\"impactScore\":3.6}]},\"weaknesses\":[{\"source\":\"nvd@nist.gov\",\"type\":\"Primary\",\"description\":[{\"lang\":\"en\",\"value\":\"CWE-835\"}]}],\"configurations\":[{\"nodes\":[{\"operator\":\"OR\",\"negate\":false,\"cpeMatch\":[{\"vulnerable\":true,\"criteria\":\"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*\",\"versionStartIncluding\":\"5.6\",\"versionEndExcluding\":\"6.12.5\",\"matchCriteriaId\":\"83E30040-8849-4588-B81C-AE479356574C\"}]}]}],\"references\":[{\"url\":\"https://git.kernel.org/stable/c/987aa730bad3e1ef66d9f30182294daa78f6387d\",\"source\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\",\"tags\":[\"Patch\"]},{\"url\":\"https://git.kernel.org/stable/c/d6083f040d5d8f8d748462c77e90547097df936e\",\"source\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\",\"tags\":[\"Patch\"]}]}}",
    "redhat_vex": {
      "aggregate_severity": "Low",
      "current_release_date": "2026-08-04T22:41:08+00:00",
      "cve": "CVE-2024-47794",
      "id": "CVE-2024-47794",
      "initial_release_date": "2024-01-01T00:00:00+00:00",
      "product_status:known_affected": "184",
      "product_status:known_not_affected": "14",
      "source": "Red Hat CSAF VEX",
      "status": "final",
      "title": "kernel: bpf: Prevent tailcall infinite loop caused by freplace",
      "url": "https://security.access.redhat.com/data/csaf/v2/vex/2024/cve-2024-47794.json",
      "version": "3"
    },
    "suse_vex": {
      "aggregate_severity": "moderate",
      "current_release_date": "2026-09-01T13:59:02Z",
      "cve": "CVE-2024-47794",
      "id": "CVE-2024-47794",
      "initial_release_date": "2025-01-12T00:18:06Z",
      "product_status:known_affected": "583",
      "product_status:known_not_affected": "215",
      "product_status:recommended": "384",
      "source": "SUSE CSAF VEX",
      "status": "interim",
      "title": "SUSE CVE CVE-2024-47794",
      "url": "https://ftp.suse.com/pub/projects/security/csaf-vex/cve-2024-47794.json",
      "version": "56"
    }
  }
}



Log in or create an account to share your comment.




Tags
Taxonomy of the tags.


Loading…

Loading…

Loading…

Forecast uses a logistic model when the trend is rising, or an exponential decay model when the trend is falling. Fitted via linearized least squares.

Sightings

Author Source Type Date Other

Nomenclature

  • Seen: The vulnerability was mentioned, discussed, or observed by the user.
  • Confirmed: The vulnerability has been validated from an analyst's perspective.
  • Published Proof of Concept: A public proof of concept is available for this vulnerability.
  • Exploited: The vulnerability was observed as exploited by the user who reported the sighting.
  • Patched: The vulnerability was observed as successfully patched by the user who reported the sighting.
  • Not exploited: The vulnerability was not observed as exploited by the user who reported the sighting.
  • Not confirmed: The user expressed doubt about the validity of the vulnerability.
  • Not patched: The vulnerability was not observed as successfully patched by the user who reported the sighting.

Loading…

Detection rules are retrieved from Rulezet.

Loading…

Loading…

Related by attack behaviour

Vulnerabilities whose description is nearest to this one in the vector space of the CIRCL/vulnerability-attack-technique-biencoder model. This is a similarity search over the bi-encoder space (plain cosine), not a classification, and it has no measured accuracy.


Loading…