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

Since kqueue timer may exist after the process that created it exited
(same scenario with rfork(2) as in PR 275286), make the tailq
p_kqtim_stop accessed by filt_timerdetach() type-stable.

Noted and reviewed by:	markj
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D42777
This commit is contained in:
Konstantin Belousov 2023-11-28 17:42:49 +02:00
parent ed410b78ed
commit 171f0832c5
2 changed files with 1 additions and 1 deletions

View File

@ -622,7 +622,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

View File

@ -275,6 +275,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);
}