git: f30a8cff5171 - stable/15 - kqueue: avoid a possible fork-deadlock
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Mon, 13 Apr 2026 04:01:51 UTC
The branch stable/15 has been updated by kevans:
URL: https://cgit.FreeBSD.org/src/commit/?id=f30a8cff5171864e7f46d49ca41574606a3d5f1e
commit f30a8cff5171864e7f46d49ca41574606a3d5f1e
Author: Kyle Evans <kevans@FreeBSD.org>
AuthorDate: 2026-04-01 22:30:48 +0000
Commit: Kyle Evans <kevans@FreeBSD.org>
CommitDate: 2026-04-13 03:12:24 +0000
kqueue: avoid a possible fork-deadlock
kqueue_fork_copy() is likely to have transitioned at least one knote
through a flux state, so we should check whether we need to wake
anything up on the way out to avoid a possible deadlock.
This was a part of D56210, but we'll close the review with the next
commit.
Reviewed by: kib, markj
(cherry picked from commit 14d0baf2e89202cec3f9cb03a573372ccbc568b2)
---
sys/kern/kern_event.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/sys/kern/kern_event.c b/sys/kern/kern_event.c
index 245a18738d86..2d7df3da58bb 100644
--- a/sys/kern/kern_event.c
+++ b/sys/kern/kern_event.c
@@ -3155,7 +3155,7 @@ kqueue_fork_copy(struct filedesc *fdp, struct file *fp, struct file *fp1,
}
kqueue_release(kq, 1);
kq1->kq_forksrc = NULL;
- KQ_UNLOCK(kq);
+ KQ_UNLOCK_FLUX(kq);
knote_free(marker);
return (error);