cve-2021-47608
Vulnerability from cvelistv5
Published
2024-06-19 14:54
Modified
2024-09-11 17:34
Severity
Summary
bpf: Fix kernel address leakage in atomic fetch
Impacted products
VendorProduct
LinuxLinux
LinuxLinux
Show details on NVD website


{
  "containers": {
    "adp": [
      {
        "providerMetadata": {
          "dateUpdated": "2024-08-04T05:47:40.335Z",
          "orgId": "af854a3a-2127-422b-91ae-364da2661108",
          "shortName": "CVE"
        },
        "references": [
          {
            "tags": [
              "x_transferred"
            ],
            "url": "https://git.kernel.org/stable/c/423628125a484538111c2c6d9bb1588eb086053b"
          },
          {
            "tags": [
              "x_transferred"
            ],
            "url": "https://git.kernel.org/stable/c/7d3baf0afa3aa9102d6a521a8e4c41888bb79882"
          }
        ],
        "title": "CVE Program Container"
      },
      {
        "metrics": [
          {
            "other": {
              "content": {
                "id": "CVE-2021-47608",
                "options": [
                  {
                    "Exploitation": "none"
                  },
                  {
                    "Automatable": "no"
                  },
                  {
                    "Technical Impact": "partial"
                  }
                ],
                "role": "CISA Coordinator",
                "timestamp": "2024-09-10T17:12:01.674313Z",
                "version": "2.0.3"
              },
              "type": "ssvc"
            }
          }
        ],
        "providerMetadata": {
          "dateUpdated": "2024-09-11T17:34:51.223Z",
          "orgId": "134c704f-9b21-4f2e-91b3-4a467353bcc0",
          "shortName": "CISA-ADP"
        },
        "title": "CISA ADP Vulnrichment"
      }
    ],
    "cna": {
      "affected": [
        {
          "defaultStatus": "unaffected",
          "product": "Linux",
          "programFiles": [
            "kernel/bpf/verifier.c"
          ],
          "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
          "vendor": "Linux",
          "versions": [
            {
              "lessThan": "423628125a48",
              "status": "affected",
              "version": "37086bfdc737",
              "versionType": "git"
            },
            {
              "lessThan": "7d3baf0afa3a",
              "status": "affected",
              "version": "37086bfdc737",
              "versionType": "git"
            }
          ]
        },
        {
          "defaultStatus": "affected",
          "product": "Linux",
          "programFiles": [
            "kernel/bpf/verifier.c"
          ],
          "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
          "vendor": "Linux",
          "versions": [
            {
              "status": "affected",
              "version": "5.12"
            },
            {
              "lessThan": "5.12",
              "status": "unaffected",
              "version": "0",
              "versionType": "custom"
            },
            {
              "lessThanOrEqual": "5.15.*",
              "status": "unaffected",
              "version": "5.15.11",
              "versionType": "custom"
            },
            {
              "lessThanOrEqual": "*",
              "status": "unaffected",
              "version": "5.16",
              "versionType": "original_commit_for_fix"
            }
          ]
        }
      ],
      "descriptions": [
        {
          "lang": "en",
          "value": "In the Linux kernel, the following vulnerability has been resolved:\n\nbpf: Fix kernel address leakage in atomic fetch\n\nThe change in commit 37086bfdc737 (\"bpf: Propagate stack bounds to registers\nin atomics w/ BPF_FETCH\") around check_mem_access() handling is buggy since\nthis would allow for unprivileged users to leak kernel pointers. For example,\nan atomic fetch/and with -1 on a stack destination which holds a spilled\npointer will migrate the spilled register type into a scalar, which can then\nbe exported out of the program (since scalar != pointer) by dumping it into\na map value.\n\nThe original implementation of XADD was preventing this situation by using\na double call to check_mem_access() one with BPF_READ and a subsequent one\nwith BPF_WRITE, in both cases passing -1 as a placeholder value instead of\nregister as per XADD semantics since it didn\u0027t contain a value fetch. The\nBPF_READ also included a check in check_stack_read_fixed_off() which rejects\nthe program if the stack slot is of __is_pointer_value() if dst_regno \u003c 0.\nThe latter is to distinguish whether we\u0027re dealing with a regular stack spill/\nfill or some arithmetical operation which is disallowed on non-scalars, see\nalso 6e7e63cbb023 (\"bpf: Forbid XADD on spilled pointers for unprivileged\nusers\") for more context on check_mem_access() and its handling of placeholder\nvalue -1.\n\nOne minimally intrusive option to fix the leak is for the BPF_FETCH case to\ninitially check the BPF_READ case via check_mem_access() with -1 as register,\nfollowed by the actual load case with non-negative load_reg to propagate\nstack bounds to registers."
        }
      ],
      "providerMetadata": {
        "dateUpdated": "2024-06-19T14:54:06.388Z",
        "orgId": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
        "shortName": "Linux"
      },
      "references": [
        {
          "url": "https://git.kernel.org/stable/c/423628125a484538111c2c6d9bb1588eb086053b"
        },
        {
          "url": "https://git.kernel.org/stable/c/7d3baf0afa3aa9102d6a521a8e4c41888bb79882"
        }
      ],
      "title": "bpf: Fix kernel address leakage in atomic fetch",
      "x_generator": {
        "engine": "bippy-a5840b7849dd"
      }
    }
  },
  "cveMetadata": {
    "assignerOrgId": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
    "assignerShortName": "Linux",
    "cveId": "CVE-2021-47608",
    "datePublished": "2024-06-19T14:54:06.388Z",
    "dateReserved": "2024-05-24T15:11:00.737Z",
    "dateUpdated": "2024-09-11T17:34:51.223Z",
    "state": "PUBLISHED"
  },
  "dataType": "CVE_RECORD",
  "dataVersion": "5.1",
  "meta": {
    "nvd": "{\"cve\":{\"id\":\"CVE-2021-47608\",\"sourceIdentifier\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\",\"published\":\"2024-06-19T15:15:55.360\",\"lastModified\":\"2024-06-20T12:43:25.663\",\"vulnStatus\":\"Awaiting Analysis\",\"descriptions\":[{\"lang\":\"en\",\"value\":\"In the Linux kernel, the following vulnerability has been resolved:\\n\\nbpf: Fix kernel address leakage in atomic fetch\\n\\nThe change in commit 37086bfdc737 (\\\"bpf: Propagate stack bounds to registers\\nin atomics w/ BPF_FETCH\\\") around check_mem_access() handling is buggy since\\nthis would allow for unprivileged users to leak kernel pointers. For example,\\nan atomic fetch/and with -1 on a stack destination which holds a spilled\\npointer will migrate the spilled register type into a scalar, which can then\\nbe exported out of the program (since scalar != pointer) by dumping it into\\na map value.\\n\\nThe original implementation of XADD was preventing this situation by using\\na double call to check_mem_access() one with BPF_READ and a subsequent one\\nwith BPF_WRITE, in both cases passing -1 as a placeholder value instead of\\nregister as per XADD semantics since it didn\u0027t contain a value fetch. The\\nBPF_READ also included a check in check_stack_read_fixed_off() which rejects\\nthe program if the stack slot is of __is_pointer_value() if dst_regno \u003c 0.\\nThe latter is to distinguish whether we\u0027re dealing with a regular stack spill/\\nfill or some arithmetical operation which is disallowed on non-scalars, see\\nalso 6e7e63cbb023 (\\\"bpf: Forbid XADD on spilled pointers for unprivileged\\nusers\\\") for more context on check_mem_access() and its handling of placeholder\\nvalue -1.\\n\\nOne minimally intrusive option to fix the leak is for the BPF_FETCH case to\\ninitially check the BPF_READ case via check_mem_access() with -1 as register,\\nfollowed by the actual load case with non-negative load_reg to propagate\\nstack bounds to registers.\"},{\"lang\":\"es\",\"value\":\"En el kernel de Linux, se resolvi\u00f3 la siguiente vulnerabilidad: bpf: corrige la fuga de la direcci\u00f3n del kernel en la recuperaci\u00f3n at\u00f3mica. El cambio en el commit 37086bfdc737 (\\\"bpf: propaga los l\u00edmites de la pila a los registros en at\u00f3micos con BPF_FETCH\\\") alrededor del manejo de check_mem_access() tiene errores ya que esto permitir\u00eda a usuarios sin privilegios filtrar punteros del kernel. Por ejemplo, una recuperaci\u00f3n at\u00f3mica/y con -1 en un destino de pila que contiene un puntero derramado migrar\u00e1 el tipo de registro derramado a un escalar, que luego se puede exportar fuera del programa (ya que escalar! = puntero) volc\u00e1ndolo en un valor de mapa. La implementaci\u00f3n original de XADD evitaba esta situaci\u00f3n mediante el uso de una llamada doble a check_mem_access(), una con BPF_READ y otra posterior con BPF_WRITE, en ambos casos pasando -1 como valor de marcador de posici\u00f3n en lugar de registrarse seg\u00fan la sem\u00e1ntica de XADD, ya que no lo hac\u00eda contener una recuperaci\u00f3n de valor. BPF_READ tambi\u00e9n incluy\u00f3 una verificaci\u00f3n en check_stack_read_fixed_off() que rechaza el programa si la ranura de la pila es de __is_pointer_value() si dst_regno \u0026lt; 0. Esto \u00faltimo es para distinguir si estamos tratando con un derrame/llenado de pila regular o alguna operaci\u00f3n aritm\u00e9tica que no est\u00e1 permitido en valores no escalares, consulte tambi\u00e9n 6e7e63cbb023 (\\\"bpf: Prohibir XADD en punteros dispersos para usuarios sin privilegios\\\") para obtener m\u00e1s contexto sobre check_mem_access() y su manejo del valor del marcador de posici\u00f3n -1. Una opci\u00f3n m\u00ednimamente intrusiva para solucionar la fuga es que el caso BPF_FETCH verifique inicialmente el caso BPF_READ mediante check_mem_access() con -1 como registro, seguido del caso de carga real con load_reg no negativo para propagar los l\u00edmites de la pila a los registros.\"}],\"metrics\":{},\"references\":[{\"url\":\"https://git.kernel.org/stable/c/423628125a484538111c2c6d9bb1588eb086053b\",\"source\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\"},{\"url\":\"https://git.kernel.org/stable/c/7d3baf0afa3aa9102d6a521a8e4c41888bb79882\",\"source\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\"}]}}"
  }
}


Log in or create an account to share your comment.




Tags
Taxonomy of the tags.


Loading...

Loading...