freebsd-dev/sys
Konstantin Belousov d735998057 Correct the problems with the ptrace(2) making the debuggee an orphan.
One problem is inferior(9) looping due to the process tree becoming a
graph instead of tree if the parent is traced by child. Another issue
is due to the use of p_oppid to restore the original parent/child
relationship, because real parent could already exited and its pid
reused (noted by mjg).

Add the function proc_realparent(9), which calculates the parent for
given process. It uses the flag P_TREE_FIRST_ORPHAN to detect the head
element of the p_orphan list and than stepping back to its container
to find the parent process. If the parent has already exited, the
init(8) is returned.

Move the P_ORPHAN and the new helper flag from the p_flag* to new
p_treeflag field of struct proc, which is protected by proctree lock
instead of proc lock, since the orphans relationship is managed under
the proctree_lock already.

The remaining uses of p_oppid in ptrace(PT_DETACH) and process
reapping are replaced by proc_realparent(9).

Phabric:	D417
Reviewed by:	jhb
Tested by:	pho
Sponsored by:	The FreeBSD Foundation
MFC after:	2 weeks
2014-08-07 05:47:53 +00:00
..
amd64 Merge all MD sf_buf allocators into one MI, residing in kern/subr_sfbuf.c 2014-08-05 09:44:10 +00:00
arm Use a SYSINIT to init the array of interrupt names on arm. This was 2014-08-06 21:27:15 +00:00
boot Optionally include the install command as found on Juniper products 2014-08-06 00:36:04 +00:00
bsm IFp4 @1192291: 2014-04-07 20:44:00 +00:00
cam Reduce reported additional INQUIRY data length. 2014-08-06 17:02:19 +00:00
cddl MFV r269542: 2014-08-05 00:07:21 +00:00
compat All mbuf external free functions never fail, so let them be void. 2014-07-11 13:58:48 +00:00
conf Add an arm option, ARM_DEVICE_MULTIPASS, used to opt-in to multi-pass 2014-08-05 19:06:45 +00:00
contrib Honour WITH and WITHOUT_INET6_SUPPORT. 2014-08-05 13:01:21 +00:00
crypto Put the aesni_cipher_setup() and aesni_cipher_process() functions into 2014-06-24 06:55:49 +00:00
ddb handle longer commands so that lines don't overflow... people who added 2014-06-02 23:50:19 +00:00
dev cxgbe(4): Let caller specify whether it's ok to sleep in 2014-08-06 19:38:03 +00:00
fs Revert r269523: 2014-08-05 01:25:14 +00:00
gdb Pull in r267961 and r267973 again. Fix for issues reported will follow. 2014-06-28 03:56:17 +00:00
geom In r264504, we prevented doing I/O for more than MAXPHYS by making 2014-07-22 17:30:05 +00:00
gnu Revert r269528; this was not the right way to bring these changes in. 2014-08-05 22:38:49 +00:00
i386 Merge all MD sf_buf allocators into one MI, residing in kern/subr_sfbuf.c 2014-08-05 09:44:10 +00:00
isa Remove vestiges of knowing the ISA bus, which we gave up on around 20 2014-03-19 21:03:04 +00:00
kern Correct the problems with the ptrace(2) making the debuggee an orphan. 2014-08-07 05:47:53 +00:00
kgssapi
libkern Fix unwind-info errors in our hand-written arm assembler code. 2014-08-01 18:24:44 +00:00
mips Merge all MD sf_buf allocators into one MI, residing in kern/subr_sfbuf.c 2014-08-05 09:44:10 +00:00
modules Revert the logic change from r269540. If the opt_inet6.h file is empty 2014-08-05 10:48:53 +00:00
net Improve locking of multicast addresses in VLAN and LAGG interfaces. 2014-08-04 00:58:12 +00:00
net80211 Use logical rather than bitwise OR in if() expression. 2014-04-26 23:22:49 +00:00
netgraph Remove any stale mbuf tags from packets being injected into a netgraph 2014-07-01 07:54:12 +00:00
netinet Add support for the SCTP_RECONFIG_SUPPORTED and the corresponding 2014-08-04 20:07:35 +00:00
netinet6 Add new rule to source address selection algorithm. It prefers address 2014-07-30 15:08:12 +00:00
netipsec Fix style bug: rename the refcount field of m_ext to ext_cnt, to match 2014-07-11 14:34:29 +00:00
netnatm
netpfil On machines with strict alignment copy pfsync_state_key from packet 2014-07-10 12:41:58 +00:00
netsmb Remove redundant unlock. 2014-04-17 12:22:08 +00:00
nfs Fix/improve fhe_stats sysctl output. 2014-06-14 12:26:12 +00:00
nfsclient
nfsserver Change NFS readdir() to only ignore cookies preceding the given offset for 2014-07-01 20:00:35 +00:00
nlm Correct a typo in nlm_find_host_by_addr(): the intention of the 2014-03-11 00:25:55 +00:00
ofed Fix OFED startup order: All SYSINIT()'s and modules should be loaded 2014-07-06 14:22:13 +00:00
opencrypto allow the kern.cryptodevallowsoft sysctl to enable symetric/hashes too... 2014-03-11 01:45:46 +00:00
pc98 Compile fixes: 2014-06-28 17:36:18 +00:00
pci Fix various NIC drivers to properly cleanup static DMA resources. 2014-06-11 14:53:58 +00:00
powerpc Retire various intertwined bits of fbd(4) and vt_fb, in particular the 2014-08-06 00:35:48 +00:00
rpc Merge the NFSv4.1 server code in projects/nfsv4.1-server over 2014-07-01 20:47:16 +00:00
security Pull in r267961 and r267973 again. Fix for issues reported will follow. 2014-06-28 03:56:17 +00:00
sparc64 Merge all MD sf_buf allocators into one MI, residing in kern/subr_sfbuf.c 2014-08-05 09:44:10 +00:00
sys Correct the problems with the ptrace(2) making the debuggee an orphan. 2014-08-07 05:47:53 +00:00
teken Fix typo. 2014-02-06 13:28:06 +00:00
tools Call cpp with -P to avoid printing line markings. 2014-06-10 06:24:01 +00:00
ufs Add support for multi-threading of soft updates. 2014-08-04 22:03:58 +00:00
vm The vm_pager_page_unswapped() pager op is only implemented for the 2014-08-06 19:34:03 +00:00
x86 xen: add ACPI bus to xen_nexus when running as Dom0 2014-08-04 09:05:28 +00:00
xdr
xen xen: implement event channel PIRQ support 2014-08-04 08:42:29 +00:00
Makefile Remove ia64. 2014-07-07 00:27:09 +00:00