CVE-2022-50168 (GCVE-0-2022-50168)

Vulnerability from cvelistv5 – Published: 2025-06-18 11:03 – Updated: 2025-06-18 11:03
VLAI?
Summary
In the Linux kernel, the following vulnerability has been resolved: bpf, x86: fix freeing of not-finalized bpf_prog_pack syzbot reported a few issues with bpf_prog_pack [1], [2]. This only happens with multiple subprogs. In jit_subprogs(), we first call bpf_int_jit_compile() on each sub program. And then, we call it on each sub program again. jit_data is not freed in the first call of bpf_int_jit_compile(). Similarly we don't call bpf_jit_binary_pack_finalize() in the first call of bpf_int_jit_compile(). If bpf_int_jit_compile() failed for one sub program, we will call bpf_jit_binary_pack_finalize() for this sub program. However, we don't have a chance to call it for other sub programs. Then we will hit "goto out_free" in jit_subprogs(), and call bpf_jit_free on some subprograms that haven't got bpf_jit_binary_pack_finalize() yet. At this point, bpf_jit_binary_pack_free() is called and the whole 2MB page is freed erroneously. Fix this with a custom bpf_jit_free() for x86_64, which calls bpf_jit_binary_pack_finalize() if necessary. Also, with custom bpf_jit_free(), bpf_prog_aux->use_bpf_prog_pack is not needed any more, remove it. [1] https://syzkaller.appspot.com/bug?extid=2f649ec6d2eea1495a8f [2] https://syzkaller.appspot.com/bug?extid=87f65c75f4a72db05445
Severity ?
No CVSS data available.
Assigner
Impacted products
Vendor Product Version
Linux Linux Affected: 1022a5498f6f745c3b5fd3f050a5e11e7ca354f0 , < f91ce608a79c0db3e72bd63c23e011a9ebc31505 (git)
Affected: 1022a5498f6f745c3b5fd3f050a5e11e7ca354f0 , < 60e66074812dde9cde3d99cdd3caa9e40f1a4516 (git)
Affected: 1022a5498f6f745c3b5fd3f050a5e11e7ca354f0 , < 1d5f82d9dd477d5c66e0214a68c3e4f308eadd6d (git)
Create a notification for this product.
    Linux Linux Affected: 5.18
Unaffected: 0 , < 5.18 (semver)
Unaffected: 5.18.18 , ≤ 5.18.* (semver)
Unaffected: 5.19.2 , ≤ 5.19.* (semver)
Unaffected: 6.0 , ≤ * (original_commit_for_fix)
Create a notification for this product.
Show details on NVD website

