gsd-2021-46910
Vulnerability from gsd
Modified
2024-02-26 06:03
Details
In the Linux kernel, the following vulnerability has been resolved: ARM: 9063/1: mm: reduce maximum number of CPUs if DEBUG_KMAP_LOCAL is enabled The debugging code for kmap_local() doubles the number of per-CPU fixmap slots allocated for kmap_local(), in order to use half of them as guard regions. This causes the fixmap region to grow downwards beyond the start of its reserved window if the supported number of CPUs is large, and collide with the newly added virtual DT mapping right below it, which is obviously not good. One manifestation of this is EFI boot on a kernel built with NR_CPUS=32 and CONFIG_DEBUG_KMAP_LOCAL=y, which may pass the FDT in highmem, resulting in block entries below the fixmap region that the fixmap code misidentifies as fixmap table entries, and subsequently tries to dereference using a phys-to-virt translation that is only valid for lowmem. This results in a cryptic splat such as the one below. ftrace: allocating 45548 entries in 89 pages 8<--- cut here --- Unable to handle kernel paging request at virtual address fc6006f0 pgd = (ptrval) [fc6006f0] *pgd=80000040207003, *pmd=00000000 Internal error: Oops: a06 [#1] SMP ARM Modules linked in: CPU: 0 PID: 0 Comm: swapper Not tainted 5.11.0+ #382 Hardware name: Generic DT based system PC is at cpu_ca15_set_pte_ext+0x24/0x30 LR is at __set_fixmap+0xe4/0x118 pc : [<c041ac9c>] lr : [<c04189d8>] psr: 400000d3 sp : c1601ed8 ip : 00400000 fp : 00800000 r10: 0000071f r9 : 00421000 r8 : 00c00000 r7 : 00c00000 r6 : 0000071f r5 : ffade000 r4 : 4040171f r3 : 00c00000 r2 : 4040171f r1 : c041ac78 r0 : fc6006f0 Flags: nZcv IRQs off FIQs off Mode SVC_32 ISA ARM Segment none Control: 30c5387d Table: 40203000 DAC: 00000001 Process swapper (pid: 0, stack limit = 0x(ptrval)) So let's limit CONFIG_NR_CPUS to 16 when CONFIG_DEBUG_KMAP_LOCAL=y. Also, fix the BUILD_BUG_ON() check that was supposed to catch this, by checking whether the region grows below the start address rather than above the end address.
Aliases



{
  "gsd": {
    "metadata": {
      "exploitCode": "unknown",
      "remediation": "unknown",
      "reportConfidence": "confirmed",
      "type": "vulnerability"
    },
    "osvSchema": {
      "aliases": [
        "CVE-2021-46910"
      ],
      "details": "In the Linux kernel, the following vulnerability has been resolved:\n\nARM: 9063/1: mm: reduce maximum number of CPUs if DEBUG_KMAP_LOCAL is enabled\n\nThe debugging code for kmap_local() doubles the number of per-CPU fixmap\nslots allocated for kmap_local(), in order to use half of them as guard\nregions. This causes the fixmap region to grow downwards beyond the start\nof its reserved window if the supported number of CPUs is large, and collide\nwith the newly added virtual DT mapping right below it, which is obviously\nnot good.\n\nOne manifestation of this is EFI boot on a kernel built with NR_CPUS=32\nand CONFIG_DEBUG_KMAP_LOCAL=y, which may pass the FDT in highmem, resulting\nin block entries below the fixmap region that the fixmap code misidentifies\nas fixmap table entries, and subsequently tries to dereference using a\nphys-to-virt translation that is only valid for lowmem. This results in a\ncryptic splat such as the one below.\n\n  ftrace: allocating 45548 entries in 89 pages\n  8\u003c--- cut here ---\n  Unable to handle kernel paging request at virtual address fc6006f0\n  pgd = (ptrval)\n  [fc6006f0] *pgd=80000040207003, *pmd=00000000\n  Internal error: Oops: a06 [#1] SMP ARM\n  Modules linked in:\n  CPU: 0 PID: 0 Comm: swapper Not tainted 5.11.0+ #382\n  Hardware name: Generic DT based system\n  PC is at cpu_ca15_set_pte_ext+0x24/0x30\n  LR is at __set_fixmap+0xe4/0x118\n  pc : [\u003cc041ac9c\u003e]    lr : [\u003cc04189d8\u003e]    psr: 400000d3\n  sp : c1601ed8  ip : 00400000  fp : 00800000\n  r10: 0000071f  r9 : 00421000  r8 : 00c00000\n  r7 : 00c00000  r6 : 0000071f  r5 : ffade000  r4 : 4040171f\n  r3 : 00c00000  r2 : 4040171f  r1 : c041ac78  r0 : fc6006f0\n  Flags: nZcv  IRQs off  FIQs off  Mode SVC_32  ISA ARM  Segment none\n  Control: 30c5387d  Table: 40203000  DAC: 00000001\n  Process swapper (pid: 0, stack limit = 0x(ptrval))\n\nSo let\u0027s limit CONFIG_NR_CPUS to 16 when CONFIG_DEBUG_KMAP_LOCAL=y. Also,\nfix the BUILD_BUG_ON() check that was supposed to catch this, by checking\nwhether the region grows below the start address rather than above the end\naddress.",
      "id": "GSD-2021-46910",
      "modified": "2024-02-26T06:03:52.277833Z",
      "schema_version": "1.4.0"
    }
  },
  "namespaces": {
    "cve.org": {
      "CVE_data_meta": {
        "ASSIGNER": "cve@kernel.org",
        "ID": "CVE-2021-46910",
        "STATE": "PUBLIC"
      },
      "affects": {
        "vendor": {
          "vendor_data": [
            {
              "product": {
                "product_data": [
                  {
                    "product_name": "Linux",
                    "version": {
                      "version_data": [
                        {
                          "version_affected": "\u003c",
                          "version_name": "2a15ba82fa6c",
                          "version_value": "5965ac11b1d5"
                        },
                        {
                          "version_value": "not down converted",
                          "x_cve_json_5_version_data": {
                            "defaultStatus": "affected",
                            "versions": [
                              {
                                "status": "affected",
                                "version": "5.11"
                              },
                              {
                                "lessThan": "5.11",
                                "status": "unaffected",
                                "version": "0",
                                "versionType": "custom"
                              },
                              {
                                "lessThanOrEqual": "5.11.*",
                                "status": "unaffected",
                                "version": "5.11.16",
                                "versionType": "custom"
                              },
                              {
                                "lessThanOrEqual": "*",
                                "status": "unaffected",
                                "version": "5.12",
                                "versionType": "original_commit_for_fix"
                              }
                            ]
                          }
                        }
                      ]
                    }
                  }
                ]
              },
              "vendor_name": "Linux"
            }
          ]
        }
      },
      "data_format": "MITRE",
      "data_type": "CVE",
      "data_version": "4.0",
      "description": {
        "description_data": [
          {
            "lang": "eng",
            "value": "In the Linux kernel, the following vulnerability has been resolved:\n\nARM: 9063/1: mm: reduce maximum number of CPUs if DEBUG_KMAP_LOCAL is enabled\n\nThe debugging code for kmap_local() doubles the number of per-CPU fixmap\nslots allocated for kmap_local(), in order to use half of them as guard\nregions. This causes the fixmap region to grow downwards beyond the start\nof its reserved window if the supported number of CPUs is large, and collide\nwith the newly added virtual DT mapping right below it, which is obviously\nnot good.\n\nOne manifestation of this is EFI boot on a kernel built with NR_CPUS=32\nand CONFIG_DEBUG_KMAP_LOCAL=y, which may pass the FDT in highmem, resulting\nin block entries below the fixmap region that the fixmap code misidentifies\nas fixmap table entries, and subsequently tries to dereference using a\nphys-to-virt translation that is only valid for lowmem. This results in a\ncryptic splat such as the one below.\n\n  ftrace: allocating 45548 entries in 89 pages\n  8\u003c--- cut here ---\n  Unable to handle kernel paging request at virtual address fc6006f0\n  pgd = (ptrval)\n  [fc6006f0] *pgd=80000040207003, *pmd=00000000\n  Internal error: Oops: a06 [#1] SMP ARM\n  Modules linked in:\n  CPU: 0 PID: 0 Comm: swapper Not tainted 5.11.0+ #382\n  Hardware name: Generic DT based system\n  PC is at cpu_ca15_set_pte_ext+0x24/0x30\n  LR is at __set_fixmap+0xe4/0x118\n  pc : [\u003cc041ac9c\u003e]    lr : [\u003cc04189d8\u003e]    psr: 400000d3\n  sp : c1601ed8  ip : 00400000  fp : 00800000\n  r10: 0000071f  r9 : 00421000  r8 : 00c00000\n  r7 : 00c00000  r6 : 0000071f  r5 : ffade000  r4 : 4040171f\n  r3 : 00c00000  r2 : 4040171f  r1 : c041ac78  r0 : fc6006f0\n  Flags: nZcv  IRQs off  FIQs off  Mode SVC_32  ISA ARM  Segment none\n  Control: 30c5387d  Table: 40203000  DAC: 00000001\n  Process swapper (pid: 0, stack limit = 0x(ptrval))\n\nSo let\u0027s limit CONFIG_NR_CPUS to 16 when CONFIG_DEBUG_KMAP_LOCAL=y. Also,\nfix the BUILD_BUG_ON() check that was supposed to catch this, by checking\nwhether the region grows below the start address rather than above the end\naddress."
          }
        ]
      },
      "generator": {
        "engine": "bippy-1e70cc10feda"
      },
      "problemtype": {
        "problemtype_data": [
          {
            "description": [
              {
                "lang": "eng",
                "value": "n/a"
              }
            ]
          }
        ]
      },
      "references": {
        "reference_data": [
          {
            "name": "https://git.kernel.org/stable/c/5965ac11b1d5fcb38464728931649cd9df79c7c9",
            "refsource": "MISC",
            "url": "https://git.kernel.org/stable/c/5965ac11b1d5fcb38464728931649cd9df79c7c9"
          },
          {
            "name": "https://git.kernel.org/stable/c/d624833f5984d484c5e3196f34b926f9e71dafee",
            "refsource": "MISC",
            "url": "https://git.kernel.org/stable/c/d624833f5984d484c5e3196f34b926f9e71dafee"
          }
        ]
      }
    },
    "nvd.nist.gov": {
      "cve": {
        "configurations": [
          {
            "nodes": [
              {
                "cpeMatch": [
                  {
                    "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                    "matchCriteriaId": "3C5242B9-B5BD-4578-AD66-69DF59D54A14",
                    "versionEndExcluding": "5.11.16",
                    "versionStartIncluding": "5.11.0",
                    "vulnerable": true
                  }
                ],
                "negate": false,
                "operator": "OR"
              }
            ]
          }
        ],
        "descriptions": [
          {
            "lang": "en",
            "value": "In the Linux kernel, the following vulnerability has been resolved:\n\nARM: 9063/1: mm: reduce maximum number of CPUs if DEBUG_KMAP_LOCAL is enabled\n\nThe debugging code for kmap_local() doubles the number of per-CPU fixmap\nslots allocated for kmap_local(), in order to use half of them as guard\nregions. This causes the fixmap region to grow downwards beyond the start\nof its reserved window if the supported number of CPUs is large, and collide\nwith the newly added virtual DT mapping right below it, which is obviously\nnot good.\n\nOne manifestation of this is EFI boot on a kernel built with NR_CPUS=32\nand CONFIG_DEBUG_KMAP_LOCAL=y, which may pass the FDT in highmem, resulting\nin block entries below the fixmap region that the fixmap code misidentifies\nas fixmap table entries, and subsequently tries to dereference using a\nphys-to-virt translation that is only valid for lowmem. This results in a\ncryptic splat such as the one below.\n\n  ftrace: allocating 45548 entries in 89 pages\n  8\u003c--- cut here ---\n  Unable to handle kernel paging request at virtual address fc6006f0\n  pgd = (ptrval)\n  [fc6006f0] *pgd=80000040207003, *pmd=00000000\n  Internal error: Oops: a06 [#1] SMP ARM\n  Modules linked in:\n  CPU: 0 PID: 0 Comm: swapper Not tainted 5.11.0+ #382\n  Hardware name: Generic DT based system\n  PC is at cpu_ca15_set_pte_ext+0x24/0x30\n  LR is at __set_fixmap+0xe4/0x118\n  pc : [\u003cc041ac9c\u003e]    lr : [\u003cc04189d8\u003e]    psr: 400000d3\n  sp : c1601ed8  ip : 00400000  fp : 00800000\n  r10: 0000071f  r9 : 00421000  r8 : 00c00000\n  r7 : 00c00000  r6 : 0000071f  r5 : ffade000  r4 : 4040171f\n  r3 : 00c00000  r2 : 4040171f  r1 : c041ac78  r0 : fc6006f0\n  Flags: nZcv  IRQs off  FIQs off  Mode SVC_32  ISA ARM  Segment none\n  Control: 30c5387d  Table: 40203000  DAC: 00000001\n  Process swapper (pid: 0, stack limit = 0x(ptrval))\n\nSo let\u0027s limit CONFIG_NR_CPUS to 16 when CONFIG_DEBUG_KMAP_LOCAL=y. Also,\nfix the BUILD_BUG_ON() check that was supposed to catch this, by checking\nwhether the region grows below the start address rather than above the end\naddress."
          },
          {
            "lang": "es",
            "value": "En el kernel de Linux, se ha resuelto la siguiente vulnerabilidad: ARM: 9063/1: mm: reduce el n\u00famero m\u00e1ximo de CPU si DEBUG_KMAP_LOCAL est\u00e1 habilitado El c\u00f3digo de depuraci\u00f3n para kmap_local() duplica el n\u00famero de ranuras de mapas de reparaci\u00f3n por CPU asignadas para kmap_local() , para utilizar la mitad de ellos como regiones de guardia. Esto hace que la regi\u00f3n del mapa de arreglos crezca hacia abajo m\u00e1s all\u00e1 del inicio de su ventana reservada si la cantidad de CPU admitidas es grande, y colisiona con el mapeo de DT virtual reci\u00e9n agregado justo debajo, lo cual obviamente no es bueno. Una manifestaci\u00f3n de esto es el arranque EFI en un kernel creado con NR_CPUS=32 y CONFIG_DEBUG_KMAP_LOCAL=y, que puede pasar la FDT en highmem, lo que genera entradas de bloque debajo de la regi\u00f3n de fixmap que el c\u00f3digo de fixmap identifica err\u00f3neamente como entradas de la tabla de fixmap y, posteriormente, intenta desreferencia usando una traducci\u00f3n de phys a virt que solo es v\u00e1lida para lowmem. Esto da como resultado un s\u00edmbolo cr\u00edptico como el que se muestra a continuaci\u00f3n. ftrace: asignando 45548 entradas en 89 p\u00e1ginas 8\u0026lt;--- cortar aqu\u00ed --- No se puede manejar la solicitud de paginaci\u00f3n del kernel en la direcci\u00f3n virtual fc6006f0 pgd = (ptrval) [fc6006f0] *pgd=80000040207003, *pmd=00000000 Error interno: Ups: a06 [#1] M\u00f3dulos SMP ARM vinculados en: CPU: 0 PID: 0 Comm: swapper Not tainted 5.11.0+ #382 Nombre del hardware: Sistema gen\u00e9rico basado en DT La PC est\u00e1 en cpu_ca15_set_pte_ext+0x24/0x30 LR est\u00e1 en __set_fixmap+0xe4/ 0x118 pc: [] lr: [] psr: 400000d3 sp: c1601ed8 ip: 00400000 fp: 00800000 r10: 0000071f r9: 00421000 r8: 00c00000 r7: 00c00000 r6: 0000071f r5: ffade000 r4: 4040171f r3: 00c00000 r2: 4040171f r1: c041ac78 r0: fc6006f0 Banderas: nZcv IRQ desactivadas FIQ desactivadas Modo SVC_32 ISA ARM Segmento ninguno Control: 30c5387d Tabla: 40203000 DAC: 00000001 Intercambiador de procesos (pid: 0, l\u00edmite de pila = 0x(ptr) val)) As\u00ed que limitemos CONFIG_NR_CPUS a 16 cuando CONFIG_DEBUG_KMAP_LOCAL=y. Adem\u00e1s, corrija la verificaci\u00f3n BUILD_BUG_ON() que se supon\u00eda detectar\u00eda esto, verificando si la regi\u00f3n crece por debajo de la direcci\u00f3n inicial en lugar de por encima de la direcci\u00f3n final."
          }
        ],
        "id": "CVE-2021-46910",
        "lastModified": "2024-04-17T16:55:44.690",
        "metrics": {
          "cvssMetricV31": [
            {
              "cvssData": {
                "attackComplexity": "LOW",
                "attackVector": "LOCAL",
                "availabilityImpact": "HIGH",
                "baseScore": 5.5,
                "baseSeverity": "MEDIUM",
                "confidentialityImpact": "NONE",
                "integrityImpact": "NONE",
                "privilegesRequired": "LOW",
                "scope": "UNCHANGED",
                "userInteraction": "NONE",
                "vectorString": "CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H",
                "version": "3.1"
              },
              "exploitabilityScore": 1.8,
              "impactScore": 3.6,
              "source": "nvd@nist.gov",
              "type": "Primary"
            }
          ]
        },
        "published": "2024-02-27T07:15:07.307",
        "references": [
          {
            "source": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
            "tags": [
              "Patch"
            ],
            "url": "https://git.kernel.org/stable/c/5965ac11b1d5fcb38464728931649cd9df79c7c9"
          },
          {
            "source": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
            "tags": [
              "Patch"
            ],
            "url": "https://git.kernel.org/stable/c/d624833f5984d484c5e3196f34b926f9e71dafee"
          }
        ],
        "sourceIdentifier": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
        "vulnStatus": "Analyzed",
        "weaknesses": [
          {
            "description": [
              {
                "lang": "en",
                "value": "NVD-CWE-noinfo"
              }
            ],
            "source": "nvd@nist.gov",
            "type": "Primary"
          }
        ]
      }
    }
  }
}


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 seen somewhere by the user.
  • Confirmed: The vulnerability is confirmed from an analyst perspective.
  • Exploited: This vulnerability was exploited and seen by the user reporting the sighting.
  • Patched: This vulnerability was successfully patched by the user reporting the sighting.
  • Not exploited: This vulnerability was not exploited or seen by the user reporting the sighting.
  • Not confirmed: The user expresses doubt about the veracity of the vulnerability.
  • Not patched: This vulnerability was not successfully patched by the user reporting the sighting.