cve-2024-36937
Vulnerability from cvelistv5
Published
2024-05-30 15:29
Modified
2024-09-11 17:34
Severity
Summary
xdp: use flags field to disambiguate broadcast redirect
Impacted products
VendorProduct
LinuxLinux
LinuxLinux
Show details on NVD website


{
  "containers": {
    "adp": [
      {
        "providerMetadata": {
          "dateUpdated": "2024-08-02T03:43:50.646Z",
          "orgId": "af854a3a-2127-422b-91ae-364da2661108",
          "shortName": "CVE"
        },
        "references": [
          {
            "tags": [
              "x_transferred"
            ],
            "url": "https://git.kernel.org/stable/c/12481f30128fbebc2eeb55eb2d56390fdfa30c5e"
          },
          {
            "tags": [
              "x_transferred"
            ],
            "url": "https://git.kernel.org/stable/c/272bfb019f3cc018f654b992115774e77b4f3ffc"
          },
          {
            "tags": [
              "x_transferred"
            ],
            "url": "https://git.kernel.org/stable/c/e22e25820fa04ea5eaac4ef7ee200e9923f466a4"
          },
          {
            "tags": [
              "x_transferred"
            ],
            "url": "https://git.kernel.org/stable/c/6fd81f9d333e7b3532036577b1beb74ba1323553"
          },
          {
            "tags": [
              "x_transferred"
            ],
            "url": "https://git.kernel.org/stable/c/5bcf0dcbf9066348058b88a510c57f70f384c92c"
          }
        ],
        "title": "CVE Program Container"
      },
      {
        "metrics": [
          {
            "other": {
              "content": {
                "id": "CVE-2024-36937",
                "options": [
                  {
                    "Exploitation": "none"
                  },
                  {
                    "Automatable": "no"
                  },
                  {
                    "Technical Impact": "partial"
                  }
                ],
                "role": "CISA Coordinator",
                "timestamp": "2024-09-10T17:15:48.388446Z",
                "version": "2.0.3"
              },
              "type": "ssvc"
            }
          }
        ],
        "providerMetadata": {
          "dateUpdated": "2024-09-11T17:34:59.643Z",
          "orgId": "134c704f-9b21-4f2e-91b3-4a467353bcc0",
          "shortName": "CISA-ADP"
        },
        "title": "CISA ADP Vulnrichment"
      }
    ],
    "cna": {
      "affected": [
        {
          "defaultStatus": "unaffected",
          "product": "Linux",
          "programFiles": [
            "net/core/filter.c"
          ],
          "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
          "vendor": "Linux",
          "versions": [
            {
              "lessThan": "12481f30128f",
              "status": "affected",
              "version": "e624d4ed4aa8",
              "versionType": "git"
            },
            {
              "lessThan": "272bfb019f3c",
              "status": "affected",
              "version": "e624d4ed4aa8",
              "versionType": "git"
            },
            {
              "lessThan": "e22e25820fa0",
              "status": "affected",
              "version": "e624d4ed4aa8",
              "versionType": "git"
            },
            {
              "lessThan": "6fd81f9d333e",
              "status": "affected",
              "version": "e624d4ed4aa8",
              "versionType": "git"
            },
            {
              "lessThan": "5bcf0dcbf906",
              "status": "affected",
              "version": "e624d4ed4aa8",
              "versionType": "git"
            }
          ]
        },
        {
          "defaultStatus": "affected",
          "product": "Linux",
          "programFiles": [
            "net/core/filter.c"
          ],
          "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
          "vendor": "Linux",
          "versions": [
            {
              "status": "affected",
              "version": "5.14"
            },
            {
              "lessThan": "5.14",
              "status": "unaffected",
              "version": "0",
              "versionType": "custom"
            },
            {
              "lessThanOrEqual": "5.15.*",
              "status": "unaffected",
              "version": "5.15.159",
              "versionType": "custom"
            },
            {
              "lessThanOrEqual": "6.1.*",
              "status": "unaffected",
              "version": "6.1.91",
              "versionType": "custom"
            },
            {
              "lessThanOrEqual": "6.6.*",
              "status": "unaffected",
              "version": "6.6.31",
              "versionType": "custom"
            },
            {
              "lessThanOrEqual": "6.8.*",
              "status": "unaffected",
              "version": "6.8.10",
              "versionType": "custom"
            },
            {
              "lessThanOrEqual": "*",
              "status": "unaffected",
              "version": "6.9",
              "versionType": "original_commit_for_fix"
            }
          ]
        }
      ],
      "descriptions": [
        {
          "lang": "en",
          "value": "In the Linux kernel, the following vulnerability has been resolved:\n\nxdp: use flags field to disambiguate broadcast redirect\n\nWhen redirecting a packet using XDP, the bpf_redirect_map() helper will set\nup the redirect destination information in struct bpf_redirect_info (using\nthe __bpf_xdp_redirect_map() helper function), and the xdp_do_redirect()\nfunction will read this information after the XDP program returns and pass\nthe frame on to the right redirect destination.\n\nWhen using the BPF_F_BROADCAST flag to do multicast redirect to a whole\nmap, __bpf_xdp_redirect_map() sets the \u0027map\u0027 pointer in struct\nbpf_redirect_info to point to the destination map to be broadcast. And\nxdp_do_redirect() reacts to the value of this map pointer to decide whether\nit\u0027s dealing with a broadcast or a single-value redirect. However, if the\ndestination map is being destroyed before xdp_do_redirect() is called, the\nmap pointer will be cleared out (by bpf_clear_redirect_map()) without\nwaiting for any XDP programs to stop running. This causes xdp_do_redirect()\nto think that the redirect was to a single target, but the target pointer\nis also NULL (since broadcast redirects don\u0027t have a single target), so\nthis causes a crash when a NULL pointer is passed to dev_map_enqueue().\n\nTo fix this, change xdp_do_redirect() to react directly to the presence of\nthe BPF_F_BROADCAST flag in the \u0027flags\u0027 value in struct bpf_redirect_info\nto disambiguate between a single-target and a broadcast redirect. And only\nread the \u0027map\u0027 pointer if the broadcast flag is set, aborting if that has\nbeen cleared out in the meantime. This prevents the crash, while keeping\nthe atomic (cmpxchg-based) clearing of the map pointer itself, and without\nadding any more checks in the non-broadcast fast path."
        }
      ],
      "providerMetadata": {
        "dateUpdated": "2024-05-30T15:29:26.353Z",
        "orgId": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
        "shortName": "Linux"
      },
      "references": [
        {
          "url": "https://git.kernel.org/stable/c/12481f30128fbebc2eeb55eb2d56390fdfa30c5e"
        },
        {
          "url": "https://git.kernel.org/stable/c/272bfb019f3cc018f654b992115774e77b4f3ffc"
        },
        {
          "url": "https://git.kernel.org/stable/c/e22e25820fa04ea5eaac4ef7ee200e9923f466a4"
        },
        {
          "url": "https://git.kernel.org/stable/c/6fd81f9d333e7b3532036577b1beb74ba1323553"
        },
        {
          "url": "https://git.kernel.org/stable/c/5bcf0dcbf9066348058b88a510c57f70f384c92c"
        }
      ],
      "title": "xdp: use flags field to disambiguate broadcast redirect",
      "x_generator": {
        "engine": "bippy-a5840b7849dd"
      }
    }
  },
  "cveMetadata": {
    "assignerOrgId": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
    "assignerShortName": "Linux",
    "cveId": "CVE-2024-36937",
    "datePublished": "2024-05-30T15:29:26.353Z",
    "dateReserved": "2024-05-30T15:25:07.071Z",
    "dateUpdated": "2024-09-11T17:34:59.643Z",
    "state": "PUBLISHED"
  },
  "dataType": "CVE_RECORD",
  "dataVersion": "5.1",
  "meta": {
    "nvd": "{\"cve\":{\"id\":\"CVE-2024-36937\",\"sourceIdentifier\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\",\"published\":\"2024-05-30T16:15:16.797\",\"lastModified\":\"2024-05-30T18:18:58.870\",\"vulnStatus\":\"Awaiting Analysis\",\"descriptions\":[{\"lang\":\"en\",\"value\":\"In the Linux kernel, the following vulnerability has been resolved:\\n\\nxdp: use flags field to disambiguate broadcast redirect\\n\\nWhen redirecting a packet using XDP, the bpf_redirect_map() helper will set\\nup the redirect destination information in struct bpf_redirect_info (using\\nthe __bpf_xdp_redirect_map() helper function), and the xdp_do_redirect()\\nfunction will read this information after the XDP program returns and pass\\nthe frame on to the right redirect destination.\\n\\nWhen using the BPF_F_BROADCAST flag to do multicast redirect to a whole\\nmap, __bpf_xdp_redirect_map() sets the \u0027map\u0027 pointer in struct\\nbpf_redirect_info to point to the destination map to be broadcast. And\\nxdp_do_redirect() reacts to the value of this map pointer to decide whether\\nit\u0027s dealing with a broadcast or a single-value redirect. However, if the\\ndestination map is being destroyed before xdp_do_redirect() is called, the\\nmap pointer will be cleared out (by bpf_clear_redirect_map()) without\\nwaiting for any XDP programs to stop running. This causes xdp_do_redirect()\\nto think that the redirect was to a single target, but the target pointer\\nis also NULL (since broadcast redirects don\u0027t have a single target), so\\nthis causes a crash when a NULL pointer is passed to dev_map_enqueue().\\n\\nTo fix this, change xdp_do_redirect() to react directly to the presence of\\nthe BPF_F_BROADCAST flag in the \u0027flags\u0027 value in struct bpf_redirect_info\\nto disambiguate between a single-target and a broadcast redirect. And only\\nread the \u0027map\u0027 pointer if the broadcast flag is set, aborting if that has\\nbeen cleared out in the meantime. This prevents the crash, while keeping\\nthe atomic (cmpxchg-based) clearing of the map pointer itself, and without\\nadding any more checks in the non-broadcast fast path.\"},{\"lang\":\"es\",\"value\":\"En el kernel de Linux, se ha resuelto la siguiente vulnerabilidad: xdp: use el campo flags para eliminar la ambig\u00fcedad de la redirecci\u00f3n de transmisi\u00f3n Al redireccionar un paquete usando XDP, el asistente bpf_redirect_map() configurar\u00e1 la informaci\u00f3n del destino de redireccionamiento en la estructura bpf_redirect_info (usando el asistente __bpf_xdp_redirect_map() funci\u00f3n), y la funci\u00f3n xdp_do_redirect() leer\u00e1 esta informaci\u00f3n despu\u00e9s de que el programa XDP regrese y pasar\u00e1 el framework al destino de redireccionamiento correcto. Cuando se utiliza el indicador BPF_F_BROADCAST para realizar una redirecci\u00f3n de multidifusi\u00f3n a un mapa completo, __bpf_xdp_redirect_map() establece el puntero \u0027mapa\u0027 en la estructura bpf_redirect_info para que apunte al mapa de destino que se va a transmitir. Y xdp_do_redirect() reacciona al valor de este puntero de mapa para decidir si se trata de una transmisi\u00f3n o una redirecci\u00f3n de valor \u00fanico. Sin embargo, si el mapa de destino se destruye antes de llamar a xdp_do_redirect(), el puntero del mapa se borrar\u00e1 (mediante bpf_clear_redirect_map()) sin esperar a que deje de ejecutarse ning\u00fan programa XDP. Esto hace que xdp_do_redirect() piense que la redirecci\u00f3n fue a un \u00fanico objetivo, pero el puntero de destino tambi\u00e9n es NULL (dado que las redirecciones de difusi\u00f3n no tienen un \u00fanico objetivo), por lo que esto provoca un bloqueo cuando se pasa un puntero NULL a dev_map_enqueue( ). Para solucionar este problema, cambie xdp_do_redirect() para reaccionar directamente a la presencia del indicador BPF_F_BROADCAST en el valor \u0027flags\u0027 en la estructura bpf_redirect_info para eliminar la ambig\u00fcedad entre un redireccionamiento de destino \u00fanico y de transmisi\u00f3n. Y solo lea el puntero del \u0027mapa\u0027 si la bandera de transmisi\u00f3n est\u00e1 activada, abortando si se ha borrado mientras tanto. Esto evita el bloqueo, manteniendo al mismo tiempo la limpieza at\u00f3mica (basada en cmpxchg) del puntero del mapa y sin agregar m\u00e1s comprobaciones en la ruta r\u00e1pida sin transmisi\u00f3n.\"}],\"metrics\":{},\"references\":[{\"url\":\"https://git.kernel.org/stable/c/12481f30128fbebc2eeb55eb2d56390fdfa30c5e\",\"source\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\"},{\"url\":\"https://git.kernel.org/stable/c/272bfb019f3cc018f654b992115774e77b4f3ffc\",\"source\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\"},{\"url\":\"https://git.kernel.org/stable/c/5bcf0dcbf9066348058b88a510c57f70f384c92c\",\"source\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\"},{\"url\":\"https://git.kernel.org/stable/c/6fd81f9d333e7b3532036577b1beb74ba1323553\",\"source\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\"},{\"url\":\"https://git.kernel.org/stable/c/e22e25820fa04ea5eaac4ef7ee200e9923f466a4\",\"source\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\"}]}}"
  }
}


Log in or create an account to share your comment.




Tags
Taxonomy of the tags.


Loading...

Loading...