Skip to content
Heist/ feed
Back to feed
UnratedFix available

tty: add the option to have a tty reject a new ldisc

Type: advisorySources: OSV

In the Linux kernel, the following vulnerability has been resolved: tty: add the option to have a tty reject a new ldisc ... and use it to limit the virtual terminals to just N_TTY. They are kind of special, and in particular, the "con_write()" routine violates the "writes cannot sleep" rule that some ldiscs rely on. This avoids the BUG: sleeping function called from invalid context at kernel/printk/printk.c:2659 when N_GSM has been attached to a virtual console, and gsmld_write() calls con_write() while holding a spinlock, and con_write() then tries to get the console lock.

Products
Kernel
Affected versions
Not specified
Fixed versions
6.1.96, 6.6.36, 6.9.7
CVEs
CVE-2024-40966
Confirmed fixed CVEs
Not specified
Updated in this feed
2 Nov 2026, 20:26 UTC · Revision 1

Source evidence

tty: add the option to have a tty reject a new ldisc

core-osv · Original source

Published 12 Jul 2024, 12:32 UTC

In the Linux kernel, the following vulnerability has been resolved: tty: add the option to have a tty reject a new ldisc ... and use it to limit the virtual terminals to just N_TTY. They are kind of special, and in particular, the "con_write()" routine violates the "writes cannot sleep" rule that some ldiscs rely on. This avoids the BUG: sleeping function called from invalid context at kernel/printk/printk.c:2659 when N_GSM has been attached to a virtual console, and gsmld_write() calls con_write() while holding a spinlock, and con_write() then tries to get the console lock.

osv:CVE-2024-40966

Kernel

Fixed versions: 6.1.96, 6.6.36, 6.9.7

Complete source record
{
  "id": "900f064ef984d9a85715e140b72e8f02651e1c74e368dda1668af33a267cc55e",
  "url": "https://osv.dev/vulnerability/CVE-2024-40966",
  "method": "structured",
  "payload": {
    "kind": "advisory",
    "title": "tty: add the option to have a tty reject a new ldisc",
    "summary": "In the Linux kernel, the following vulnerability has been resolved: tty: add the option to have a tty reject a new ldisc ... and use it to limit the virtual terminals to just N_TTY. They are kind of special, and in particular, the \"con_write()\" routine violates the \"writes cannot sleep\" rule that some ldiscs rely on. This avoids the BUG: sleeping function called from invalid context at kernel/printk/printk.c:2659 when N_GSM has been attached to a virtual console, and gsmld_write() calls con_write() while holding a spinlock, and con_write() then tries to get the console lock.",
    "evidence": "osv:CVE-2024-40966",
    "products": [
      {
        "name": {
          "value": "Kernel",
          "evidence": "/affected/1/package/name"
        },
        "prerequisites": [],
        "fixed_versions": [
          {
            "value": "6.1.96",
            "evidence": "/affected/1/ranges"
          },
          {
            "value": "6.6.36",
            "evidence": "/affected/1/ranges"
          },
          {
            "value": "6.9.7",
            "evidence": "/affected/1/ranges"
          }
        ],
        "affected_versions": []
      }
    ],
    "severity": "unknown",
    "structured": {
      "id": "CVE-2024-40966",
      "aliases": [
        "CVE-2024-40966"
      ],
      "affected": [
        {
          "ranges": [
            {
              "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
              "type": "GIT",
              "events": [
                {
                  "introduced": "e1eaea46bb4020b38a141b84f88565d4603f8dd0"
                },
                {
                  "fixed": "3c6332f3bb1578b5b10ac2561247b1d6272ae937"
                },
                {
                  "fixed": "287b569a5b914903ba7c438a3c0dbc3410ebb409"
                },
                {
                  "fixed": "5920ac19964f9e20181f63b410d9200ddbf8dc86"
                },
                {
                  "fixed": "6bd23e0c2bb6c65d4f5754d1456bc9a4427fc59b"
                }
              ]
            }
          ],
          "database_specific": {
            "source": "https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2024-40966.json"
          }
        },
        {
          "ranges": [
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "2.6.35"
                },
                {
                  "fixed": "6.1.96"
                }
              ]
            },
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "6.2.0"
                },
                {
                  "fixed": "6.6.36"
                }
              ]
            },
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "6.7.0"
                },
                {
                  "fixed": "6.9.7"
                }
              ]
            }
          ],
          "package": {
            "name": "Kernel",
            "ecosystem": "Linux"
          },
          "database_specific": {
            "source": "https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2024-40966.json"
          }
        }
      ],
      "modified": "2026-10-28T02:30:23.753301010Z",
      "provider": "osv",
      "references": [
        "https://git.kernel.org/stable/c/287b569a5b914903ba7c438a3c0dbc3410ebb409",
        "https://git.kernel.org/stable/c/3c6332f3bb1578b5b10ac2561247b1d6272ae937",
        "https://git.kernel.org/stable/c/5920ac19964f9e20181f63b410d9200ddbf8dc86",
        "https://git.kernel.org/stable/c/6bd23e0c2bb6c65d4f5754d1456bc9a4427fc59b",
        "https://lists.debian.org/debian-lts-announce/2025/01/msg00001.html",
        "https://github.com/CVEProject/cvelistV5/tree/main/cves/2024/40xxx/CVE-2024-40966.json",
        "https://nvd.nist.gov/vuln/detail/CVE-2024-40966",
        "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git"
      ],
      "provider_metadata": {
        "cna_assigner": "Linux",
        "osv_generated_from": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2024/40xxx/CVE-2024-40966.json"
      }
    },
    "related_cves": [
      {
        "value": "CVE-2024-40966",
        "evidence": "/id"
      }
    ],
    "security_relevant": true,
    "severity_evidence": null
  },
  "source_id": "core-osv",
  "document_id": 489841,
  "published_at": "2024-07-12T12:32:06.122+00:00"
}