Skip to content
Heist/ feed
Back to feed
CriticalFix available

tcp/dccp: Don't use timer_pending() in reqsk_queue_unlink().

Type: advisorySources: OSV

In the Linux kernel, the following vulnerability has been resolved: tcp/dccp: Don't use timer_pending() in reqsk_queue_unlink(). Martin KaFai Lau reported use-after-free [0] in reqsk_timer_handler(). """ We are seeing a use-after-free from a bpf prog attached to trace_tcp_retransmit_synack. The program passes the req->sk to the bpf_sk_storage_get_tracing kernel helper which does check for null before using it. """ The commit 83fccfc3940c ("inet: fix potential deadlock in reqsk_queue_unlink()") added timer_pending() in reqsk_queue_unlink() not to call del_timer_sync() from reqsk_timer_handler(), but it introduced a small race window. Before the timer is called, expire_timers() calls detach_timer(timer, true) to clear timer->entry.pprev and marks it as not pending. If reqsk_queue_unlink() checks timer_pending() just after expire_timers() calls detach_timer(), TCP will miss del_timer_sync(); the reqsk timer will continue running and send multiple SYN+ACKs until it expires. The reported UAF could happen if req->sk is close()d earlier than the timer expiration, which is 63s by default. The scenario would be 1. inet_csk_complete_hashdance() calls inet_csk_reqsk_queue_drop(), but del_timer_sync() is missed 2. reqsk timer is executed and scheduled again 3. req->sk is accept()ed and reqsk_put() decrements rsk_refcnt, but reqsk timer still has another one, and inet_csk_accept() does not clear req->sk for non-TFO sockets 4. sk is close()d 5. reqsk timer is executed again, and BPF touche

Products
Kernel
Affected versions
Not specified
Fixed versions
5.10.237, 5.15.170, 5.4.293, 6.1.115, 6.11.6, 6.6.59
CVEs
CVE-2024-50154
Confirmed fixed CVEs
Not specified
Updated in this feed
5 Nov 2026, 10:36 UTC · Revision 1

Source evidence

tcp/dccp: Don't use timer_pending() in reqsk_queue_unlink().

core-osv · Original source

Published 7 Nov 2024, 09:31 UTC

In the Linux kernel, the following vulnerability has been resolved: tcp/dccp: Don't use timer_pending() in reqsk_queue_unlink(). Martin KaFai Lau reported use-after-free [0] in reqsk_timer_handler(). """ We are seeing a use-after-free from a bpf prog attached to trace_tcp_retransmit_synack. The program passes the req->sk to the bpf_sk_storage_get_tracing kernel helper which does check for null before using it. """ The commit 83fccfc3940c ("inet: fix potential deadlock in reqsk_queue_unlink()") added timer_pending() in reqsk_queue_unlink() not to call del_timer_sync() from reqsk_timer_handler(), but it introduced a small race window. Before the timer is called, expire_timers() calls detach_timer(timer, true) to clear timer->entry.pprev and marks it as not pending. If reqsk_queue_unlink() checks timer_pending() just after expire_timers() calls detach_timer(), TCP will miss del_timer_sync(); the reqsk timer will continue running and send multiple SYN+ACKs until it expires. The reported UAF could happen if req->sk is close()d earlier than the timer expiration, which is 63s by default. The scenario would be 1. inet_csk_complete_hashdance() calls inet_csk_reqsk_queue_drop(), but del_timer_sync() is missed 2. reqsk timer is executed and scheduled again 3. req->sk is accept()ed and reqsk_put() decrements rsk_refcnt, but reqsk timer still has another one, and inet_csk_accept() does not clear req->sk for non-TFO sockets 4. sk is close()d 5. reqsk timer is executed again, and BPF touche

osv:CVE-2024-50154

Kernel

Fixed versions: 5.4.293, 5.10.237, 5.15.170, 6.1.115, 6.6.59, 6.11.6

