Thread View: muc.lists.freebsd.bugs
1 messages
1 total messages
Started by bugzilla-noreply
Thu, 19 Nov 2026 05:52
[Bug 300891] xen/xen_intr: xen_intr_get_evtchn_from_port() takes a reference on an interrupt source whose refcount is already 0
Author: bugzilla-noreply
Date: Thu, 19 Nov 2026 05:52
Date: Thu, 19 Nov 2026 05:52
54 lines
3815 bytes
3815 bytes
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=300891
Bug ID: 300891
Summary: xen/xen_intr: xen_intr_get_evtchn_from_port() takes a
reference on an interrupt source whose refcount is
already 0
Product: Base System
Version: 15.1-RELEASE
Hardware: amd64
OS: Any
Status: New
Severity: Affects Some People
Priority: ---
Component: kern
Assignee: bugs@FreeBSD.org
Reporter: sablomenkamp@gmail.com
Environment: FreeBSD 15.1-RELEASE amd64 as a PVH domU on Xen 4.20.5-pre (Debian
13 dom0), and as an HVM domU on Qubes OS 4.3 (Xen 4.19). Found while running
Xen's libxenvchan and the Qubes OS qrexec agent. Still present in main 5151bc2
(line numbers below are from that commit).
xen_intr_unbind() drops the last reference and releases xen_intr_isrc_lock, and
only then calls xen_intr_release_isrc(). In that window,
xen_intr_get_evtchn_from_port() still finds the source in
xen_intr_port_to_isrc[] and does refcount_acquire() from 0
(sys/dev/xen/bus/xen_intr.c, line 1078). The caller then holds a handle to a
source that is torn down under it.
How it showed: panic 'interrupt handler "evtchn0" not found', with the change
described in the gntdev use-after-free report in place, which makes this path
frequent.
Suggested fix: refcount_acquire_if_not_zero(), returning EINVAL when the count
was already 0. A tested patch against main is available if wanted.
Disclosure: found and analysed with an AI assistant (Claude). The reproduction,
the test runs and the results are from my own machines.
--
You are receiving this mail because:
You are the assignee for the bug.
--
Posted automagically by a mail2news gateway at muc.de e.V.
Please direct questions, flames, donations, etc. to news-admin@muc.de
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads