Skip to content
Heist/ feed
Back to feed
UnratedFix available

kprobes: don't call disarm_kprobe() for disabled kprobes

Type: advisorySources: OSV

In the Linux kernel, the following vulnerability has been resolved: kprobes: don't call disarm_kprobe() for disabled kprobes The assumption in __disable_kprobe() is wrong, and it could try to disarm an already disarmed kprobe and fire the WARN_ONCE() below. [0] We can easily reproduce this issue. 1. Write 0 to /sys/kernel/debug/kprobes/enabled. # echo 0 > /sys/kernel/debug/kprobes/enabled 2. Run execsnoop. At this time, one kprobe is disabled. # /usr/share/bcc/tools/execsnoop & [1] 2460 PCOMM PID PPID RET ARGS # cat /sys/kernel/debug/kprobes/list ffffffff91345650 r __x64_sys_execve+0x0 [FTRACE] ffffffff91345650 k __x64_sys_execve+0x0 [DISABLED][FTRACE] 3. Write 1 to /sys/kernel/debug/kprobes/enabled, which changes kprobes_all_disarmed to false but does not arm the disabled kprobe. # echo 1 > /sys/kernel/debug/kprobes/enabled # cat /sys/kernel/debug/kprobes/list ffffffff91345650 r __x64_sys_execve+0x0 [FTRACE] ffffffff91345650 k __x64_sys_execve+0x0 [DISABLED][FTRACE] 4. Kill execsnoop, when __disable_kprobe() calls disarm_kprobe() for the disabled kprobe and hits the WARN_ONCE() in __disarm_kprobe_ftrace(). # fg /usr/share/bcc/tools/execsnoop ^C Actually, WARN_ONCE() is fired twice, and __unregister_kprobe_top() misses some cleanups and leaves the aggregated kprobe in the hash table. Then, __unregister_trace_kprobe() initialises tk->rp.kp.list and creates an infinite loop like this. aggregated kprobe.list -> kprobe.list -. ^ | '.__.' In this situation, these commands fall int

Products
Kernel
Affected versions
Not specified
Fixed versions
4.14.292, 4.19.257, 4.9.327, 5.10.141, 5.15.65, 5.19.6, 5.4.212
CVEs
CVE-2022-50008
Confirmed fixed CVEs
Not specified
Updated in this feed
2 Nov 2026, 23:19 UTC · Revision 1

Source evidence

kprobes: don't call disarm_kprobe() for disabled kprobes

core-osv · Original source

Published 18 Jun 2025, 11:01 UTC

In the Linux kernel, the following vulnerability has been resolved: kprobes: don't call disarm_kprobe() for disabled kprobes The assumption in __disable_kprobe() is wrong, and it could try to disarm an already disarmed kprobe and fire the WARN_ONCE() below. [0] We can easily reproduce this issue. 1. Write 0 to /sys/kernel/debug/kprobes/enabled. # echo 0 > /sys/kernel/debug/kprobes/enabled 2. Run execsnoop. At this time, one kprobe is disabled. # /usr/share/bcc/tools/execsnoop & [1] 2460 PCOMM PID PPID RET ARGS # cat /sys/kernel/debug/kprobes/list ffffffff91345650 r __x64_sys_execve+0x0 [FTRACE] ffffffff91345650 k __x64_sys_execve+0x0 [DISABLED][FTRACE] 3. Write 1 to /sys/kernel/debug/kprobes/enabled, which changes kprobes_all_disarmed to false but does not arm the disabled kprobe. # echo 1 > /sys/kernel/debug/kprobes/enabled # cat /sys/kernel/debug/kprobes/list ffffffff91345650 r __x64_sys_execve+0x0 [FTRACE] ffffffff91345650 k __x64_sys_execve+0x0 [DISABLED][FTRACE] 4. Kill execsnoop, when __disable_kprobe() calls disarm_kprobe() for the disabled kprobe and hits the WARN_ONCE() in __disarm_kprobe_ftrace(). # fg /usr/share/bcc/tools/execsnoop ^C Actually, WARN_ONCE() is fired twice, and __unregister_kprobe_top() misses some cleanups and leaves the aggregated kprobe in the hash table. Then, __unregister_trace_kprobe() initialises tk->rp.kp.list and creates an infinite loop like this. aggregated kprobe.list -> kprobe.list -. ^ | '.__.' In this situation, these commands fall int

osv:CVE-2022-50008

Kernel

Fixed versions: 4.9.327, 4.14.292, 4.19.257, 5.4.212, 5.10.141, 5.15.65, 5.19.6

