Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F137914447
D35310.id106875.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D35310.id106875.diff
View Options
diff --git a/sys/kern/kern_exit.c b/sys/kern/kern_exit.c
--- a/sys/kern/kern_exit.c
+++ b/sys/kern/kern_exit.c
@@ -251,6 +251,8 @@
* MUST abort all other threads before proceeding past here.
*/
PROC_LOCK(p);
+ p->p_flag2 |= P2_WEXIT;
+
/*
* First check if some other thread or external request got
* here before us. If so, act appropriately: exit or suspend.
diff --git a/sys/kern/kern_proc.c b/sys/kern/kern_proc.c
--- a/sys/kern/kern_proc.c
+++ b/sys/kern/kern_proc.c
@@ -3446,7 +3446,7 @@
PROC_UNLOCK(p);
continue;
}
- if ((p->p_flag & P_WEXIT) != 0) {
+ if ((p->p_flag2 & P2_WEXIT) != 0) {
seen_exiting = true;
PROC_UNLOCK(p);
continue;
diff --git a/sys/kern/kern_procctl.c b/sys/kern/kern_procctl.c
--- a/sys/kern/kern_procctl.c
+++ b/sys/kern/kern_procctl.c
@@ -325,7 +325,7 @@
res = true;
PROC_LOCK(p2);
- if ((p2->p_flag & P_WEXIT) == 0) {
+ if ((p2->p_flag2 & P2_WEXIT) == 0) {
_PHOLD_LITE(p2);
res = reap_kill_proc_locked(td, p2, ksi, rk, error);
_PRELE(p2);
diff --git a/sys/kern/kern_sig.c b/sys/kern/kern_sig.c
--- a/sys/kern/kern_sig.c
+++ b/sys/kern/kern_sig.c
@@ -3406,6 +3406,7 @@
struct proc *p = td->td_proc;
PROC_LOCK_ASSERT(p, MA_OWNED);
+ p->p_flag2 |= P2_WEXIT;
p->p_acflag |= AXSIG;
/*
* We must be single-threading to generate a core dump. This
diff --git a/sys/sys/proc.h b/sys/sys/proc.h
--- a/sys/sys/proc.h
+++ b/sys/sys/proc.h
@@ -847,6 +847,9 @@
#define P2_NO_NEW_PRIVS 0x00008000 /* Ignore setuid */
#define P2_WXORX_DISABLE 0x00010000 /* WX mappings enabled */
#define P2_WXORX_ENABLE_EXEC 0x00020000 /* WXORX enabled after exec */
+#define P2_WEXIT 0x00040000 /* exit just started, no
+ external thread_single() is
+ permitted */
/* Flags protected by proctree_lock, kept in p_treeflags. */
#define P_TREE_ORPHANED 0x00000001 /* Reparented, on orphan list */
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, Nov 28, 4:38 AM (8 h, 49 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
26274271
Default Alt Text
D35310.id106875.diff (1 KB)
Attached To
Mode
D35310: Set of fixes for REAP_KILL_SUBTREE
Attached
Detach File
Event Timeline
Log In to Comment