freebsd-dev/sys/cddl
Mark Johnston c080655467 Fix a race between fasttrap and the user breakpoint handler.
When disabling the last enabled userspace probe, fasttrap clears the
function pointers which hook in to the breakpoint handler.  If a traced
thread hit a fasttrap breakpoint before it was removed, we must ensure
that it is able to call the hook; otherwise fasttrap will not consume
the trap and SIGTRAP will be delievered to the thread.  Synchronize
with such threads by ensuring that they load the hook pointer with
interrupts disabled, and by completing an SMP rendezvous after removing
breakpoints and before clearing the pointers.

Reported by:	Alexander Alexeev <Alexander.Alexeev@dell.com>
Tested by:	Alexander Alexeev (earlier version)
Reviewed by:	cem, kib
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D20526
2019-06-06 16:03:25 +00:00
..
boot/zfs zfsboot: support newer ZFS versions 2019-01-03 22:49:11 +00:00
compat/opensolaris Extract eventfilter declarations to sys/_eventfilter.h 2019-05-20 00:38:23 +00:00
contrib/opensolaris Fix a race between fasttrap and the user breakpoint handler. 2019-06-06 16:03:25 +00:00
dev dtrace: 64-bits registers support 2019-06-05 22:29:05 +00:00