git: 55e91944998c - stable/13 - EVFILT_SIGNAL: do not use target process pointer on detach

From: Konstantin Belousov <kib_at_FreeBSD.org>
Date: Tue, 05 Dec 2023 00:54:53 UTC
The branch stable/13 has been updated by kib:

URL: https://cgit.FreeBSD.org/src/commit/?id=55e91944998c128d74b94b9b48a04ef41ff5e9d0

commit 55e91944998c128d74b94b9b48a04ef41ff5e9d0
Author:     Konstantin Belousov <kib@FreeBSD.org>
AuthorDate: 2023-11-28 12:51:54 +0000
Commit:     Konstantin Belousov <kib@FreeBSD.org>
CommitDate: 2023-12-05 00:44:13 +0000

    EVFILT_SIGNAL: do not use target process pointer on detach
    
    PR:     275286
    
    (cherry picked from commit ed410b78edc53e17b5a3e93ace2adbeb3a734ae9)
---
 sys/kern/kern_sig.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/sys/kern/kern_sig.c b/sys/kern/kern_sig.c
index f25ff1ed55a6..6b9ea8d110c3 100644
--- a/sys/kern/kern_sig.c
+++ b/sys/kern/kern_sig.c
@@ -4207,9 +4207,7 @@ filt_sigattach(struct knote *kn)
 static void
 filt_sigdetach(struct knote *kn)
 {
-	struct proc *p = kn->kn_ptr.p_proc;
-
-	knlist_remove(p->p_klist, kn, 0);
+	knlist_remove(kn->kn_knlist, kn, 0);
 }
 
 /*