CVE-2025-68343: GS_USB CAN driver fix stops kernel memory corruption

  • Thread Author
A subtle but consequential flaw in the Linux kernel’s GS_USB CAN driver has been assigned CVE-2025-68343 after maintainers fixed a missing length check in the gs_usb_receive_bulk_callback handler. The bug allowed the driver to assume a full header was present in an incoming USB bulk transfer when, in some cases, the transfer was shorter than expected — creating a path to kernel memory corruption, crashes, and other reliability failures for systems that handle GS_USB-based CAN devices. Patches were posted to the kernel mailing lists in November 2025 and the public CVE entry was created in late December 2025; downstream distributions have been issuing kernel updates at different cadences, so administrators must verify their specific kernel builds and update timelines immediately.

Neon teal Linux kernel boundary diagram with code blocks and a penguin shield.Background​

The GS_USB driver (drivers/net/can/usb/gs_usb.c) supports a family of USB-connected CAN (Controller Area Network) adapters. Those devices present CAN frames over USB using a kernel-side parser that expects a well-formed gs_host_frame structure in each USB bulk transfer. The driver’s receive callback takes incoming URBs and unpacks the header and payload to create network sk_buffs that are pushed up the CAN stack.
The root cause of CVE-2025-68343 is a missing bounds check: the callback assumed the received URB contained at least the header portion of the gs_host_frame before reading header fields. When the actual_length (the amount of data actually delivered by the USB transfer) was smaller than the expected header size, the driver dereferenced fields inside the header that were not present in the buffer. The maintainers also corrected a secondary pointer dereference issue related to how the code resubmitted URBs: it used dev->parent->hf_size_rx in one place even though urb->context already contained a reliable parent pointer.
In short: an insufficient validation of actual_length combined with an improper pointer use created a kernel-side memory-safety bug. The upstream fixes add explicit minimum-length checks and refactor how the header is described and accessed.

Why this matters: technical overview​

The problematic pattern​

When processing USB bulk transfers, kernel drivers must never assume the host delivered the full payload. USB transfers can be truncated, malformed, or intentionally crafted by a malicious USB endpoint (or malware on a host acting as a device emulator). The gs_usb driver previously:
  • Treated the incoming buffer as if a full gs_host_frame header was present.
  • Accessed header fields immediately without verifying actual_length >= sizeof(header).
  • Used a pointer chain involving dev->parent when resubmitting URBs, which can be undefined if the buffer is too short.
That sequence allows a few practical failure modes:
  • Out-of-bounds reads: reading past the end of the URB buffer into unrelated memory.
  • Kernel crashes: dereferencing pointers that are not valid in the context of a short URB can trigger oops/panic.
  • Potential memory-corruption: depending on subsequent copies or pointer math, malformed lengths may cause copying of attacker-controlled data into kernel buffers in ways that corrupt kernel state.

Concrete fixes applied upstream​

Upstream patches introduced three important changes:
  • Replace the ad-hoc header access with a declared header using struct_group (a helper used to express that a structure contains a header followed by variable content). This makes it clearer what constitutes the header portion.
  • Add a helper (named gs_usb_get_minimum_length in the patch series) that computes the minimum number of bytes that must be present for the current frame, considering flags and device features (for example, whether timestamps or extra metadata are present).
  • Check actual_length against the computed minimum before accessing any header members; only copy the amount of payload that was actually received into sk_buffs.
  • When resubmitting URBs, stop using the device pointer chain that can be invalid for short URBs and instead access the parent pointer embedded in urb->context; this avoids dereferencing dev when it may not be available.
These changes convert an unchecked assumption into explicit validation and make the callback resilient to truncation.

Attack surface and exploitability​

Local vs. remote​

This vulnerability is a kernel driver input validation problem tied to USB transfers and therefore has a constrained attack surface:
  • Exploitation requires the attacker to present a malicious or malformed USB bulk transfer to the host’s GS_USB driver. Practically, that means either:
  • The attacker has local physical access and can plug in a malicious USB CAN device, or
  • The attacker has software-level control over a device that enumerates as a GS_USB-capable device (for instance, a compromised microcontroller acting as a USB device).
  • It is not a purely network-exposed remote attack where an unauthenticated remote actor on the internet can trigger the flaw without some form of device-level access.
