CVE-2023-53523 (GCVE-0-2023-53523)
Vulnerability from cvelistv5
Published
2025-10-01 11:46
Modified
2025-10-01 11:46
Severity ?
Summary
In the Linux kernel, the following vulnerability has been resolved: can: gs_usb: fix time stamp counter initialization If the gs_usb device driver is unloaded (or unbound) before the interface is shut down, the USB stack first calls the struct usb_driver::disconnect and then the struct net_device_ops::ndo_stop callback. In gs_usb_disconnect() all pending bulk URBs are killed, i.e. no more RX'ed CAN frames are send from the USB device to the host. Later in gs_can_close() a reset control message is send to each CAN channel to remove the controller from the CAN bus. In this race window the USB device can still receive CAN frames from the bus and internally queue them to be send to the host. At least in the current version of the candlelight firmware, the queue of received CAN frames is not emptied during the reset command. After loading (or binding) the gs_usb driver, new URBs are submitted during the struct net_device_ops::ndo_open callback and the candlelight firmware starts sending its already queued CAN frames to the host. However, this scenario was not considered when implementing the hardware timestamp function. The cycle counter/time counter infrastructure is set up (gs_usb_timestamp_init()) after the USBs are submitted, resulting in a NULL pointer dereference if timecounter_cyc2time() (via the call chain: gs_usb_receive_bulk_callback() -> gs_usb_set_timestamp() -> gs_usb_skb_set_timestamp()) is called too early. Move the gs_usb_timestamp_init() function before the URBs are submitted to fix this problem. For a comprehensive solution, we need to consider gs_usb devices with more than 1 channel. The cycle counter/time counter infrastructure is setup per channel, but the RX URBs are per device. Once gs_can_open() of _a_ channel has been called, and URBs have been submitted, the gs_usb_receive_bulk_callback() can be called for _all_ available channels, even for channels that are not running, yet. As cycle counter/time counter has not set up, this will again lead to a NULL pointer dereference. Convert the cycle counter/time counter from a "per channel" to a "per device" functionality. Also set it up, before submitting any URBs to the device. Further in gs_usb_receive_bulk_callback(), don't process any URBs for not started CAN channels, only resubmit the URB.
Impacted products
Vendor Product Version
Linux Linux Version: 45dfa45f52e66f8eee30a64b16550a9c47915044
Version: 45dfa45f52e66f8eee30a64b16550a9c47915044
Create a notification for this product.
   Linux Linux Version: 6.1
Create a notification for this product.
Show details on NVD website


