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
23
linux kernel
vulnerability
n_gsm
out-of-bounds
data length
advanced option mode
memory corruption

AI Score

7.1

Confidence

High

EPSS

0

Percentile

13.0%

SSVC

Exploitation

none

Automatable

no

Technical Impact

partial

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.

ADP Affected

[
  {
    "cpes": [
      "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*"
    ],
    "vendor": "linux",
    "product": "linux_kernel",
    "versions": [
      {
        "status": "affected",
        "version": "e1eaea46bb40",
        "lessThan": "b890d45aaf02",
        "versionType": "custom"
      }
    ],
    "defaultStatus": "unknown"
  },
  {
    "cpes": [
      "cpe:2.3:o:linux:linux_kernel:-:*:*:*:*:*:*:*"
    ],
    "vendor": "linux",
    "product": "linux_kernel",
    "versions": [
      {
        "status": "affected",
        "version": "e1eaea46bb40",
        "lessThan": "47388e807f85",
        "versionType": "custom"
      }
    ],
    "defaultStatus": "unknown"
  },
  {
    "cpes": [
      "cpe:2.3:o:linux:linux_kernel:2.6.35:*:*:*:*:*:*:*"
    ],
    "vendor": "linux",
    "product": "linux_kernel",
    "versions": [
      {
        "status": "affected",
        "version": "2.6.35"
      }
    ],
    "defaultStatus": "unknown"
  },
  {
    "cpes": [
      "cpe:2.3:o:linux:linux_kernel:-:*:*:*:*:*:*:*"
    ],
    "vendor": "linux",
    "product": "linux_kernel",
    "versions": [
      {
        "status": "affected",
        "version": "e1eaea46bb40",
        "lessThan": "f126ce7305fe",
        "versionType": "custom"
      },
      {
        "status": "affected",
        "version": "e1eaea46bb40",
        "lessThan": "9513d4148950",
        "versionType": "custom"
      },
      {
        "status": "affected",
        "version": "e1eaea46bb40",
        "lessThan": "b229bc6c6ea9",
        "versionType": "custom"
      },
      {
        "status": "affected",
        "version": "e1eaea46bb40",
        "lessThan": "0fb736c9931e",
        "versionType": "custom"
      },
      {
        "status": "affected",
        "version": "e1eaea46bb40",
        "lessThan": "4c267110fc11",
        "versionType": "custom"
      },
      {
        "status": "affected",
        "version": "e1eaea46bb40",
        "versionType": "custom",
        "lessThanOrEqual": "46f52c89a7e7"
      },
      {
        "status": "affected",
        "version": "e1eaea46bb40",
        "lessThan": "774d83b008ec",
        "versionType": "custom"
      },
      {
        "status": "unaffected",
        "version": "0",
        "lessThan": "2.6.35",
        "versionType": "custom"
      },
      {
        "status": "unaffected",
        "version": "4.19.316",
        "versionType": "custom",
        "lessThanOrEqual": "4.20"
      },
      {
        "status": "unaffected",
        "version": "5.4.278",
        "versionType": "custom",
        "lessThanOrEqual": "5.5"
      },
      {
        "status": "unaffected",
        "version": "5.10.219",
        "versionType": "custom",
        "lessThanOrEqual": "5.11"
      },
      {
        "status": "unaffected",
        "version": "5.15.161",
        "versionType": "custom",
        "lessThanOrEqual": "5.16"
      },
      {
        "status": "unaffected",
        "version": "6.1.93",
        "versionType": "custom",
        "lessThanOrEqual": "6.2"
      },
      {
        "status": "unaffected",
        "version": "6.6.33",
        "versionType": "custom",
        "lessThanOrEqual": "6.7"
      },
      {
        "status": "unaffected",
        "version": "6.8.12",
        "versionType": "custom",
        "lessThanOrEqual": "6.9"
      },
      {
        "status": "unaffected",
        "version": "6.9.3",
        "versionType": "custom",
        "lessThanOrEqual": "6.10"
      },
      {
        "status": "unaffected",
        "version": "6.10",
        "versionType": "custom",
        "lessThanOrEqual": "*"
      }
    ],
    "defaultStatus": "unknown"
  }
]

AI Score

7.1

Confidence

High

EPSS

0

Percentile

13.0%

SSVC

Exploitation

none

Automatable

no

Technical Impact

partial