git: ca50304272a6 - stable/13 - EVFILT_TIMER: intialize stop timer list in type-stable proc init, instead of fork

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

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

commit ca50304272a673f4bacce824261dfa4999182c1c
Author:     Konstantin Belousov <kib@FreeBSD.org>
AuthorDate: 2023-11-28 15:42:49 +0000
Commit:     Konstantin Belousov <kib@FreeBSD.org>
CommitDate: 2023-12-05 00:44:13 +0000

    EVFILT_TIMER: intialize stop timer list in type-stable proc init, instead of fork
    
    (cherry picked from commit 171f0832c5b15f2f66d2fe59967348a42814b0c1)
---
 sys/kern/kern_fork.c | 1 -
 sys/kern/kern_proc.c | 1 +
 2 files changed, 1 insertion(+), 1 deletion(-)

diff --git a/sys/kern/kern_fork.c b/sys/kern/kern_fork.c
index e3148763b460..59ffcce70966 100644
--- a/sys/kern/kern_fork.c
+++ b/sys/kern/kern_fork.c
@@ -619,7 +619,6 @@ do_fork(struct thread *td, struct fork_req *fr, struct proc *p2, struct thread *
 	LIST_INIT(&p2->p_orphans);
 
 	callout_init_mtx(&p2->p_itcallout, &p2->p_mtx, 0);
-	TAILQ_INIT(&p2->p_kqtim_stop);
 
 	/*
 	 * This begins the section where we must prevent the parent
diff --git a/sys/kern/kern_proc.c b/sys/kern/kern_proc.c
index 2a6c9bb977a3..61c389f0b345 100644
--- a/sys/kern/kern_proc.c
+++ b/sys/kern/kern_proc.c
@@ -277,6 +277,7 @@ proc_init(void *mem, int size, int flags)
 	EVENTHANDLER_DIRECT_INVOKE(process_init, p);
 	p->p_stats = pstats_alloc();
 	p->p_pgrp = NULL;
+	TAILQ_INIT(&p->p_kqtim_stop);
 	return (0);
 }