{
  "containers": {
    "cna": {
      "affected": [
        {
          "defaultStatus": "unaffected",
          "product": "Linux",
          "programFiles": [
            "drivers/net/can/usb/gs_usb.c"
          ],
          "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
          "vendor": "Linux",
          "versions": [
            {
              "lessThan": "210a8cffc9c1b044281c0a868485c870c9c11374",
              "status": "affected",
              "version": "45dfa45f52e66f8eee30a64b16550a9c47915044",
              "versionType": "git"
            },
            {
              "lessThan": "5886e4d5ecec3e22844efed90b2dd383ef804b3a",
              "status": "affected",
              "version": "45dfa45f52e66f8eee30a64b16550a9c47915044",
              "versionType": "git"
            }
          ]
        },
        {
          "defaultStatus": "affected",
          "product": "Linux",
          "programFiles": [
            "drivers/net/can/usb/gs_usb.c"
          ],
          "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
          "vendor": "Linux",
          "versions": [
            {
              "status": "affected",
              "version": "6.1"
            },
            {
              "lessThan": "6.1",
              "status": "unaffected",
              "version": "0",
              "versionType": "semver"
            },
            {
              "lessThanOrEqual": "6.4.*",
              "status": "unaffected",
              "version": "6.4.7",
              "versionType": "semver"
            },
            {
              "lessThanOrEqual": "*",
              "status": "unaffected",
              "version": "6.5",
              "versionType": "original_commit_for_fix"
            }
          ]
        }
      ],
      "cpeApplicability": [
        {
          "nodes": [
            {
              "cpeMatch": [
                {
                  "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                  "versionEndExcluding": "6.4.7",
                  "versionStartIncluding": "6.1",
                  "vulnerable": true
                },
                {
                  "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                  "versionEndExcluding": "6.5",
                  "versionStartIncluding": "6.1",
                  "vulnerable": true
                }
              ],
              "negate": false,
              "operator": "OR"
            }
          ]
        }
      ],
      "descriptions": [
        {
          "lang": "en",
          "value": "In the Linux kernel, the following vulnerability has been resolved:\n\ncan: gs_usb: fix time stamp counter initialization\n\nIf the gs_usb device driver is unloaded (or unbound) before the\ninterface is shut down, the USB stack first calls the struct\nusb_driver::disconnect and then the struct net_device_ops::ndo_stop\ncallback.\n\nIn gs_usb_disconnect() all pending bulk URBs are killed, i.e. no more\nRX\u0027ed CAN frames are send from the USB device to the host. Later in\ngs_can_close() a reset control message is send to each CAN channel to\nremove the controller from the CAN bus. In this race window the USB\ndevice can still receive CAN frames from the bus and internally queue\nthem to be send to the host.\n\nAt least in the current version of the candlelight firmware, the queue\nof received CAN frames is not emptied during the reset command. After\nloading (or binding) the gs_usb driver, new URBs are submitted during\nthe struct net_device_ops::ndo_open callback and the candlelight\nfirmware starts sending its already queued CAN frames to the host.\n\nHowever, this scenario was not considered when implementing the\nhardware timestamp function. The cycle counter/time counter\ninfrastructure is set up (gs_usb_timestamp_init()) after the USBs are\nsubmitted, resulting in a NULL pointer dereference if\ntimecounter_cyc2time() (via the call chain:\ngs_usb_receive_bulk_callback() -\u003e gs_usb_set_timestamp() -\u003e\ngs_usb_skb_set_timestamp()) is called too early.\n\nMove the gs_usb_timestamp_init() function before the URBs are\nsubmitted to fix this problem.\n\nFor a comprehensive solution, we need to consider gs_usb devices with\nmore than 1 channel. The cycle counter/time counter infrastructure is\nsetup per channel, but the RX URBs are per device. Once gs_can_open()\nof _a_ channel has been called, and URBs have been submitted, the\ngs_usb_receive_bulk_callback() can be called for _all_ available\nchannels, even for channels that are not running, yet. As cycle\ncounter/time counter has not set up, this will again lead to a NULL\npointer dereference.\n\nConvert the cycle counter/time counter from a \"per channel\" to a \"per\ndevice\" functionality. Also set it up, before submitting any URBs to\nthe device.\n\nFurther in gs_usb_receive_bulk_callback(), don\u0027t process any URBs for\nnot started CAN channels, only resubmit the URB."
        }
      ],
      "providerMetadata": {
        "dateUpdated": "2025-10-01T11:46:09.632Z",
        "orgId": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
        "shortName": "Linux"
      },
      "references": [
        {
          "url": "https://git.kernel.org/stable/c/210a8cffc9c1b044281c0a868485c870c9c11374"
        },
        {
          "url": "https://git.kernel.org/stable/c/5886e4d5ecec3e22844efed90b2dd383ef804b3a"
        }
      ],
      "title": "can: gs_usb: fix time stamp counter initialization",
      "x_generator": {
        "engine": "bippy-1.2.0"
      }
    }
  },
  "cveMetadata": {
    "assignerOrgId": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
    "assignerShortName": "Linux",
    "cveId": "CVE-2023-53523",
    "datePublished": "2025-10-01T11:46:09.632Z",
    "dateReserved": "2025-10-01T11:39:39.407Z",
    "dateUpdated": "2025-10-01T11:46:09.632Z",
    "state": "PUBLISHED"
  },
  "dataType": "CVE_RECORD",
  "dataVersion": "5.1",
  "vulnerability-lookup:meta": {
    "nvd": "{\"cve\":{\"id\":\"CVE-2023-53523\",\"sourceIdentifier\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\",\"published\":\"2025-10-01T12:15:56.747\",\"lastModified\":\"2025-10-02T19:11:46.753\",\"vulnStatus\":\"Awaiting Analysis\",\"cveTags\":[],\"descriptions\":[{\"lang\":\"en\",\"value\":\"In the Linux kernel, the following vulnerability has been resolved:\\n\\ncan: gs_usb: fix time stamp counter initialization\\n\\nIf the gs_usb device driver is unloaded (or unbound) before the\\ninterface is shut down, the USB stack first calls the struct\\nusb_driver::disconnect and then the struct net_device_ops::ndo_stop\\ncallback.\\n\\nIn gs_usb_disconnect() all pending bulk URBs are killed, i.e. no more\\nRX\u0027ed CAN frames are send from the USB device to the host. Later in\\ngs_can_close() a reset control message is send to each CAN channel to\\nremove the controller from the CAN bus. In this race window the USB\\ndevice can still receive CAN frames from the bus and internally queue\\nthem to be send to the host.\\n\\nAt least in the current version of the candlelight firmware, the queue\\nof received CAN frames is not emptied during the reset command. After\\nloading (or binding) the gs_usb driver, new URBs are submitted during\\nthe struct net_device_ops::ndo_open callback and the candlelight\\nfirmware starts sending its already queued CAN frames to the host.\\n\\nHowever, this scenario was not considered when implementing the\\nhardware timestamp function. The cycle counter/time counter\\ninfrastructure is set up (gs_usb_timestamp_init()) after the USBs are\\nsubmitted, resulting in a NULL pointer dereference if\\ntimecounter_cyc2time() (via the call chain:\\ngs_usb_receive_bulk_callback() -\u003e gs_usb_set_timestamp() -\u003e\\ngs_usb_skb_set_timestamp()) is called too early.\\n\\nMove the gs_usb_timestamp_init() function before the URBs are\\nsubmitted to fix this problem.\\n\\nFor a comprehensive solution, we need to consider gs_usb devices with\\nmore than 1 channel. The cycle counter/time counter infrastructure is\\nsetup per channel, but the RX URBs are per device. Once gs_can_open()\\nof _a_ channel has been called, and URBs have been submitted, the\\ngs_usb_receive_bulk_callback() can be called for _all_ available\\nchannels, even for channels that are not running, yet. As cycle\\ncounter/time counter has not set up, this will again lead to a NULL\\npointer dereference.\\n\\nConvert the cycle counter/time counter from a \\\"per channel\\\" to a \\\"per\\ndevice\\\" functionality. Also set it up, before submitting any URBs to\\nthe device.\\n\\nFurther in gs_usb_receive_bulk_callback(), don\u0027t process any URBs for\\nnot started CAN channels, only resubmit the URB.\"}],\"metrics\":{},\"references\":[{\"url\":\"https://git.kernel.org/stable/c/210a8cffc9c1b044281c0a868485c870c9c11374\",\"source\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\"},{\"url\":\"https://git.kernel.org/stable/c/5886e4d5ecec3e22844efed90b2dd383ef804b3a\",\"source\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\"}]}}"
  }
}


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.


Loading…