Up to [cvs.NetBSD.org] / src / doc
Request diff between arbitrary revisions
Keyword substitution: kv
Default branch: MAIN
Drop TODO.ptrace The remaining issues are mostly tracked in the ATF ptrace tests and GDB or LLDB test-suite.
Mostly merge changes from HEAD upto 20200411
Update with reality Drop finished or not important tasks.
Update TODO.ptrace Drop compat32 entries as they were mostly addressed. Drop MD specific calls, it's up to port's CPU to contain various features like PT_STEP.
Sync with HEAD
Sync with HEAD Resolve a couple of conflicts (result of the uimin/uimax changes)
Update TODO.ptrace Drop the following entries: - PaX MPROTECT tests - done, implemented. - research of ipkdb(4) - it's gone, if it will be superseded it would be probably a networking interface for kgdb - PTRACE_VFORK implemented and covered by tests, there are SMP bugs left
Pull up following revision(s) (requested by kamil in ticket #713): sys/modules/procfs/Makefile: revision 1.4 sys/miscfs/procfs/procfs_vfsops.c: revision 1.98 bin/ps/ps.1: revision 1.108 sys/compat/linux/arch/i386/linux_ptrace.c: revision 1.32 sys/miscfs/procfs/procfs_vnops.c: revision 1.198 sys/kern/sys_ptrace_common.c: revision 1.23 sys/kern/sys_ptrace_common.c: revision 1.24 sbin/mount_procfs/mount_procfs.8: revision 1.36 sys/kern/sys_ptrace_common.c: revision 1.25 sys/kern/sys_ptrace.c: revision 1.5 sys/compat/linux/arch/powerpc/linux_ptrace.c: revision 1.30 sys/sys/proc.h: revision 1.342 sys/kern/sys_ptrace_common.c: revision 1.26 sys/miscfs/procfs/procfs_ctl.c: file removal sys/kern/sys_ptrace_common.c: revision 1.27 sys/miscfs/procfs/procfs_subr.c: revision 1.109 sys/kern/sys_ptrace_common.c: revision 1.28 sys/secmodel/extensions/secmodel_extensions.c: revision 1.8 sys/kern/sys_ptrace_common.c: revision 1.29 sys/sys/ptrace.h: revision 1.62 sys/compat/netbsd32/netbsd32_signal.c: revision 1.45 share/man/man9/kauth.9: revision 1.109 sys/miscfs/procfs/files.procfs: revision 1.12 sys/compat/netbsd32/netbsd32.h: revision 1.115 sys/miscfs/procfs/procfs.h: revision 1.72 sys/compat/netbsd32/netbsd32_ptrace.c: revision 1.5 sys/kern/kern_sig.c: revision 1.337 sys/sys/kauth.h: revision 1.75 sys/sys/sysctl.h: revision 1.224 sys/kern/sys_ptrace_common.c: revision 1.30 sys/kern/sys_ptrace_common.c: revision 1.31 sys/kern/sys_ptrace_common.c: revision 1.32 sys/kern/sys_ptrace_common.c: revision 1.33 sys/compat/linux/arch/arm/linux_ptrace.c: revision 1.20 sys/kern/sys_ptrace_common.c: revision 1.34 sys/kern/sys_ptrace_common.c: revision 1.36 sys/kern/kern_proc.c: revision 1.207 sys/kern/kern_exit.c: revision 1.269 doc/TODO.ptrace: revision 1.29 Make {s,g}et{db,fp,}regs work again for PK_32 processes XXX: pullup-8 add disgusting magic to handle compat_netbsd32 as a module. use process_*reg32 instead of struct *reg32. Remove the filesystem tracing feature This is a legacy interface from 4.4BSD, and it was introduced to overcome shortcomings of ptrace(2) at that time, which are no longer relevant (performance). Today /proc/#/ctl offers a narrow subset of ptrace(2) commands and is not applicable for modern applications use beyond simplistic tracing scenarios. This removal will simplify kernel internals. Users will still be able to use all the other /proc files. This change won't affect other procfs files neither Linux compat features within mount_procfs(8). /proc/#/ctl isn't available on Linux. Remove: - /proc/#/ctl from mount_procfs(8) - P_FSTRACE note from the documentation of ps(1) - /proc/#/ctl and filesystem tracing documentation from mount_procfs(8) - KAUTH_REQ_PROCESS_PROCFS_CTL documentation from kauth(9) - source code file miscfs/procfs/procfs_ctl.c - PFSctl and procfs_doctl() from sys/miscfs/procfs/procfs.h - KAUTH_REQ_PROCESS_PROCFS_CTL from sys/sys/kauth.h - PSL_FSTRACE (0x00010000) from sys/sys/proc.h - P_FSTRACE (0x00010000) from sys/sys/sysctl.h Reduce code complexity after removal of this functionality. Update TODO.ptrace accordingly: remove two entries about /proc tracing. Do not keep legacy notes as comments in the headers about removed PSL_FSTRACE / P_FSTRACE, as this interface had little number of users (close or equal to zero). Proposed on tech-kern@. All filesystem tracing utility users are encouraged to switch to ptrace(2). Sponsored by <The NetBSD Foundation> untangle the mess: - factor out common code - break each ptrace subcall to its own sub-function .. more to come ... - reduce ifdef ugliness by moving it up top. - factor out PT_IO and make PT_{READ,WRITE}_{I,D} use it - factor out PT_DUMPCORE - factor out sendsig code .. more to come ... handle siginfo requests for ptrace32 ptrace: Partially undo PT_{READ,WRITE}_{I,D} and unbreak these commands The refactored code did not work and was generating EFAULT. Sponsored by <The NetBSD Foundation> Merge the code back; the problem was that since we are reading/writing to a kernel address for PT_{READ,WRITE}_{I,D} we need the kernel vmspace. provide separate read and write functions to accomodate register functions that need a size argument. don't ignore error from copyout_piod Use the proper process (the tracee) to get information about lwps and registers and the tracer for vmspace. Add new sysctl(3) entry: security.models.extensions.user_set_dbregs Model this new sysctl(3) entry after "user_set_cpu_affinity" in the same level of sysctl(3) switches. Allow to read unconditionally Debug Registers (no change here). This is convenient as even if a user of a debugger does not use hardware assisted watchpoints/breakpoints, a debugger can still prompt these values to store in an internal cache with context of registers. Reading them should have no security concerns. Add a paranoid MI switch that prohibits by default setting these registers by a regular user (non-superuser). Make this switch disabled by default. There are enough reserved bits out there to allow using them unconditionally on hardened hosts. Features shipped with Debug Registers are optional features in debuggers. There is no reduction in elementary functionality. Reviewed by <christos> Sponsored by <The NetBSD Foundation>
Remove the filesystem tracing feature This is a legacy interface from 4.4BSD, and it was introduced to overcome shortcomings of ptrace(2) at that time, which are no longer relevant (performance). Today /proc/#/ctl offers a narrow subset of ptrace(2) commands and is not applicable for modern applications use beyond simplistic tracing scenarios. This removal will simplify kernel internals. Users will still be able to use all the other /proc files. This change won't affect other procfs files neither Linux compat features within mount_procfs(8). /proc/#/ctl isn't available on Linux. Remove: - /proc/#/ctl from mount_procfs(8) - P_FSTRACE note from the documentation of ps(1) - /proc/#/ctl and filesystem tracing documentation from mount_procfs(8) - KAUTH_REQ_PROCESS_PROCFS_CTL documentation from kauth(9) - source code file miscfs/procfs/procfs_ctl.c - PFSctl and procfs_doctl() from sys/miscfs/procfs/procfs.h - KAUTH_REQ_PROCESS_PROCFS_CTL from sys/sys/kauth.h - PSL_FSTRACE (0x00010000) from sys/sys/proc.h - P_FSTRACE (0x00010000) from sys/sys/sysctl.h Reduce code complexity after removal of this functionality. Update TODO.ptrace accordingly: remove two entries about /proc tracing. Do not keep legacy notes as comments in the headers about removed PSL_FSTRACE / P_FSTRACE, as this interface had little number of users (close or equal to zero). Proposed on tech-kern@. All filesystem tracing utility users are encouraged to switch to ptrace(2). Sponsored by <The NetBSD Foundation>
Sync with HEAD
Sync with HEAD
Update TODO.ptrace Remove entries: - research support PT_SYSCALL & PT_STEP combined like in Linux - GDB Remote Protocol expects a case with a step with a signal to be sent, this is currently unsupported on NetBSD Implemented as PT_SETSTEP and PT_CLEARSTEP. Remove: - support QPassSignals (PT_SET_SIGPASS/PT_GET_SIGPASS) in the kernel, a way to stop routing a set of signals to tracer as they are uninteresting - GDB and LLDB expect this feature This interface has been abandoned and will be handled on the debugger level. Sponsored by <The NetBSD Foundation>
Sync with HEAD
TODO.ptrace: Remove entry about addition of TRAP_SCE and TRAP_SCX These siginfo(2) codes have been committed.
Add new entry in TODO.ptrace about QPassSignals Added: support QPassSignals (PT_SET_SIGPASS/PT_GET_SIGPASS) in the kernel, a way to stop routing a set of signals to tracer as they are uninteresting - GDB and LLDB expect this feature
Add new entry in TODO.ptrace about PT_STEP with a signal Added: GDB Remote Protocol expects a case with a step with a signal to be sent, this is currently unsupported on NetBSD
Sync TODO.ptrace with reality Remove entries: - add new ptrace(2) calls to lock (suspend) and unlock LWP within a process - switch PT_WATCHPOINT* to PT_*ETDBREGS and document it, add ATF tests - add ATF tests for PT_SYSCALL and PT_SYSCALLEMU Sponsored by <The NetBSD Foundation>
Add new entry to TODO.ptrace check 64-bit debugger on 64-bit kernel tracing capabilities of 32-bit tracee Sponsored by <The NetBSD Foundation>
Add new entry in TODO.ptrace Research kgdb. It should be supported by GDB and LLDB. Sponsored by <The NetBSD Foundation>
Add new entry to TODO.ptrace research ipkdb(4) Sponsored by <The NetBSD Foundation>
Update TODO.ptrace Note BSD4.4-like /proc debugging removal Explain kevent(2)-based debugging proposal Sponsored by <The NetBSD Foundation>
Update TODO.ptrace Remove: - add PT_SET_SIGMASK and PT_GET_SIGMASK - used by checkpointing software This interface has been committed to HEAD. Sponsored by <The NetBSD Foundation>
Update TODO.ptrace with new entries Added entries: - add support to read debugger events via a file descriptor in procfs (kevent(2)), it's still useful in cases when a parent traces tracee and has to call waitpid(2) for its child - as this clashes with GUI toolkits - fix more calls for netbsd32 compat Sponsored by <The NetBSD Foundation>
Update TODO.ptrace Remove entries: - remove exect(3) from libc - there is no usecase for it Interface has been marked obsolete and it's on the queue to be removed for. - research what happens when a tracee masks signals (including SIGTRAP) and a breakpoint is triggered It has been researched and ATF tests added (signal1 .. signal10). It's currently broken on NetBSD. Add: - research support PT_SYSCALL & PT_STEP combined like in Linux There are circumstances when we want to sstep and catch syscall events. Sponsored by <The NetBSD Foundation>
Add new entry in TODO.ptrace Added: add PT_SET_SIGMASK and PT_GET_SIGMASK - used by checkpointing software Example software: gdb, criu
libpthread_dbg(3) deletion from the base distribution libpthread_dbg(3) is a remnant library from the M:N thread model (pre-NetBSD-5.0) API to introspect threads within a process and for use of debuggers. Currently in the 1:1 model it's not used in GDB neither in LLDB and it's not either planned to be used. It's current function to read pthread_t structures is realizable within a regular debugger capable to instrospect objects within a tracee (GDB, LLDB...). Remaining users of this API can still use this library from pkgsrc/devel/libpthread_dbg. Sponsored by <The NetBSD Foundation>
Update TODO.ptrace Note PT_WATCHPOINT change to PT_*ETDBREGS. Remove GDB and LLDB related entries from generic ptrace(2) TODO. Note need for TRAP_SCE and TRAP_SCX si_codes in PT_SYSCALL*. Note removal request of pthread_dbg(3). Sponsord by <The NetBSD Foundation>
Update TODO.ptrace Added: - reiterate over FreeBSD tests and add missing ones if applicable Sponsored by <The NetBSD Foundation>
Update TODO.ptrace Drop: - add ATF tests for PIOD_READ_AUXV Add new entry: - research what happens when a tracee masks signals (including SIGTRAP) and a breakpoint is triggered Sponsored by <The NetBSD Foundation>
Update TODO.ptrace Removed: - evaluate equivalent for PTRACE_O_TRACECLONE from Linux clone(2)-like calls are traced with PTRACE_FORK, PTRACE_VFORK and PTRACE_VFORK_DONE. VFORK ones block parent till termination or execve(2) of its child. Added: - add proper implementation of PTRACE_VFORK for vfork(2)-like events Currently PTRACE_VFORK is a stub. Sponsored by <The NetBSD Foundation>
Update TODO.ptrace 1. siginfo_t accessors done 2. PTRACE_O_TRACEEXIT not applicable for NetBSD as we are tracing the whole process at once, not per thread 3. PTRACE_O_TRACEEXEC implemented as SIGTRAP & TRAP_EXEC Sponsored by <The NetBSD Foundation>
Sync with HEAD. (Note that most of these changes are simply $NetBSD$ tag issues.)
file TODO.ptrace was added on branch pgoyette-localcount on 2017-01-07 08:53:45 +0000
Update TODO.ptrace Mark exect(3) for removal, there is no use-case for it. exec() is already monitored and emits SIGTRAP when traced. Accessor for siginfo_t is not case for PT_IO -- it's not reading/writing process space of other process, but shared kernel space.
Add new entry in TODO.ptrace + add support to read and write siginfo_t from and to tracee (reuse PT_IO?) Sponsored by <The NetBSD Foundation>
Add new entry in TODO.ptrace + add ATF tests for PT_SYSCALL and PT_SYSCALLEMU Sponsored by <The NetBSD Foundation>
Add new entry in TODO.ptrace New entry: - add ATF tests for SIGCHLD
TODO.ptrace: Update notes about MD documentation Currently all the MD interfaces are documented, remove this line from TODO. Add new note: once the API for hardware watchpoints will stabilize, document it Sponsored by <The NetBSD Foundation>
Update TODO.ptrace with recent changes Hardware assisted breakpoint/watchpoint API has been merged with current. Add note about pthread_dbg(3) API needed to be refactored and limited to querying POSIX thread private data fields. Sponsored by <The NetBSD Foundation>
Add new entries to TODO.ptrace - add support for detecting equivalent events to PTRACE_O_TRACEEXEC, PTRACE_O_TRACECLONE, PTRACE_O_TRACEEXIT from Linux - exect(3) rething or remove -- maybe PT_TRACE_ME + PTRACE_O_TRACEEXEC? Sponsored by <The NetBSD Foundation>
Update TODO.ptrace Add new entries: - add support for PT_STEP, PT_GETREGS, PT_SETREGS, PT_GETFPREGS, PT_SETFPREGS in all ports - integrate all ptrace(2) features in gdb - add ptrace(2) NetBSD support in LLDB Sponsored by <The NetBSD Foundation>
Add initial TODO list for the ptrace(2) (and procfs) interface. Sponsored by <The NetBSD Foundation>