Consequently, the most realistic threat scenarios are physical access or supply-chain/firmware compromises of devices that present suspicious USB descriptors. For systems that accept USB devices from untrusted sources (workstations, edge equipment, or test benches), the risk is meaningful; for locked-down servers without USB device access, the risk is lower.

Impact types​

The bug can lead to a range of impacts depending on precise conditions and system configuration:
  • Denial-of-service: kernel oops/panic or network stack corruption leading to service interruption.
  • Memory-corruption leading to escalation: in theory, crafted transfers could be leveraged to write or overwrite kernel memory paths that lead to privilege escalation or code execution. The difficulty of reliably exploiting such a path depends on kernel mitigations (KASLR, SMEP/SMAP, KCFI, kernel hardening features) and the exact copy logic in the driver.
  • Data corruption or mis-delivery of CAN frames: on production equipment that relies on CAN messages (automotive, industrial control), malformed frames could corrupt device state or mislead connected systems.

Difficulty and prerequisites​

Based on the nature of the fix and public disclosure details, exploitation would likely require:
  • Ability to present custom USB bulk packets to the GS_USB endpoint.
  • Precise construction of malformed payloads that cause the driver to access missing header fields or to trigger the pointer-dereference bug while surviving any sanity checks.
  • Circumventing kernel protection mechanisms in modern kernels to transform memory corruption into code execution (nontrivial).
For that reason many vendors and trackers categorize the flaw as requiring local access and being non-trivial to weaponize remotely, even though the underlying memory-safety bug is serious enough to merit a moderate-to-high severity score in practice.

Severity and scoring — inconsistent public numbers​

Public sources disagree slightly on severity metrics, and the NVD entry was still being enriched at the time of disclosure. Examples of observed scoring differences:
  • Some downstream trackers assigned a CVSSv3 score around the mid-6 to 7 range with a Local attack vector and Low privileges required, reflecting that a local unprivileged user/device could trigger significant integrity/availability impact.
  • Other vendors use different scoring assumptions (for example, treating attack complexity as higher or assuming partial impact), which has led to scores that differ by a point or more.
Administrators should therefore treat the severity as serious rather than dismissible — the kernel-level memory-safety nature of the bug means it can cause immediate crashes and, under some conditions, higher impact. Because scoring varies, rely on concrete technical controls (device access policy and timely kernel updates) rather than a single numeric score.

Timeline and upstream response (verified snapshots)​

  • Mid-November 2025: Patch series addressing gs_usb_receive_bulk_callback issues were posted to Linux kernel mailing lists. Patches refactor header handling and add minimum-length checks in the receive callback.
  • Late November 2025: The patches were discussed and iterated on in netdev/linux-kernel lists; maintainers signed off on corrected versions.
  • Late December 2025: The issue was assigned CVE-2025-68343 and appearing in public trackers. Stable-kernel patches were folded into the kernel stable trees and propagated into distribution update queues over subsequent weeks.
Note: exact commit IDs and the stable merge points vary; administrators should check their kernel’s changelog for "gs_usb" or the specific commit message text to confirm whether a given kernel tree includes the fix.

Which distributions and kernels are affected​

Distribution-level status varies because the fix depends on the kernel branch and the distribution’s update cadence. In general:
  • Older LTS kernels that still include the vulnerable gs_usb code are potentially affected until a backported patch is applied.
  • Many rolling or rapidly updated distributions incorporated the upstream stable fix into their kernel packages within days to weeks of upstream patches.
  • Some enterprise or long-term-support LTS kernels require explicit backport patches; check vendor advisories for the specific kernel-version-to-fix mapping.
System administrators must verify the exact kernel package version shipped by their distribution. The most reliable approach is to inspect your running kernel version and the kernel changelog for the gs_usb-specific commit or to consult the vendor’s security advisory portal for CVE-2025-68343.

Mitigation and remediation​

Immediate practical steps for administrators and device operators:
  • Patch the kernel: apply the vendor-supplied kernel update that includes the gs_usb fixes. This is the recommended and complete remediation.
  • If a kernel update is not immediately available, implement mitigation controls:
  • Disable automatic acceptance of untrusted USB devices where possible; enforce device whitelisting using local policy or udev rules.
  • For systems that do not need USB CAN adapters, blacklist the gs_usb module to prevent it from binding:
  • Add a line such as "blacklist gs_usb" to your modprobe configuration (distribution-dependent). This avoids loading the driver until patched, but it also disables GS_USB devices entirely.
  • For containerized or virtualized environments, restrict device passthrough of USB devices to only trusted VMs/containers.
  • Limit physical access: enforce strict USB device policies, especially on endpoints that interface with hardware buses or industrial control systems.
  • If logging is available, monitor for kernel oops, repeated driver errors, or unusual USB connectivity events that could indicate attempts to trigger this code path.
