cve-2024-35825
Vulnerability from cvelistv5
Published
2024-05-17 13:27
Modified
2024-09-11 17:33
Severity
Summary
usb: gadget: ncm: Fix handling of zero block length packets
Impacted products
VendorProduct
LinuxLinux
LinuxLinux
Show details on NVD website


{
  "containers": {
    "adp": [
      {
        "providerMetadata": {
          "dateUpdated": "2024-08-02T03:21:47.690Z",
          "orgId": "af854a3a-2127-422b-91ae-364da2661108",
          "shortName": "CVE"
        },
        "references": [
          {
            "tags": [
              "x_transferred"
            ],
            "url": "https://git.kernel.org/stable/c/e2dbfea520e60d58e0c498ba41bde10452257779"
          },
          {
            "tags": [
              "x_transferred"
            ],
            "url": "https://git.kernel.org/stable/c/a766761d206e7c36d7526e0ae749949d17ca582c"
          },
          {
            "tags": [
              "x_transferred"
            ],
            "url": "https://git.kernel.org/stable/c/ef846cdbd100f7f9dc045e8bcd7fe4b3a3713c03"
          },
          {
            "tags": [
              "x_transferred"
            ],
            "url": "https://git.kernel.org/stable/c/92b051b87658df7649ffcdef522593f21a2b296b"
          },
          {
            "tags": [
              "x_transferred"
            ],
            "url": "https://git.kernel.org/stable/c/7664ee8bd80309b90d53488b619764f0a057f2b7"
          },
          {
            "tags": [
              "x_transferred"
            ],
            "url": "https://git.kernel.org/stable/c/a0f77b5d6067285b8eca0ee3bd1e448a6258026f"
          },
          {
            "tags": [
              "x_transferred"
            ],
            "url": "https://git.kernel.org/stable/c/6b2c73111a252263807b7598682663dc33aa4b4c"
          },
          {
            "tags": [
              "x_transferred"
            ],
            "url": "https://git.kernel.org/stable/c/f90ce1e04cbcc76639d6cba0fdbd820cd80b3c70"
          },
          {
            "tags": [
              "x_transferred"
            ],
            "url": "https://lists.debian.org/debian-lts-announce/2024/06/msg00017.html"
          },
          {
            "tags": [
              "x_transferred"
            ],
            "url": "https://lists.debian.org/debian-lts-announce/2024/06/msg00020.html"
          }
        ],
        "title": "CVE Program Container"
      },
      {
        "metrics": [
          {
            "other": {
              "content": {
                "id": "CVE-2024-35825",
                "options": [
                  {
                    "Exploitation": "none"
                  },
                  {
                    "Automatable": "no"
                  },
                  {
                    "Technical Impact": "partial"
                  }
                ],
                "role": "CISA Coordinator",
                "timestamp": "2024-09-10T15:42:28.954371Z",
                "version": "2.0.3"
              },
              "type": "ssvc"
            }
          }
        ],
        "providerMetadata": {
          "dateUpdated": "2024-09-11T17:33:21.446Z",
          "orgId": "134c704f-9b21-4f2e-91b3-4a467353bcc0",
          "shortName": "CISA-ADP"
        },
        "title": "CISA ADP Vulnrichment"
      }
    ],
    "cna": {
      "affected": [
        {
          "defaultStatus": "unaffected",
          "product": "Linux",
          "programFiles": [
            "drivers/usb/gadget/function/f_ncm.c"
          ],
          "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
          "vendor": "Linux",
          "versions": [
            {
              "lessThan": "e2dbfea520e6",
              "status": "affected",
              "version": "ff3ba016263e",
              "versionType": "git"
            },
            {
              "lessThan": "a766761d206e",
              "status": "affected",
              "version": "e7ca00f35d8a",
              "versionType": "git"
            },
            {
              "lessThan": "ef846cdbd100",
              "status": "affected",
              "version": "17c653d4913b",
              "versionType": "git"
            },
            {
              "lessThan": "92b051b87658",
              "status": "affected",
              "version": "7014807fb7ef",
              "versionType": "git"
            },
            {
              "lessThan": "7664ee8bd803",
              "status": "affected",
              "version": "49fbc18378ae",
              "versionType": "git"
            },
            {
              "lessThan": "a0f77b5d6067",
              "status": "affected",
              "version": "427694cfaafa",
              "versionType": "git"
            },
            {
              "lessThan": "6b2c73111a25",
              "status": "affected",
              "version": "427694cfaafa",
              "versionType": "git"
            },
            {
              "lessThan": "f90ce1e04cbc",
              "status": "affected",
              "version": "427694cfaafa",
              "versionType": "git"
            }
          ]
        },
        {
          "defaultStatus": "affected",
          "product": "Linux",
          "programFiles": [
            "drivers/usb/gadget/function/f_ncm.c"
          ],
          "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
          "vendor": "Linux",
          "versions": [
            {
              "status": "affected",
              "version": "6.6"
            },
            {
              "lessThan": "6.6",
              "status": "unaffected",
              "version": "0",
              "versionType": "custom"
            },
            {
              "lessThanOrEqual": "4.19.*",
              "status": "unaffected",
              "version": "4.19.312",
              "versionType": "custom"
            },
            {
              "lessThanOrEqual": "5.4.*",
              "status": "unaffected",
              "version": "5.4.274",
              "versionType": "custom"
            },
            {
              "lessThanOrEqual": "5.10.*",
              "status": "unaffected",
              "version": "5.10.215",
              "versionType": "custom"
            },
            {
              "lessThanOrEqual": "5.15.*",
              "status": "unaffected",
              "version": "5.15.154",
              "versionType": "custom"
            },
            {
              "lessThanOrEqual": "6.1.*",
              "status": "unaffected",
              "version": "6.1.84",
              "versionType": "custom"
            },
            {
              "lessThanOrEqual": "6.6.*",
              "status": "unaffected",
              "version": "6.6.24",
              "versionType": "custom"
            },
            {
              "lessThanOrEqual": "6.7.*",
              "status": "unaffected",
              "version": "6.7.12",
              "versionType": "custom"
            },
            {
              "lessThanOrEqual": "*",
              "status": "unaffected",
              "version": "6.8",
              "versionType": "original_commit_for_fix"
            }
          ]
        }
      ],
      "descriptions": [
        {
          "lang": "en",
          "value": "In the Linux kernel, the following vulnerability has been resolved:\n\nusb: gadget: ncm: Fix handling of zero block length packets\n\nWhile connecting to a Linux host with CDC_NCM_NTB_DEF_SIZE_TX\nset to 65536, it has been observed that we receive short packets,\nwhich come at interval of 5-10 seconds sometimes and have block\nlength zero but still contain 1-2 valid datagrams present.\n\nAccording to the NCM spec:\n\n\"If wBlockLength = 0x0000, the block is terminated by a\nshort packet. In this case, the USB transfer must still\nbe shorter than dwNtbInMaxSize or dwNtbOutMaxSize. If\nexactly dwNtbInMaxSize or dwNtbOutMaxSize bytes are sent,\nand the size is a multiple of wMaxPacketSize for the\ngiven pipe, then no ZLP shall be sent.\n\nwBlockLength= 0x0000 must be used with extreme care, because\nof the possibility that the host and device may get out of\nsync, and because of test issues.\n\nwBlockLength = 0x0000 allows the sender to reduce latency by\nstarting to send a very large NTB, and then shortening it when\nthe sender discovers that there\u2019s not sufficient data to justify\nsending a large NTB\"\n\nHowever, there is a potential issue with the current implementation,\nas it checks for the occurrence of multiple NTBs in a single\ngiveback by verifying if the leftover bytes to be processed is zero\nor not. If the block length reads zero, we would process the same\nNTB infintely because the leftover bytes is never zero and it leads\nto a crash. Fix this by bailing out if block length reads zero."
        }
      ],
      "providerMetadata": {
        "dateUpdated": "2024-05-29T05:29:39.054Z",
        "orgId": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
        "shortName": "Linux"
      },
      "references": [
        {
          "url": "https://git.kernel.org/stable/c/e2dbfea520e60d58e0c498ba41bde10452257779"
        },
        {
          "url": "https://git.kernel.org/stable/c/a766761d206e7c36d7526e0ae749949d17ca582c"
        },
        {
          "url": "https://git.kernel.org/stable/c/ef846cdbd100f7f9dc045e8bcd7fe4b3a3713c03"
        },
        {
          "url": "https://git.kernel.org/stable/c/92b051b87658df7649ffcdef522593f21a2b296b"
        },
        {
          "url": "https://git.kernel.org/stable/c/7664ee8bd80309b90d53488b619764f0a057f2b7"
        },
        {
          "url": "https://git.kernel.org/stable/c/a0f77b5d6067285b8eca0ee3bd1e448a6258026f"
        },
        {
          "url": "https://git.kernel.org/stable/c/6b2c73111a252263807b7598682663dc33aa4b4c"
        },
        {
          "url": "https://git.kernel.org/stable/c/f90ce1e04cbcc76639d6cba0fdbd820cd80b3c70"
        },
        {
          "url": "https://lists.debian.org/debian-lts-announce/2024/06/msg00017.html"
        },
        {
          "url": "https://lists.debian.org/debian-lts-announce/2024/06/msg00020.html"
        }
      ],
      "title": "usb: gadget: ncm: Fix handling of zero block length packets",
      "x_generator": {
        "engine": "bippy-a5840b7849dd"
      }
    }
  },
  "cveMetadata": {
    "assignerOrgId": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
    "assignerShortName": "Linux",
    "cveId": "CVE-2024-35825",
    "datePublished": "2024-05-17T13:27:28.914Z",
    "dateReserved": "2024-05-17T12:19:12.347Z",
    "dateUpdated": "2024-09-11T17:33:21.446Z",
    "state": "PUBLISHED"
  },
  "dataType": "CVE_RECORD",
  "dataVersion": "5.1",
  "meta": {
    "nvd": "{\"cve\":{\"id\":\"CVE-2024-35825\",\"sourceIdentifier\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\",\"published\":\"2024-05-17T14:15:18.227\",\"lastModified\":\"2024-06-27T12:15:25.373\",\"vulnStatus\":\"Awaiting Analysis\",\"descriptions\":[{\"lang\":\"en\",\"value\":\"In the Linux kernel, the following vulnerability has been resolved:\\n\\nusb: gadget: ncm: Fix handling of zero block length packets\\n\\nWhile connecting to a Linux host with CDC_NCM_NTB_DEF_SIZE_TX\\nset to 65536, it has been observed that we receive short packets,\\nwhich come at interval of 5-10 seconds sometimes and have block\\nlength zero but still contain 1-2 valid datagrams present.\\n\\nAccording to the NCM spec:\\n\\n\\\"If wBlockLength = 0x0000, the block is terminated by a\\nshort packet. In this case, the USB transfer must still\\nbe shorter than dwNtbInMaxSize or dwNtbOutMaxSize. If\\nexactly dwNtbInMaxSize or dwNtbOutMaxSize bytes are sent,\\nand the size is a multiple of wMaxPacketSize for the\\ngiven pipe, then no ZLP shall be sent.\\n\\nwBlockLength= 0x0000 must be used with extreme care, because\\nof the possibility that the host and device may get out of\\nsync, and because of test issues.\\n\\nwBlockLength = 0x0000 allows the sender to reduce latency by\\nstarting to send a very large NTB, and then shortening it when\\nthe sender discovers that there\u2019s not sufficient data to justify\\nsending a large NTB\\\"\\n\\nHowever, there is a potential issue with the current implementation,\\nas it checks for the occurrence of multiple NTBs in a single\\ngiveback by verifying if the leftover bytes to be processed is zero\\nor not. If the block length reads zero, we would process the same\\nNTB infintely because the leftover bytes is never zero and it leads\\nto a crash. Fix this by bailing out if block length reads zero.\"},{\"lang\":\"es\",\"value\":\"En el kernel de Linux, se ha resuelto la siguiente vulnerabilidad: usb: gadget: ncm: corregido el manejo de paquetes de longitud de bloque cero Al conectarnos a un host Linux con CDC_NCM_NTB_DEF_SIZE_TX configurado en 65536, se ha observado que recibimos paquetes cortos, que vienen en intervalo de 5 a 10 segundos a veces y tiene una longitud de bloque cero, pero a\u00fan contiene 1 o 2 datagramas v\u00e1lidos presentes. Seg\u00fan la especificaci\u00f3n NCM: \\\"Si wBlockLength = 0x0000, el bloque finaliza con un paquete corto. En este caso, la transferencia USB a\u00fan debe ser m\u00e1s corta que dwNtbInMaxSize o dwNtbOutMaxSize. Si se env\u00edan exactamente bytes dwNtbInMaxSize o dwNtbOutMaxSize, y el tama\u00f1o es un m\u00faltiplo de wMaxPacketSize para la pipe dada, entonces no se enviar\u00e1 ning\u00fan ZLP. wBlockLength= 0x0000 debe usarse con extremo cuidado, debido a la posibilidad de que el host y el dispositivo no est\u00e9n sincronizados y debido a problemas de prueba con wBlockLength = 0x0000. permite al remitente reducir la latencia comenzando a enviar un NTB muy grande y luego acort\u00e1ndolo cuando el remitente descubre que no hay datos suficientes para justificar el env\u00edo de un NTB grande\\\". Sin embargo, existe un problema potencial con la implementaci\u00f3n actual, ya que verifica para la aparici\u00f3n de m\u00faltiples NTB en una sola devoluci\u00f3n verificando si los bytes sobrantes a procesar son cero o no. Si la longitud del bloque es cero, procesar\u00edamos el mismo NTB infinitamente porque los bytes sobrantes nunca son cero y provocan un bloqueo. Solucione este problema rescatando si la longitud del bloque es cero.\"}],\"metrics\":{},\"references\":[{\"url\":\"https://git.kernel.org/stable/c/6b2c73111a252263807b7598682663dc33aa4b4c\",\"source\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\"},{\"url\":\"https://git.kernel.org/stable/c/7664ee8bd80309b90d53488b619764f0a057f2b7\",\"source\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\"},{\"url\":\"https://git.kernel.org/stable/c/92b051b87658df7649ffcdef522593f21a2b296b\",\"source\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\"},{\"url\":\"https://git.kernel.org/stable/c/a0f77b5d6067285b8eca0ee3bd1e448a6258026f\",\"source\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\"},{\"url\":\"https://git.kernel.org/stable/c/a766761d206e7c36d7526e0ae749949d17ca582c\",\"source\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\"},{\"url\":\"https://git.kernel.org/stable/c/e2dbfea520e60d58e0c498ba41bde10452257779\",\"source\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\"},{\"url\":\"https://git.kernel.org/stable/c/ef846cdbd100f7f9dc045e8bcd7fe4b3a3713c03\",\"source\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\"},{\"url\":\"https://git.kernel.org/stable/c/f90ce1e04cbcc76639d6cba0fdbd820cd80b3c70\",\"source\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\"},{\"url\":\"https://lists.debian.org/debian-lts-announce/2024/06/msg00017.html\",\"source\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\"},{\"url\":\"https://lists.debian.org/debian-lts-announce/2024/06/msg00020.html\",\"source\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\"}]}}"
  }
}


Log in or create an account to share your comment.




Tags
Taxonomy of the tags.


Loading...

Loading...