Complete source record
{
  "id": "789798afcb631e57735c254a2c8ed2ca42c973e68a79772da0c77bd07e4d4048",
  "url": "https://osv.dev/vulnerability/CVE-2024-50154",
  "method": "structured",
  "payload": {
    "kind": "advisory",
    "title": "tcp/dccp: Don't use timer_pending() in reqsk_queue_unlink().",
    "summary": "In the Linux kernel, the following vulnerability has been resolved: tcp/dccp: Don't use timer_pending() in reqsk_queue_unlink(). Martin KaFai Lau reported use-after-free [0] in reqsk_timer_handler(). \"\"\" We are seeing a use-after-free from a bpf prog attached to trace_tcp_retransmit_synack. The program passes the req->sk to the bpf_sk_storage_get_tracing kernel helper which does check for null before using it. \"\"\" The commit 83fccfc3940c (\"inet: fix potential deadlock in reqsk_queue_unlink()\") added timer_pending() in reqsk_queue_unlink() not to call del_timer_sync() from reqsk_timer_handler(), but it introduced a small race window. Before the timer is called, expire_timers() calls detach_timer(timer, true) to clear timer->entry.pprev and marks it as not pending. If reqsk_queue_unlink() checks timer_pending() just after expire_timers() calls detach_timer(), TCP will miss del_timer_sync(); the reqsk timer will continue running and send multiple SYN+ACKs until it expires. The reported UAF could happen if req->sk is close()d earlier than the timer expiration, which is 63s by default. The scenario would be 1. inet_csk_complete_hashdance() calls inet_csk_reqsk_queue_drop(), but del_timer_sync() is missed 2. reqsk timer is executed and scheduled again 3. req->sk is accept()ed and reqsk_put() decrements rsk_refcnt, but reqsk timer still has another one, and inet_csk_accept() does not clear req->sk for non-TFO sockets 4. sk is close()d 5. reqsk timer is executed again, and BPF touche",
    "evidence": "osv:CVE-2024-50154",
    "products": [
      {
        "name": {
          "value": "Kernel",
          "evidence": "/affected/1/package/name"
        },
        "prerequisites": [],
        "fixed_versions": [
          {
            "value": "5.4.293",
            "evidence": "/affected/1/ranges"
          },
          {
            "value": "5.10.237",
            "evidence": "/affected/1/ranges"
          },
          {
            "value": "5.15.170",
            "evidence": "/affected/1/ranges"
          },
          {
            "value": "6.1.115",
            "evidence": "/affected/1/ranges"
          },
          {
            "value": "6.6.59",
            "evidence": "/affected/1/ranges"
          },
          {
            "value": "6.11.6",
            "evidence": "/affected/1/ranges"
          }
        ],
        "affected_versions": []
      }
    ],
    "severity": "critical",
    "structured": {
      "id": "CVE-2024-50154",
      "aliases": [
        "CVE-2024-50154"
      ],
      "metrics": [
        {
          "type": "CVSS_V3",
          "score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H"
        }
      ],
      "affected": [
        {
          "ranges": [
            {
              "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
              "type": "GIT",
              "events": [
                {
                  "introduced": "83fccfc3940c4a2db90fd7e7079f5b465cd8c6af"
                },
                {
                  "fixed": "106e457953315e476b3642ef24be25ed862aaba3"
                },
                {
                  "fixed": "c964bf65f80a14288d767023a1b300b30f5b9cd0"
                },
                {
                  "fixed": "8459d61fbf24967839a70235165673148c7c7f17"
                },
                {
                  "fixed": "5071beb59ee416e8ab456ac8647a4dabcda823b1"
                },
                {
                  "fixed": "997ae8da14f1639ce6fb66a063dab54031cd61b3"
                },
                {
                  "fixed": "51e34db64f4e43c7b055ccf881b7f3e0c31bb26d"
                },
                {
                  "fixed": "e8c526f2bdf1845bedaf6a478816a3d06fa78b8f"
                }
              ]
            },
            {
              "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
              "type": "GIT",
              "events": [
                {
                  "introduced": "4.1.11"
                },
                {
                  "fixed": "4.2"
                }
              ]
            },
            {
              "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
              "type": "GIT",
              "events": [
                {
                  "introduced": "d3a1196bfc462943694623412d8e03aaf172bdc1"
                }
              ]
            }
          ],
          "versions": [
            "v4.1.52",
            "v4.1.51",
            "v4.1.50",
            "v4.1.49",
            "v4.1.48",
            "v4.1.47",
            "v4.1.46",
            "v4.1.45",
            "v4.1.44",
            "v4.1.43",
            "v4.1.42",
            "v4.1.41",
            "v4.1.40",
            "v4.1.39",
            "v4.1.38",
            "v4.1.37",
            "v4.1.36",
            "v4.1.35",
            "v4.1.34",
            "v4.1.33",
            "v4.1.32",
            "v4.1.31",
            "v4.1.30",
            "v4.1.29",
            "v4.1.28",
            "v4.1.27",
            "v4.1.26",
            "v4.1.25",
            "v4.1.24",
            "v4.1.23",
            "v4.1.22",
            "v4.1.21",
            "v4.1.20",
            "v4.1.19",
            "v4.1.18",
            "v4.1.17",
            "v4.1.16",
            "v4.1.15",
            "v4.1.14",
            "v4.1.13",
            "v4.1.12",
            "v4.1.11"
          ],
          "database_specific": {
            "source": "https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2024-50154.json"
          }
        },
        {
          "ranges": [
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "4.2.0"
                },
                {
                  "fixed": "5.4.293"
                }
              ]
            },
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "5.5.0"
                },
                {
                  "fixed": "5.10.237"
                }
              ]
            },
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "5.11.0"
                },
                {
                  "fixed": "5.15.170"
                }
              ]
            },
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "5.16.0"
                },
                {
                  "fixed": "6.1.115"
                }
              ]
            },
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "6.2.0"
                },
                {
                  "fixed": "6.6.59"
                }
              ]
            },
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "6.7.0"
                },
                {
                  "fixed": "6.11.6"
                }
              ]
            }
          ],
          "package": {
            "name": "Kernel",
            "ecosystem": "Linux"
          },
          "database_specific": {
            "source": "https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2024-50154.json"
          }
        }
      ],
      "modified": "2026-10-28T02:30:43.778416183Z",
      "provider": "osv",
      "references": [
        "https://git.kernel.org/stable/c/106e457953315e476b3642ef24be25ed862aaba3",
        "https://git.kernel.org/stable/c/5071beb59ee416e8ab456ac8647a4dabcda823b1",
        "https://git.kernel.org/stable/c/51e34db64f4e43c7b055ccf881b7f3e0c31bb26d",
        "https://git.kernel.org/stable/c/8459d61fbf24967839a70235165673148c7c7f17",
        "https://git.kernel.org/stable/c/997ae8da14f1639ce6fb66a063dab54031cd61b3",
        "https://git.kernel.org/stable/c/c964bf65f80a14288d767023a1b300b30f5b9cd0",
        "https://git.kernel.org/stable/c/e8c526f2bdf1845bedaf6a478816a3d06fa78b8f",
        "https://lists.debian.org/debian-lts-announce/2025/01/msg00001.html",
        "https://lists.debian.org/debian-lts-announce/2025/05/msg00030.html",
        "https://github.com/CVEProject/cvelistV5/tree/main/cves/2024/50xxx/CVE-2024-50154.json",
        "https://nvd.nist.gov/vuln/detail/CVE-2024-50154",
        "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/50xxx/CVE-2024-50154.json"
      }
    },
    "related_cves": [
      {
        "value": "CVE-2024-50154",
        "evidence": "/id"
      }
    ],
    "security_relevant": true,
    "severity_evidence": "/severity/0/score"
  },
  "source_id": "core-osv",
  "document_id": 511641,
  "published_at": "2024-11-07T09:31:30.855+00:00"
}