Note: Blacklisting or unloading the module is a functional workaround but not a substitute for a patch if GS_USB devices are required for normal operation.

Responsible disclosure and public coordination​

The upstream maintainers and the author of the fix followed the typical Linux kernel patch-and-review process: a patch series was posted to public mailing lists, iterated on after review, and eventually merged into the stable trees. The CVE was assigned after the fix was available in upstream repositories, and downstream distributions began issuing updates. This chain — patch, review, stable merge, CVE assignment, and distribution patches — is the appropriate flow for kernel-level issues where backports and vendor release cycles matter.
Because distribution timelines vary and some systems delay kernel updates (embedded appliances, long-lived industrial controllers), the window of exposure for particular fleets can be large. Operators of such systems should prioritize checking vendor advisories and scheduling kernel updates or applying established mitigations.

Practical mitigation checklist (for sysadmins)​

  • Verify: Determine if your running kernel contains the fix by searching the kernel changelog for gs_usb commits or by checking vendor advisories for CVE-2025-68343.
  • Patch: Apply the vendor-supplied kernel update that includes the gs_usb fixes.
  • Mitigate if necessary:
  • Temporarily blacklist gs_usb if device usage permits.
  • Enforce device whitelisting via udev or endpoint security tools.
  • Restrict USB device passthrough on VMs and containers.
  • Monitor: Watch kernel logs for oopses or unexpected driver behavior and set up alerts for repeated USB errors.
  • Document: For regulated environments, log the decision and the timeline of mitigation and patch deployment as part of your change-control record.

Risk analysis for different environments​

  • Desktop workstations (general-purpose, physically accessible): High priority to patch. Users often plug in unvetted devices; local USB threats are realistic.
  • Developer/test benches that use USB CAN adapters: Very high priority. These systems frequently enumerate devices and may interact with untrusted hardware.
  • Data-center servers with no USB device use and with USB ports physically blocked: Lower immediate risk; still recommended to patch when feasible, but risk of exploitation is much lower.
  • Embedded or industrial controllers that rely on GS_USB devices: Very high priority. Production instability or misinterpreted CAN frames can have safety and reliability consequences.
  • Cloud instances (no USB device access): Not affected unless vendor exposes USB passthrough features; typically low risk.

Why this class of bug is important beyond this single CVE​

This vulnerability is a textbook example of how a single unchecked length can create kernel-level instability. It underscores several broader points:
  • Kernel drivers must treat all device input as untrusted. USB, like any bus, can present truncated or malformed transfers.
  • Even mature drivers with long histories may accumulate assumptions that are brittle when unusual semantics or error conditions occur.
  • The process of expressing header layout (struct_group and related idioms) and computing exact minimum lengths for variable-length frames reduces the chance of similar bugs.
  • Distribution lifecycles and backport policies determine how fast such fixes reach production systems — so device owners must monitor vendor advisories actively.

Conclusion​

CVE-2025-68343 is a serious but addressable kernel vulnerability in the GS_USB CAN driver that results from a missing check of actual_length before accessing frame headers. The upstream community has applied precise fixes: expressing the header cleanly, computing minimum required lengths, and avoiding unsafe pointer dereferences when URBs are too short. The practical attack window requires local or device-level access, which reduces mass-remote-exploit risk, but the presence of a kernel memory-safety bug means this issue must be prioritized for patching — particularly on machines that accept USB devices from untrusted sources or on embedded systems using GS_USB adapters.
Administrators should verify their kernel versions against vendor advisories, apply patches promptly, and use temporary mitigations (module blacklisting, device whitelisting, physical port controls) where immediate patching is not possible. The incident also serves as a reminder that rigorous input validation and explicit length checks are non-negotiable requirements for kernel drivers that touch the hardware boundary.

Source: MSRC Security Update Guide - Microsoft Security Response Center
 

Back
Top