aboutsummaryrefslogtreecommitdiff
path: root/sys/sys/proc.h
diff options
context:
space:
mode:
authorKonstantin Belousov <kib@FreeBSD.org>2020-12-31 13:44:32 +0000
committerKonstantin Belousov <kib@FreeBSD.org>2021-01-10 02:41:19 +0000
commitef739c7373d8b3833979ad471b31cb9e215411fd (patch)
treeb7b120a59b16b815a47b9eab42948090e285f49f /sys/sys/proc.h
parente0d83cd3e49f0b9e16bc82ced7bd3b0ef9aa6a71 (diff)
downloadsrc-ef739c7373d8b3833979ad471b31cb9e215411fd.tar.gz
src-ef739c7373d8b3833979ad471b31cb9e215411fd.zip
pgrp: Prevent use after free.
Often, we have a process locked and need to get locked process group. In this case, because progress group lock is before process lock, unlocking process allows the group to be freed. See for instance tty_wait_background(). Make pgrp structures allocated from nofree zone, and ensure type stability of the pgrp mutex. Reviewed by: jilles Tested by: pho MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D27871
Diffstat (limited to 'sys/sys/proc.h')
-rw-r--r--sys/sys/proc.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/sys/sys/proc.h b/sys/sys/proc.h
index 33da4969c6ae..2a7f0740a0c3 100644
--- a/sys/sys/proc.h
+++ b/sys/sys/proc.h
@@ -864,7 +864,6 @@ struct proc {
#ifdef MALLOC_DECLARE
MALLOC_DECLARE(M_PARGS);
-MALLOC_DECLARE(M_PGRP);
MALLOC_DECLARE(M_SESSION);
MALLOC_DECLARE(M_SUBPROC);
#endif
@@ -1022,6 +1021,7 @@ extern struct proclist allproc; /* List of all processes. */
extern struct proc *initproc, *pageproc; /* Process slots for init, pager. */
extern struct uma_zone *proc_zone;
+extern struct uma_zone *pgrp_zone;
struct proc *pfind(pid_t); /* Find process by id. */
struct proc *pfind_any(pid_t); /* Find (zombie) process by id. */