Complete source record
{
  "id": "c9e34381cb964e5163020de98612b7a974cccab5103ecb2e7c0218a04968dac8",
  "url": "https://osv.dev/vulnerability/CVE-2022-50008",
  "method": "structured",
  "payload": {
    "kind": "advisory",
    "title": "kprobes: don't call disarm_kprobe() for disabled kprobes",
    "summary": "In the Linux kernel, the following vulnerability has been resolved: kprobes: don't call disarm_kprobe() for disabled kprobes The assumption in __disable_kprobe() is wrong, and it could try to disarm an already disarmed kprobe and fire the WARN_ONCE() below. [0] We can easily reproduce this issue. 1. Write 0 to /sys/kernel/debug/kprobes/enabled. # echo 0 > /sys/kernel/debug/kprobes/enabled 2. Run execsnoop. At this time, one kprobe is disabled. # /usr/share/bcc/tools/execsnoop & [1] 2460 PCOMM PID PPID RET ARGS # cat /sys/kernel/debug/kprobes/list ffffffff91345650 r __x64_sys_execve+0x0 [FTRACE] ffffffff91345650 k __x64_sys_execve+0x0 [DISABLED][FTRACE] 3. Write 1 to /sys/kernel/debug/kprobes/enabled, which changes kprobes_all_disarmed to false but does not arm the disabled kprobe. # echo 1 > /sys/kernel/debug/kprobes/enabled # cat /sys/kernel/debug/kprobes/list ffffffff91345650 r __x64_sys_execve+0x0 [FTRACE] ffffffff91345650 k __x64_sys_execve+0x0 [DISABLED][FTRACE] 4. Kill execsnoop, when __disable_kprobe() calls disarm_kprobe() for the disabled kprobe and hits the WARN_ONCE() in __disarm_kprobe_ftrace(). # fg /usr/share/bcc/tools/execsnoop ^C Actually, WARN_ONCE() is fired twice, and __unregister_kprobe_top() misses some cleanups and leaves the aggregated kprobe in the hash table. Then, __unregister_trace_kprobe() initialises tk->rp.kp.list and creates an infinite loop like this. aggregated kprobe.list -> kprobe.list -. ^ | '.__.' In this situation, these commands fall int",
    "evidence": "osv:CVE-2022-50008",
    "products": [
      {
        "name": {
          "value": "Kernel",
          "evidence": "/affected/1/package/name"
        },
        "prerequisites": [],
        "fixed_versions": [
          {
            "value": "4.9.327",
            "evidence": "/affected/1/ranges"
          },
          {
            "value": "4.14.292",
            "evidence": "/affected/1/ranges"
          },
          {
            "value": "4.19.257",
            "evidence": "/affected/1/ranges"
          },
          {
            "value": "5.4.212",
            "evidence": "/affected/1/ranges"
          },
          {
            "value": "5.10.141",
            "evidence": "/affected/1/ranges"
          },
          {
            "value": "5.15.65",
            "evidence": "/affected/1/ranges"
          },
          {
            "value": "5.19.6",
            "evidence": "/affected/1/ranges"
          }
        ],
        "affected_versions": []
      }
    ],
    "severity": "unknown",
    "structured": {
      "id": "CVE-2022-50008",
      "aliases": [
        "CVE-2022-50008"
      ],
      "affected": [
        {
          "ranges": [
            {
              "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
              "type": "GIT",
              "events": [
                {
                  "introduced": "69d54b916d83872a0a327778a01af2a096923f59"
                },
                {
                  "fixed": "19cd630712e7c13a3dedfc6986a9b983fed6fd98"
                },
                {
                  "fixed": "6f3c1bc22fc2165461883f506b4d2c3594bd7137"
                },
                {
                  "fixed": "fc91d2db55acdaf0c0075b624e572d3520ca3bc3"
                },
                {
                  "fixed": "b474ff1b20951f1eac75d100a93861e6da2b522b"
                },
                {
                  "fixed": "744b0d3080709a172f0408aedabd1cedd24c2ee6"
                },
                {
                  "fixed": "55c7a91527343d2e0b5647cc308c6e04ddd2aa52"
                },
                {
                  "fixed": "bc3188d8a3b8c08c306a4c851ddb2c92ba4599ca"
                },
                {
                  "fixed": "9c80e79906b4ca440d09e7f116609262bb747909"
                }
              ]
            }
          ],
          "database_specific": {
            "source": "https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2022-50008.json"
          }
        },
        {
          "ranges": [
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "4.0.0"
                },
                {
                  "fixed": "4.9.327"
                }
              ]
            },
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "4.10.0"
                },
                {
                  "fixed": "4.14.292"
                }
              ]
            },
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "4.15.0"
                },
                {
                  "fixed": "4.19.257"
                }
              ]
            },
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "4.20.0"
                },
                {
                  "fixed": "5.4.212"
                }
              ]
            },
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "5.5.0"
                },
                {
                  "fixed": "5.10.141"
                }
              ]
            },
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "5.11.0"
                },
                {
                  "fixed": "5.15.65"
                }
              ]
            },
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "5.16.0"
                },
                {
                  "fixed": "5.19.6"
                }
              ]
            }
          ],
          "package": {
            "name": "Kernel",
            "ecosystem": "Linux"
          },
          "database_specific": {
            "source": "https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2022-50008.json"
          }
        }
      ],
      "modified": "2026-10-28T02:30:24.434584811Z",
      "provider": "osv",
      "references": [
        "https://git.kernel.org/stable/c/19cd630712e7c13a3dedfc6986a9b983fed6fd98",
        "https://git.kernel.org/stable/c/55c7a91527343d2e0b5647cc308c6e04ddd2aa52",
        "https://git.kernel.org/stable/c/6f3c1bc22fc2165461883f506b4d2c3594bd7137",
        "https://git.kernel.org/stable/c/744b0d3080709a172f0408aedabd1cedd24c2ee6",
        "https://git.kernel.org/stable/c/9c80e79906b4ca440d09e7f116609262bb747909",
        "https://git.kernel.org/stable/c/b474ff1b20951f1eac75d100a93861e6da2b522b",
        "https://git.kernel.org/stable/c/bc3188d8a3b8c08c306a4c851ddb2c92ba4599ca",
        "https://git.kernel.org/stable/c/fc91d2db55acdaf0c0075b624e572d3520ca3bc3",
        "https://github.com/CVEProject/cvelistV5/tree/main/cves/2022/50xxx/CVE-2022-50008.json",
        "https://nvd.nist.gov/vuln/detail/CVE-2022-50008",
        "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/2022/50xxx/CVE-2022-50008.json"
      }
    },
    "related_cves": [
      {
        "value": "CVE-2022-50008",
        "evidence": "/id"
      }
    ],
    "security_relevant": true,
    "severity_evidence": null
  },
  "source_id": "core-osv",
  "document_id": 490836,
  "published_at": "2025-06-18T11:01:13.331+00:00"
}