{
  "containers": {
    "cna": {
      "affected": [
        {
          "defaultStatus": "unaffected",
          "product": "Linux",
          "programFiles": [
            "arch/x86/net/bpf_jit_comp.c",
            "include/linux/bpf.h",
            "include/linux/filter.h",
            "kernel/bpf/core.c"
          ],
          "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
          "vendor": "Linux",
          "versions": [
            {
              "lessThan": "f91ce608a79c0db3e72bd63c23e011a9ebc31505",
              "status": "affected",
              "version": "1022a5498f6f745c3b5fd3f050a5e11e7ca354f0",
              "versionType": "git"
            },
            {
              "lessThan": "60e66074812dde9cde3d99cdd3caa9e40f1a4516",
              "status": "affected",
              "version": "1022a5498f6f745c3b5fd3f050a5e11e7ca354f0",
              "versionType": "git"
            },
            {
              "lessThan": "1d5f82d9dd477d5c66e0214a68c3e4f308eadd6d",
              "status": "affected",
              "version": "1022a5498f6f745c3b5fd3f050a5e11e7ca354f0",
              "versionType": "git"
            }
          ]
        },
        {
          "defaultStatus": "affected",
          "product": "Linux",
          "programFiles": [
            "arch/x86/net/bpf_jit_comp.c",
            "include/linux/bpf.h",
            "include/linux/filter.h",
            "kernel/bpf/core.c"
          ],
          "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
          "vendor": "Linux",
          "versions": [
            {
              "status": "affected",
              "version": "5.18"
            },
            {
              "lessThan": "5.18",
              "status": "unaffected",
              "version": "0",
              "versionType": "semver"
            },
            {
              "lessThanOrEqual": "5.18.*",
              "status": "unaffected",
              "version": "5.18.18",
              "versionType": "semver"
            },
            {
              "lessThanOrEqual": "5.19.*",
              "status": "unaffected",
              "version": "5.19.2",
              "versionType": "semver"
            },
            {
              "lessThanOrEqual": "*",
              "status": "unaffected",
              "version": "6.0",
              "versionType": "original_commit_for_fix"
            }
          ]
        }
      ],
      "cpeApplicability": [
        {
          "nodes": [
            {
              "cpeMatch": [
                {
                  "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                  "versionEndExcluding": "5.18.18",
                  "versionStartIncluding": "5.18",
                  "vulnerable": true
                },
                {
                  "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                  "versionEndExcluding": "5.19.2",
                  "versionStartIncluding": "5.18",
                  "vulnerable": true
                },
                {
                  "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                  "versionEndExcluding": "6.0",
                  "versionStartIncluding": "5.18",
                  "vulnerable": true
                }
              ],
              "negate": false,
              "operator": "OR"
            }
          ]
        }
      ],
      "descriptions": [
        {
          "lang": "en",
          "value": "In the Linux kernel, the following vulnerability has been resolved:\n\nbpf, x86: fix freeing of not-finalized bpf_prog_pack\n\nsyzbot reported a few issues with bpf_prog_pack [1], [2]. This only happens\nwith multiple subprogs. In jit_subprogs(), we first call bpf_int_jit_compile()\non each sub program. And then, we call it on each sub program again. jit_data\nis not freed in the first call of bpf_int_jit_compile(). Similarly we don\u0027t\ncall bpf_jit_binary_pack_finalize() in the first call of bpf_int_jit_compile().\n\nIf bpf_int_jit_compile() failed for one sub program, we will call\nbpf_jit_binary_pack_finalize() for this sub program. However, we don\u0027t have a\nchance to call it for other sub programs. Then we will hit \"goto out_free\" in\njit_subprogs(), and call bpf_jit_free on some subprograms that haven\u0027t got\nbpf_jit_binary_pack_finalize() yet.\n\nAt this point, bpf_jit_binary_pack_free() is called and the whole 2MB page is\nfreed erroneously.\n\nFix this with a custom bpf_jit_free() for x86_64, which calls\nbpf_jit_binary_pack_finalize() if necessary. Also, with custom\nbpf_jit_free(), bpf_prog_aux-\u003euse_bpf_prog_pack is not needed any more,\nremove it.\n\n[1] https://syzkaller.appspot.com/bug?extid=2f649ec6d2eea1495a8f\n[2] https://syzkaller.appspot.com/bug?extid=87f65c75f4a72db05445"
        }
      ],
      "providerMetadata": {
        "dateUpdated": "2025-06-18T11:03:21.593Z",
        "orgId": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
        "shortName": "Linux"
      },
      "references": [
        {
          "url": "https://git.kernel.org/stable/c/f91ce608a79c0db3e72bd63c23e011a9ebc31505"
        },
        {
          "url": "https://git.kernel.org/stable/c/60e66074812dde9cde3d99cdd3caa9e40f1a4516"
        },
        {
          "url": "https://git.kernel.org/stable/c/1d5f82d9dd477d5c66e0214a68c3e4f308eadd6d"
        }
      ],
      "title": "bpf, x86: fix freeing of not-finalized bpf_prog_pack",
      "x_generator": {
        "engine": "bippy-1.2.0"
      }
    }
  },
  "cveMetadata": {
    "assignerOrgId": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
    "assignerShortName": "Linux",
    "cveId": "CVE-2022-50168",
    "datePublished": "2025-06-18T11:03:21.593Z",
    "dateReserved": "2025-06-18T10:57:27.426Z",
    "dateUpdated": "2025-06-18T11:03:21.593Z",
    "state": "PUBLISHED"
  },
  "dataType": "CVE_RECORD",
  "dataVersion": "5.1",
  "vulnerability-lookup:meta": {
    "nvd": "{\"cve\":{\"id\":\"CVE-2022-50168\",\"sourceIdentifier\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\",\"published\":\"2025-06-18T11:15:47.117\",\"lastModified\":\"2025-12-03T20:30:42.443\",\"vulnStatus\":\"Analyzed\",\"cveTags\":[],\"descriptions\":[{\"lang\":\"en\",\"value\":\"In the Linux kernel, the following vulnerability has been resolved:\\n\\nbpf, x86: fix freeing of not-finalized bpf_prog_pack\\n\\nsyzbot reported a few issues with bpf_prog_pack [1], [2]. This only happens\\nwith multiple subprogs. In jit_subprogs(), we first call bpf_int_jit_compile()\\non each sub program. And then, we call it on each sub program again. jit_data\\nis not freed in the first call of bpf_int_jit_compile(). Similarly we don\u0027t\\ncall bpf_jit_binary_pack_finalize() in the first call of bpf_int_jit_compile().\\n\\nIf bpf_int_jit_compile() failed for one sub program, we will call\\nbpf_jit_binary_pack_finalize() for this sub program. However, we don\u0027t have a\\nchance to call it for other sub programs. Then we will hit \\\"goto out_free\\\" in\\njit_subprogs(), and call bpf_jit_free on some subprograms that haven\u0027t got\\nbpf_jit_binary_pack_finalize() yet.\\n\\nAt this point, bpf_jit_binary_pack_free() is called and the whole 2MB page is\\nfreed erroneously.\\n\\nFix this with a custom bpf_jit_free() for x86_64, which calls\\nbpf_jit_binary_pack_finalize() if necessary. Also, with custom\\nbpf_jit_free(), bpf_prog_aux-\u003euse_bpf_prog_pack is not needed any more,\\nremove it.\\n\\n[1] https://syzkaller.appspot.com/bug?extid=2f649ec6d2eea1495a8f\\n[2] https://syzkaller.appspot.com/bug?extid=87f65c75f4a72db05445\"},{\"lang\":\"es\",\"value\":\"En el kernel de Linux, se ha resuelto la siguiente vulnerabilidad: bpf, x86: se corrige la liberaci\u00f3n de bpf_prog_pack no finalizado. syzbot report\u00f3 algunos problemas con bpf_prog_pack [1], [2]. Esto solo ocurre con varios subprogramas. En jit_subprogs(), primero llamamos a bpf_int_jit_compile() en cada subprograma. Y luego, lo volvemos a llamar en cada subprograma. jit_data no se libera en la primera llamada de bpf_int_jit_compile(). De igual manera, no llamamos a bpf_jit_binary_pack_finalize() en la primera llamada de bpf_int_jit_compile(). Si bpf_int_jit_compile() falla en un subprograma, llamaremos a bpf_jit_binary_pack_finalize() para este subprograma. Sin embargo, no podemos llamarlo para otros subprogramas. Luego, pulsaremos \\\"goto out_free\\\" en jit_subprogs() y llamaremos a bpf_jit_free en algunos subprogramas que a\u00fan no tienen bpf_jit_binary_pack_finalize(). En este punto, se llama a bpf_jit_binary_pack_free() y se libera la p\u00e1gina completa de 2 MB por error. Se puede solucionar con un bpf_jit_free() personalizado para x86_64, que llama a bpf_jit_binary_pack_finalize() si es necesario. Adem\u00e1s, con bpf_jit_free() personalizado, bpf_prog_aux-\u0026gt;use_bpf_prog_pack ya no es necesario; elim\u00ednelo. [1] https://syzkaller.appspot.com/bug?extid=2f649ec6d2eea1495a8f [2] https://syzkaller.appspot.com/bug?extid=87f65c75f4a72db05445\"}],\"metrics\":{\"cvssMetricV31\":[{\"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: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}]},\"weaknesses\":[{\"source\":\"nvd@nist.gov\",\"type\":\"Primary\",\"description\":[{\"lang\":\"en\",\"value\":\"NVD-CWE-noinfo\"}]}],\"configurations\":[{\"nodes\":[{\"operator\":\"OR\",\"negate\":false,\"cpeMatch\":[{\"vulnerable\":true,\"criteria\":\"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*\",\"versionStartIncluding\":\"5.18\",\"versionEndExcluding\":\"5.18.18\",\"matchCriteriaId\":\"28A3BD94-A9B1-461A-9325-1B7EF7D364B6\"},{\"vulnerable\":true,\"criteria\":\"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*\",\"versionStartIncluding\":\"5.19\",\"versionEndExcluding\":\"5.19.2\",\"matchCriteriaId\":\"A1A2A5A5-4598-4D7E-BA07-4660398D6C8F\"}]}]}],\"references\":[{\"url\":\"https://git.kernel.org/stable/c/1d5f82d9dd477d5c66e0214a68c3e4f308eadd6d\",\"source\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\",\"tags\":[\"Patch\"]},{\"url\":\"https://git.kernel.org/stable/c/60e66074812dde9cde3d99cdd3caa9e40f1a4516\",\"source\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\",\"tags\":[\"Patch\"]},{\"url\":\"https://git.kernel.org/stable/c/f91ce608a79c0db3e72bd63c23e011a9ebc31505\",\"source\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\",\"tags\":[\"Patch\"]}]}}"
  }
}


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 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…