# CVE-2024-26687: xen/events: close evtchn after mapping cleanup

> Archived entry. Full-text search covers entries since 2026-11-10; exact IDs work for all years.

- **Severity:** MEDIUM 5.5
- **CVSS:** 5.5 (v3.1, NVD) `CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H`
- **CVSS metrics:** Attack vector: Local; Attack complexity: Low; Privileges required: Low; User interaction: None; Scope: Unchanged; Confidentiality impact: None; Integrity impact: None; Availability impact: High
- **Exploited in the wild:** Not in CISA KEV
- **Public exploit / PoC:** None known
- **Remote exploitation:** Not remotely exploitable (local or adjacent access needed)
- **EPSS:** 0.31% (percentile 16, 2026-11-28)
- **CWE:** CWE-459
- **Published:** 2024-04-03T14:54:49.250Z
- **Modified:** 2026-06-17T07:18:05.860Z

## Who should check

- Anyone running Linux \>= d46a78b05c0e37f76ddf4a7a67bf0b6c68bada55, \< 9470f5b2503cae994098dea9682aee15b313fa44; \>= d46a78b05c0e37f76ddf4a7a67bf0b6c68bada55, \< 0fc88aeb2e32b76db3fe6a624b8333dbe621b8fd; \>= d46a78b05c0e37f76ddf4a7a67bf0b6c68bada55, \< ea592baf9e41779fe9a0424c03dd2f324feca3b3; \>= d46a78b05c0e37f76ddf4a7a67bf0b6c68bada55, \< 585a344af6bcac222608a158fc2830ff02712af5; \>= d46a78b05c0e37f76ddf4a7a67bf0b6c68bada55, \< 20980195ec8d2e41653800c45c8c367fa1b1f2b4; \>= d46a78b05c0e37f76ddf4a7a67bf0b6c68bada55, \< 9be71aa12afa91dfe457b3fb4a444c42b1ee036b; \>= d46a78b05c0e37f76ddf4a7a67bf0b6c68bada55, \< fa765c4b4aed2d64266b694520ecb025c862c5a9
- Anyone running Linux 2.6.37

## Description

In the Linux kernel, the following vulnerability has been resolved:

xen/events: close evtchn after mapping cleanup

shutdown\_pirq and startup\_pirq are not taking the
irq\_mapping\_update\_lock because they can't due to lock inversion. Both
are called with the irq\_desc-\>lock being taking. The lock order,
however, is first irq\_mapping\_update\_lock and then irq\_desc-\>lock.

This opens multiple races:
- shutdown\_pirq can be interrupted by a function that allocates an event
  channel:

  CPU0                        CPU1
  shutdown\_pirq {
    xen\_evtchn\_close(e)
                              \_\_startup\_pirq {
                                EVTCHNOP\_bind\_pirq
                                  -\> returns just freed evtchn e
                                set\_evtchn\_to\_irq(e, irq)
                              }
    xen\_irq\_info\_cleanup() {
      set\_evtchn\_to\_irq(e, -1)
    }
  }

  Assume here event channel e refers here to the same event channel
  number.
  After this race the evtchn\_to\_irq mapping for e is invalid (-1).

- \_\_startup\_pirq races with \_\_unbind\_from\_irq in a similar way. Because
  \_\_startup\_pirq doesn't take irq\_mapping\_update\_lock it can grab the
  evtchn that \_\_unbind\_from\_irq is currently freeing and cleaning up. In
  this case even though the event channel is allocated, its mapping can
  be unset in evtchn\_to\_irq.

The fix is to first cleanup the mappings and then close the event
channel. In this way, when an event channel gets allocated it's
potential previous evtchn\_to\_irq mappings are guaranteed to be unset already.
This is also the reverse order of the allocation where first the event
channel is allocated and then the mappings are setup.

