Module Name:    src
Committed By:   martin
Date:           Thu Apr 12 13:42:49 UTC 2018

Modified Files:
        src/bin/ps [netbsd-8]: ps.1
        src/doc [netbsd-8]: TODO.ptrace
        src/sbin/mount_procfs [netbsd-8]: mount_procfs.8
        src/share/man/man9 [netbsd-8]: kauth.9
        src/sys/compat/linux/arch/arm [netbsd-8]: linux_ptrace.c
        src/sys/compat/linux/arch/i386 [netbsd-8]: linux_ptrace.c
        src/sys/compat/linux/arch/powerpc [netbsd-8]: linux_ptrace.c
        src/sys/compat/netbsd32 [netbsd-8]: netbsd32.h netbsd32_ptrace.c
        src/sys/kern [netbsd-8]: kern_exit.c kern_proc.c kern_sig.c
            sys_ptrace.c sys_ptrace_common.c
        src/sys/miscfs/procfs [netbsd-8]: files.procfs procfs.h procfs_subr.c
            procfs_vfsops.c procfs_vnops.c
        src/sys/modules/procfs [netbsd-8]: Makefile
        src/sys/sys [netbsd-8]: kauth.h proc.h ptrace.h sysctl.h
Removed Files:
        src/sys/miscfs/procfs [netbsd-8]: procfs_ctl.c

Log Message:
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.

 - /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>

To generate a diff of this commit:
cvs rdiff -u -r1.106 -r1.106.6.1 src/bin/ps/ps.1
cvs rdiff -u -r1.28 -r1.28.4.1 src/doc/TODO.ptrace
cvs rdiff -u -r1.34 -r1.34.38.1 src/sbin/mount_procfs/mount_procfs.8
cvs rdiff -u -r1.107 -r1.107.4.1 src/share/man/man9/kauth.9
cvs rdiff -u -r1.19 -r1.19.10.1 src/sys/compat/linux/arch/arm/linux_ptrace.c
cvs rdiff -u -r1.31 -r1.31.10.1 src/sys/compat/linux/arch/i386/linux_ptrace.c
cvs rdiff -u -r1.29 -r1.29.10.1 \
cvs rdiff -u -r1.114 -r1.114.8.1 src/sys/compat/netbsd32/netbsd32.h
cvs rdiff -u -r1.4 -r1.4.6.1 src/sys/compat/netbsd32/netbsd32_ptrace.c
cvs rdiff -u -r1.43 -r1.43.8.1 src/sys/compat/netbsd32/netbsd32_signal.c
cvs rdiff -u -r1.268 -r1.268.8.1 src/sys/kern/kern_exit.c
cvs rdiff -u -r1.206.6.2 -r1.206.6.3 src/sys/kern/kern_proc.c
cvs rdiff -u -r1.336.4.1 -r1.336.4.2 src/sys/kern/kern_sig.c
cvs rdiff -u -r1.4 -r1.4.6.1 src/sys/kern/sys_ptrace.c
cvs rdiff -u -r1.22.2.1 -r1.22.2.2 src/sys/kern/sys_ptrace_common.c
cvs rdiff -u -r1.11 -r1.11.6.1 src/sys/miscfs/procfs/files.procfs
cvs rdiff -u -r1.71 -r1.71.6.1 src/sys/miscfs/procfs/procfs.h
cvs rdiff -u -r1.48 -r0 src/sys/miscfs/procfs/procfs_ctl.c
cvs rdiff -u -r1.108 -r1.108.6.1 src/sys/miscfs/procfs/procfs_subr.c
cvs rdiff -u -r1.97 -r1.97.6.1 src/sys/miscfs/procfs/procfs_vfsops.c
cvs rdiff -u -r1.197.2.1 -r1.197.2.2 src/sys/miscfs/procfs/procfs_vnops.c
cvs rdiff -u -r1.3 -r1.3.6.1 src/sys/modules/procfs/Makefile
cvs rdiff -u -r1.73.10.1 -r1.73.10.2 src/sys/sys/kauth.h
cvs rdiff -u -r1.340 -r1.340.6.1 src/sys/sys/proc.h
cvs rdiff -u -r1.60.6.1 -r1.60.6.2 src/sys/sys/ptrace.h
cvs rdiff -u -r1.223 -r1.223.6.1 src/sys/sys/sysctl.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Reply via email to