proc_stoptrace() is dedicated for emitting a syscall trap for a debugger,
either on entry or exit of the system function routine.
Changes:
- Change an if() branch of an invalid condition of being traced by
initproc (PID1) to KASSERT(9).
- Assert that the current process has set appropriate flags (PSL_TRACED
and PSL_SYSCALL).
- Use ktrpoint(KTR_PSIG) and ktrpsig()/e_ktrpsig() in order to register
the emitted signal for the ktrace(1) event debugging.
Example of the new output from kdump(1) for the syscall debugger traps,
containing SIGTRAP notification with TRAP_SCE and TRAP_SCX (around
the getpid(2) call).
$ kdump /tmp/1.dat.qemu |grep 663
588 1 t_ptrace_waitpid RET fork 663/0x297
663 1 t_ptrace_waitpid EMUL "netbsd"
663 1 t_ptrace_waitpid RET fork 0
663 1 t_ptrace_waitpid CALL ptrace(PT_TRACE_ME,0,0,0)
663 1 t_ptrace_waitpid RET ptrace 0
663 1 t_ptrace_waitpid CALL _lwp_self
663 1 t_ptrace_waitpid RET _lwp_self 1
663 1 t_ptrace_waitpid CALL _lwp_kill(1,0x11)
663 1 t_ptrace_waitpid RET _lwp_kill 0
588 1 t_ptrace_waitpid RET __wait450 663/0x297
663 1 t_ptrace_waitpid CALL getpid
588 1 t_ptrace_waitpid RET __wait450 663/0x297
663 1 t_ptrace_waitpid PSIG SIGTRAP SIG_DFL: code=TRAP_SCE, addr=0x0, trap=0)
663 1 t_ptrace_waitpid RET getpid 663/0x297, 588/0x24c
588 1 t_ptrace_waitpid RET __wait450 663/0x297
663 1 t_ptrace_waitpid PSIG SIGTRAP SIG_DFL: code=TRAP_SCX, addr=0x0, trap=0)
663 1 t_ptrace_waitpid CALL exit(5)
588 1 t_ptrace_waitpid RET __wait450 663/0x297
Sponsored by <The NetBSD Foundation>
already fixed half of the problem two months ago in rev1.67, back then I
thought it was not triggerable because each packet we emit is guaranteed
to have correctly formed IPv6 options; but it is actually triggerable via
IPv6 forwarding, we emit a packet we just received, and we don't sanitize
its options before invoking IPsec.
Since it would be wrong to just stop the iteration and continue the IPsec
processing, allow compute_ipsec_pos to fail, and when it does, drop the
packet entirely.
not support the necessary options. This is done thusly:
1. Set MKREPRO=no in Makefile.host. This handles all the Makefiles that
use it and don't include bsd.own.mk.
2. Create Makefile.inc and set MKREPRO=no in it. Change the Makefiles that
include bsd.own.mk, to include bsd.init.mk which includes Makefile.inc
first. This will also allow us to control other tools options from a
single location if we need to.
XXX: pullup-8
tcp_timer.h. This struct move is more trouble than its worth. It breaks
header compatibility with other BSD's and can't be really removed because
it is an installed header that will break other 3rd party software. I
suggest that it gets reverted!