On a 5.10 kernel prior to commit 3fcdaf3d7634 ("xen/events: modify internal
\[un\]bind interfaces"), we hit a BUG like the following during probing of NVMe
devices. The issue is that during nvme\_setup\_io\_queues, pci\_free\_irq
is called for every device which results in a call to shutdown\_pirq.
With many nvme devices it's therefore likely to hit this race during
boot because there will be multiple calls to shutdown\_pirq and
startup\_pirq are running potentially in parallel.

  ------------\[ cut here \]------------
  blkfront: xvda: barrier or flush: disabled; persistent grants: enabled; indirect descriptors: enabled; bounce buffer: enabled
  kernel BUG at drivers/xen/events/events\_base.c:499!
  invalid opcode: 0000 \[\#1\] SMP PTI
  CPU: 44 PID: 375 Comm: kworker/u257:23 Not tainted 5.10.201-191.748.amzn2.x86\_64 \#1
  Hardware name: Xen HVM domU, BIOS 4.11.amazon 08/24/2006
  Workqueue: nvme-reset-wq nvme\_reset\_work
  RIP: 0010:bind\_evtchn\_to\_cpu+0xdf/0xf0
  Code: 5d 41 5e c3 cc cc cc cc 44 89 f7 e8 2b 55 ad ff 49 89 c5 48 85 c0 0f 84 64 ff ff ff 4c 8b 68 30 41 83 fe ff 0f 85 60 ff ff ff \<0f\> 0b 66 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 00 0f 1f 44 00 00
  RSP: 0000:ffffc9000d533b08 EFLAGS: 00010046
  RAX: 0000000000000000 RBX: 0000000000000000 RCX: 0000000000000006
  RDX: 0000000000000028 RSI: 00000000ffffffff RDI: 00000000ffffffff
  RBP: ffff888107419680 R08: 0000000000000000 R09: ffffffff82d72b00
  R10: 0000000000000000 R11: 0000000000000000 R12: 00000000000001ed
  R13: 0000000000000000 R14: 00000000ffffffff R15: 0000000000000002
  FS:  0000000000000000(0000) GS:ffff88bc8b500000(0000) knlGS:0000000000000000
  CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
  CR2: 0000000000000000 CR3: 0000000002610001 CR4: 00000000001706e0
  DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
  DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
  Call Trace:
   ? show\_trace\_log\_lvl+0x1c1/0x2d9
   ? show\_trace\_log\_lvl+0x1c1/0x2d9
   ? set\_affinity\_irq+0xdc/0x1c0
   ? \_\_die\_body.cold+0x8/0xd
   ? die+0x2b/0x50
   ? do\_trap+0x90/0x110
   ? bind\_evtchn\_to\_cpu+0xdf/0xf0
   ? do\_error\_trap+0x65/0x80
   ? bind\_evtchn\_to\_cpu+0xdf/0xf0
   ? exc\_invalid\_op+0x4e/0x70
   ? bind\_evtchn\_to\_cpu+0xdf/0xf0
   ? asm\_exc\_invalid\_op+0x12/0x20
   ? bind\_evtchn\_to\_cpu+0xdf/0x
---truncated---

## Affected and fixed versions

- Linux: \>= d46a78b05c0e37f76ddf4a7a67bf0b6c68bada55, \< 9470f5b2503cae994098dea9682aee15b313fa44; \>= d46a78b05c0e37f76ddf4a7a67bf0b6c68bada55, \< 0fc88aeb2e32b76db3fe6a624b8333dbe621b8fd; \>= d46a78b05c0e37f76ddf4a7a67bf0b6c68bada55, \< ea592baf9e41779fe9a0424c03dd2f324feca3b3; \>= d46a78b05c0e37f76ddf4a7a67bf0b6c68bada55, \< 585a344af6bcac222608a158fc2830ff02712af5; \>= d46a78b05c0e37f76ddf4a7a67bf0b6c68bada55, \< 20980195ec8d2e41653800c45c8c367fa1b1f2b4; \>= d46a78b05c0e37f76ddf4a7a67bf0b6c68bada55, \< 9be71aa12afa91dfe457b3fb4a444c42b1ee036b; \>= d46a78b05c0e37f76ddf4a7a67bf0b6c68bada55, \< fa765c4b4aed2d64266b694520ecb025c862c5a9 (cvelist)
- Linux: 2.6.37 (cvelist)

## Mitigation

- No fix listed yet: follow the vendor advisory.

## Check your systems with an agent

Paste this into a coding agent:

```text
Check whether anything I run is affected by CVE-2024-26687. Work read-only: do not install, upgrade, delete or change anything.

Details: https://flawdb.com/CVE-2024-26687.md
Affected: Linux >= d46a78b05c0e37f76ddf4a7a67bf0b6c68bada55, < 9470f5b2503cae994098dea9682aee15b313fa44; >= d46a78b05c0e37f76ddf4a7a67bf0b6c68bada55, < 0fc88aeb2e32b76db3fe6a624b8333dbe621b8fd; >= d46a78b05c0e37f76ddf4a7a67bf0b6c68bada55, < ea592baf9e41779fe9a0424c03dd2f324feca3b3; >= d46a78b05c0e37f76ddf4a7…
Fixed in: Linux 9470f5b2503cae994098dea9682aee15b313fa44, Linux 0fc88aeb2e32b76db3fe6a624b8333dbe621b8fd, Linux 585a344af6bcac222608a158fc2830ff02712af5, Linux 20980195ec8d2e41653800c45c8c367fa1b1f2b4, Linux 9be71aa12afa91dfe457b3fb4a444c42b1ee036b

Steps:
1. Search this machine and project for Linux: dependency manifests and lockfiles, installed packages, container images and running services.
2. For each match, note the installed version and whether it is inside the affected range.
3. Report a table: location, installed version, affected (yes / no / unsure), evidence. If affected, say which fixed version or mitigation from the details link applies, but don't apply it.
```

## FAQ

### Is CVE-2024-26687 being exploited?

There is no confirmed exploitation: CVE-2024-26687 is not in the CISA Known Exploited Vulnerabilities catalog. No public exploit code is known. EPSS estimates a 0.31% chance of exploitation in the next 30 days (as of 2026-11-28).

### How serious is CVE-2024-26687?

Medium: CVSS 5.5 (v3.1, scored by NVD). Not remotely exploitable (local or adjacent access needed).

### Which versions are affected by CVE-2024-26687?

Linux \>= d46a78b05c0e37f76ddf4a7a67bf0b6c68bada55, \< 9470f5b2503cae994098dea9682aee15b313fa44; \>= d46a78b05c0e37f76ddf4a7a67bf0b6c68bada55, \< 0fc88aeb2e32b76db3fe6a624b8333dbe621b8fd; \>= d46a78b05c0e37f76ddf4a7a67bf0b6c68bada55, \< ea592baf9e41779fe9a0424c03dd2f324feca3b3; \>= d46a78b05c0e37f76ddf4a7a67bf0b6c68bada55, \< 585a344af6bcac222608a158fc2830ff02712af5; \>= d46a78b05c0e37f76ddf4a7a67bf0b6c68bada55, \< 20980195ec8d2e41653800c45c8c367fa1b1f2b4; \>= d46a78b05c0e37f76ddf4a7a67bf0b6c68bada55, \< 9be71aa12afa91dfe457b3fb4a444c42b1ee036b; \>= d46a78b05c0e37f76ddf4a7a67bf0b6c68bada55, \< fa765c4b4aed2d64266b694520ecb025c862c5a9; Linux 2.6.37.

### Is there a fix for CVE-2024-26687?

Yes. Fixed in Linux 9470f5b2503cae994098dea9682aee15b313fa44, Linux 0fc88aeb2e32b76db3fe6a624b8333dbe621b8fd, Linux 585a344af6bcac222608a158fc2830ff02712af5, Linux 20980195ec8d2e41653800c45c8c367fa1b1f2b4, Linux 9be71aa12afa91dfe457b3fb4a444c42b1ee036b. No fix listed yet: follow the vendor advisory.

### How do I check if I'm affected by CVE-2024-26687?

Find where you use the affected software (dependency lockfiles, installed packages, container images, servers) and compare the installed version with the affected range above. The agent prompt on this page does this read-only.

## References

- patch: <https://git.kernel.org/stable/c/9470f5b2503cae994098dea9682aee15b313fa44>
- patch: <https://git.kernel.org/stable/c/0fc88aeb2e32b76db3fe6a624b8333dbe621b8fd>
- patch: <https://git.kernel.org/stable/c/ea592baf9e41779fe9a0424c03dd2f324feca3b3>
- patch: <https://git.kernel.org/stable/c/585a344af6bcac222608a158fc2830ff02712af5>
- patch: <https://git.kernel.org/stable/c/20980195ec8d2e41653800c45c8c367fa1b1f2b4>
- patch: <https://git.kernel.org/stable/c/9be71aa12afa91dfe457b3fb4a444c42b1ee036b>
- patch: <https://git.kernel.org/stable/c/fa765c4b4aed2d64266b694520ecb025c862c5a9>
- other: <https://lists.debian.org/debian-lts-announce/2024/06/msg00017.html>

## Attribution

- CVE Program: CVE® is a registered trademark of The MITRE Corporation. CVE records © 1999–2026 The MITRE Corporation. <https://www.cve.org/Legal/TermsOfUse>
- NVD: This product uses data from the NVD API but is not endorsed or certified by the NVD. <https://nvd.nist.gov/vuln/detail/CVE-2024-26687>

HTML: <https://flawdb.com/CVE-2024-26687> · JSON: <https://flawdb.com/api/v1/entries/CVE-2024-26687>
