git: 24346a2f7775 - stable/14 - EVFILT_SIGNAL: do not use target process pointer on detach

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

URL: https://cgit.FreeBSD.org/src/commit/?id=24346a2f777598272caffbd7e4fb6d85cafe64ed

commit 24346a2f777598272caffbd7e4fb6d85cafe64ed
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:43:27 +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 c847783cd3da..d35c35a534f9 100644
--- a/sys/kern/kern_sig.c
+++ b/sys/kern/kern_sig.c
@@ -4298,9 +4298,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);
 }
 
 /*