git: 1ede9ecfe610 - stable/15 - kqueue: Associate marker knotes with a queue

Mark Johnston <[email protected]>
Newsgroups gmane.os.freebsd.devel.cvs.src
Message-ID <6a74a1d2.45daa.591b9bae__2174.36241671152$1786028631$gmane$org@gitrepo.freebsd.org>
The branch stable/15 has been updated by markj:

URL: https://cgit.FreeBSD.org/src/commit/?id=1ede9ecfe61017cc28ebeb4e65506ed0efa59408

commit 1ede9ecfe61017cc28ebeb4e65506ed0efa59408
Author:     Mark Johnston <[email protected]>
AuthorDate: 2026-07-29 12:43:55 +0000
Commit:     Mark Johnston <[email protected]>
CommitDate: 2026-08-06 13:24:43 +0000

    kqueue: Associate marker knotes with a queue
    
    Otherwise the assertion in KQ_FLUX_SLEEP_WMESG may fail.
    
    kqueue_fork_copy() already handles this.
    
    Fixes:          1f4b0ea4f3eb ("kqueue: Add a helper macro for sleeping on in-flux knotes")
    Reported by:    syzkaller
    Reported by:    kbowling
    Reviewed by:    kib
    Sponsored by:   The FreeBSD Foundation
    Differential Revision:  https://reviews.freebsd.org/D58516
    
    (cherry picked from commit 9a9349ea1da2d80e979fa87b430551d8f6dac7f4)
---
 sys/kern/kern_event.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/sys/kern/kern_event.c b/sys/kern/kern_event.c
index 0a02642cccae..3990c2366ab4 100644
--- a/sys/kern/kern_event.c
+++ b/sys/kern/kern_event.c
@@ -2160,6 +2160,7 @@ kqueue_scan(struct kqueue *kq, int maxevents, struct kevent_copyops *k_ops,
 		asbt = 0;
 	memset(&marker, 0, sizeof(marker));
 	marker.kn_status = KN_MARKER;
+	marker.kn_kq = kq;
 	KQ_LOCK(kq);
 
 retry:
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.