Lucene search

K
vulnrichmentLinuxVULNRICHMENT:CVE-2024-36016
HistoryMay 29, 2024 - 6:46 p.m.

CVE-2024-36016 tty: n_gsm: fix possible out-of-bounds in gsm0_receive()

2024-05-2918:46:34
Linux
github.com
1
linux kernel
vulnerability
n_gsm
out-of-bounds
data length
advanced option mode
memory corruption

7.1 High

AI Score

Confidence

High

0.0004 Low

EPSS

Percentile

13.1%

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.

CNA Affected

[
  {
    "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
    "vendor": "Linux",
    "product": "Linux",
    "versions": [
      {
        "status": "affected",
        "version": "e1eaea46bb40",
        "lessThan": "9513d4148950",
        "versionType": "git"
      },
      {
        "status": "affected",
        "version": "e1eaea46bb40",
        "lessThan": "b229bc6c6ea9",
        "versionType": "git"
      },
      {
        "status": "affected",
        "version": "e1eaea46bb40",
        "lessThan": "0fb736c9931e",
        "versionType": "git"
      },
      {
        "status": "affected",
        "version": "e1eaea46bb40",
        "lessThan": "4c267110fc11",
        "versionType": "git"
      },
      {
        "status": "affected",
        "version": "e1eaea46bb40",
        "lessThan": "46f52c89a7e7",
        "versionType": "git"
      },
      {
        "status": "affected",
        "version": "e1eaea46bb40",
        "lessThan": "774d83b008ec",
        "versionType": "git"
      },
      {
        "status": "affected",
        "version": "e1eaea46bb40",
        "lessThan": "f126ce7305fe",
        "versionType": "git"
      },
      {
        "status": "affected",
        "version": "e1eaea46bb40",
        "lessThan": "b890d45aaf02",
        "versionType": "git"
      },
      {
        "status": "affected",
        "version": "e1eaea46bb40",
        "lessThan": "47388e807f85",
        "versionType": "git"
      }
    ],
    "programFiles": [
      "drivers/tty/n_gsm.c"
    ],
    "defaultStatus": "unaffected"
  },
  {
    "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
    "vendor": "Linux",
    "product": "Linux",
    "versions": [
      {
        "status": "affected",
        "version": "2.6.35"
      },
      {
        "status": "unaffected",
        "version": "0",
        "lessThan": "2.6.35",
        "versionType": "custom"
      },
      {
        "status": "unaffected",
        "version": "4.19.316",
        "versionType": "custom",
        "lessThanOrEqual": "4.19.*"
      },
      {
        "status": "unaffected",
        "version": "5.4.278",
        "versionType": "custom",
        "lessThanOrEqual": "5.4.*"
      },
      {
        "status": "unaffected",
        "version": "5.10.219",
        "versionType": "custom",
        "lessThanOrEqual": "5.10.*"
      },
      {
        "status": "unaffected",
        "version": "5.15.161",
        "versionType": "custom",
        "lessThanOrEqual": "5.15.*"
      },
      {
        "status": "unaffected",
        "version": "6.1.93",
        "versionType": "custom",
        "lessThanOrEqual": "6.1.*"
      },
      {
        "status": "unaffected",
        "version": "6.6.33",
        "versionType": "custom",
        "lessThanOrEqual": "6.6.*"
      },
      {
        "status": "unaffected",
        "version": "6.8.12",
        "versionType": "custom",
        "lessThanOrEqual": "6.8.*"
      },
      {
        "status": "unaffected",
        "version": "6.9.3",
        "versionType": "custom",
        "lessThanOrEqual": "6.9.*"
      },
      {
        "status": "unaffected",
        "version": "6.10-rc1",
        "versionType": "original_commit_for_fix",
        "lessThanOrEqual": "*"
      }
    ],
    "programFiles": [
      "drivers/tty/n_gsm.c"
    ],
    "defaultStatus": "affected"
  }
]

7.1 High

AI Score

Confidence

High

0.0004 Low

EPSS

Percentile

13.1%

Related for VULNRICHMENT:CVE-2024-36016