CVE-2024-36016: tty: n_gsm: fix possible out-of-bounds in gsm0_receive()
In the Linux kernel, the following vulnerability has been resolved:
tty: n_gsm: fix possible out-of-bounds in gsm0_receive()
Assuming the following:
- side A configures the n_gsm in basic option mode
- side B sends the header of a basic option mode frame with data length 1
- side A switches to advanced option mode
- side B sends 2 data bytes which exceeds gsm->len
Reason: gsm->len is not used in advanced option mode.
- side A switches to basic option mode
- side B keeps sending until gsm0_receive() writes past gsm->buf
Reason: Neither gsm->state nor gsm->len have been reset after
reconfiguration.
Fix this by changing gsm->count to gsm->len comparison from equal to less
than. Also add upper limit checks against the constant MAX_MRU in
gsm0_receive() and gsm1_receive() to harden against memory corruption of
gsm->len and gsm->mru.
All other checks remain as we still need to limit the data according to the
user configuration and actual payload size.
Security readout for executives and security teams
Plain-English summary
A flaw in Linux's n_gsm TTY line discipline can cause kernel memory corruption when frame-mode reconfiguration leaves stale length and state values. Successful abuse could compromise confidentiality, integrity, or availability. Severity is high, but exposure depends on local access and n_gsm availability or use; the supplied evidence does not show active exploitation.
Executive priority
Prioritize Linux systems using n_gsm or permitting untrusted local users to configure relevant TTY functionality. Apply supported kernel updates promptly. Systems without this exposure can follow normal kernel patching urgency rather than emergency incident response because active exploitation is not evidenced.
Technical view
Switching from basic to advanced and back to basic framing does not reset gsm->state and gsm->len. Continued input can make gsm0_receive() write beyond gsm->buf. The fix tightens the count-versus-length check and adds MAX_MRU bounds in gsm0_receive() and gsm1_receive(). CVSS 3.1 is 7.8: local, low-complexity, low-privilege, no-interaction exploitation with high potential impact.
Likely exposure
Exposure is limited to Linux systems where the n_gsm TTY line discipline is present and configurable. The CVSS vector requires local access and low privileges. The described trigger also depends on crafted frame input and switching between basic and advanced modes. Confirm exact distribution package status with the relevant vendor.
Exploitation context
The bundle marks KEV false, and no supplied source establishes active exploitation. The required local access and n_gsm-specific conditions reduce broad remote exposure, but successful kernel memory corruption could produce serious system compromise or disruption. Public proof-of-concept availability is not established by the supplied evidence.
Researcher notes
The correction addresses stale parser state across mode reconfiguration and adds independent MAX_MRU safety bounds. The supplied affected-version data is not clear enough for reliable version-only classification, particularly across backported distribution kernels. Validate using vendor package advisories, changelogs, or fix-commit presence. The bundle identifies CWE-125, while its technical description explicitly includes an out-of-bounds write.
Mitigation direction
Install a vendor-supported kernel update containing the CVE-2024-36016 fix, then reboot into the updated kernel.
Confirm vendor advisories for each kernel branch; do not infer patch status solely from the displayed version.
Prioritize systems where n_gsm is deployed or accessible to low-privileged local users.
If patching is delayed, seek vendor-approved exposure-reduction guidance; the supplied sources name no standalone workaround.
Validation and detection
Record the running kernel version and distribution package release on every potentially exposed Linux system.
Determine whether n_gsm is present, deployed, or available to low-privileged local users.
Verify the installed package includes the relevant upstream fix or an equivalent vendor backport.
After rebooting, confirm the running kernel matches the patched package.
Generated from the cited source records. This long-tail analysis has not been individually reviewed by a named human.
Potential ATT&CK relevance
Conservative CVE-to-ATT&CK context
These mappings and lookup hints may be relevant to the vulnerability behavior, CWE, affected product, or exposure path. Glexia-inferred context is not an official MITRE, ATT&CK, CWE, or CVE Program mapping.
ATT&CK lookup starting points
Use these exact CWE pages and searches to review the Glexia ATT&CK library from this CVE's weakness and description context.
cwe · low confidence lookup
CWE-125: Exact CWE lookup
Use the exact CWE identifier as the starting point before reviewing related ATT&CK behavior. Open the exact CWE lookup page first, then review the ATT&CK searches from that MITRE weakness context. This is a Glexia lookup hint, not an official ATT&CK mapping.
These fields come from the CVE record and ADP containers, not from Glexia's Take. They preserve time-varying source decisions such as CISA SSVC, KEV status, CVSS metrics, and provider references.
We collect every scored CVSS vector available in the official CNA and ADP containers. When more than one version is present, the table keeps the source vectors side by side instead of collapsing them into the highest score.
CWE links open Glexia weakness intelligence pages with official CWE context, developer remediation guidance, and related CVE mappings.
CWE-125 · source CWE mapping
Out-of-bounds Read
Out-of-bounds Read represents a recurring weakness pattern that can create exploitable paths when design, validation, or implementation controls are missing.