freebsd-dev/sys
Konstantin Belousov 6a671a6bde When traced process is about to receive the signal, the process is
stopped and debugger may modify or drop the signal. After the changes to
keep process-targeted signals on the process sigqueue, another thread
may note the old signal on the queue and act before the thread removes
changed or dropped signal from the process queue. Since process is
traced, it usually gets stopped. Or, if the same signal is delivered
while process was stopped, the thread may erronously remove it,
intending to remove the original signal.

Remove the signal from the queue before notifying the debugger. Restore
the siginfo to the head of sigqueue when signal is allowed to be
delivered to the debugee, using newly introduced KSI_HEAD ksiginfo_t
flag. This preserves required order of delivery. Always restore the
unchanged signal on the curthread sigqueue, not to the process queue,
since the thread is about to get it anyway, because sigmask cannot be
changed.

Handle failure of reinserting the siginfo into the queue by falling
back to sq_kill method, calling sigqueue_add with NULL ksi.

If debugger changed the signal to be delivered, use sigqueue_add()
with NULL ksi instead of only setting sq_signals bit.

Reported by:	Gardner Bell <gbell72 rogers com>
Analyzed and first version of fix by:	Tijl Coosemans <tijl coosemans org>
PR:	142757
Reviewed by:	davidxu
MFC after:	2 weeks
2010-01-20 11:58:04 +00:00
..
amd64 Move the examples for the 'hints' and 'env' keywords from various GENERIC 2010-01-19 17:20:34 +00:00
arm Move the examples for the 'hints' and 'env' keywords from various GENERIC 2010-01-19 17:20:34 +00:00
boot Add command-line option -dev to set the default value of the currdev 2010-01-18 06:48:24 +00:00
bsm
cam - Report SATA in legacy emulation mode still as SATA. 2010-01-10 09:20:56 +00:00
cddl Report ZFS filesystem version instead of the zpool version when we say it. 2010-01-11 23:15:11 +00:00
compat Let us to use our libusb(3) in Linuxolator. 2010-01-18 22:46:06 +00:00
conf Move the examples for the 'hints' and 'env' keywords from various GENERIC 2010-01-19 17:20:34 +00:00
contrib Fixes a firmware bug that in some devices (e.g. Netgear WG111T or 2010-01-19 01:04:44 +00:00
crypto
ddb Replace several instances of 'if (!a & b)' with 'if (!(a &b))' in order 2010-01-08 15:44:49 +00:00
dev Complain if freelist queue sizes are significantly less than desired. 2010-01-20 07:28:14 +00:00
fs Revert parts of r202283: 2010-01-18 19:09:16 +00:00
gdb
geom Expose stripe offset and stripe size through libgeom and geom(8) userland 2010-01-17 06:20:30 +00:00
gnu Bring in the ext2fs work done by Aditya Sarawgi during and after Google Summer 2010-01-14 14:30:54 +00:00
i386 Move the examples for the 'hints' and 'env' keywords from various GENERIC 2010-01-19 17:20:34 +00:00
ia64 Add ioctl requests to /dev/io on ia64 for reading and writing 2010-01-14 02:48:39 +00:00
isa Remove extraneous semicolons, no functional changes. 2010-01-07 21:01:37 +00:00
kern When traced process is about to receive the signal, the process is 2010-01-20 11:58:04 +00:00
kgssapi
libkern Merge from head at r201628. 2010-01-06 05:58:07 +00:00
mips Move the examples for the 'hints' and 'env' keywords from various GENERIC 2010-01-19 17:20:34 +00:00
modules Do not build netgraph kernel modules if WITHOUT_NETGRAPH is set in src.conf 2010-01-16 17:08:22 +00:00
net Do not hold the lock over if_setlladdr() as it calls into the interface driver 2010-01-19 04:29:42 +00:00
net80211 Use the iflladdr_event event to keep the mac address on the vap in sync with 2010-01-19 05:00:57 +00:00
netatalk
netgraph Declare a new EVENTHANDLER called iflladdr_event which signals that the L2 2010-01-18 20:34:00 +00:00
netinet Get rid of a lot of duplicated code for NR-SACK handle. 2010-01-17 21:00:28 +00:00
netinet6 Garbage collect references to the no longer implemented tcp_fasttimo(). 2010-01-17 13:07:52 +00:00
netipsec
netipx
netnatm
netncp
netsmb
nfs
nfsclient Reduce recursions on curvnet and thus spamming the console with warning 2010-01-09 14:56:38 +00:00
nfsserver Some style(9) fixes in order to fabricate a commit to denote that 2010-01-09 15:59:15 +00:00
nlm
opencrypto Add comments trying to explain what bad things happen here, i.e. 2010-01-09 15:43:47 +00:00
pc98 Move the examples for the 'hints' and 'env' keywords from various GENERIC 2010-01-19 17:20:34 +00:00
pci Remove extraneous semicolons, no functional changes. 2010-01-07 21:01:37 +00:00
powerpc Move the examples for the 'hints' and 'env' keywords from various GENERIC 2010-01-19 17:20:34 +00:00
rpc Replace the static NGROUPS=NGROUPS_MAX+1=1024 with a dynamic 2010-01-12 07:49:34 +00:00
security Replace the static NGROUPS=NGROUPS_MAX+1=1024 with a dynamic 2010-01-12 07:49:34 +00:00
sparc64 Move the examples for the 'hints' and 'env' keywords from various GENERIC 2010-01-19 17:20:34 +00:00
sun4v Add INCLUDE_CONFIG_FILE in GENERIC on all non-embedded platforms. 2010-01-10 17:44:22 +00:00
sys When traced process is about to receive the signal, the process is 2010-01-20 11:58:04 +00:00
teken
tools
ufs Cast 64-bit quantity to intptr_t rather than int so as to work properly 2010-01-11 22:42:06 +00:00
vm When a vnode-backed vm object is referenced, it increments the vnode 2010-01-17 21:26:14 +00:00
xdr
xen Remove extraneous semicolons, no functional changes. 2010-01-07 21:01:37 +00:00
Makefile