20415301cd
attempted to check for insecure and fatal eflags and segment selectors, but missed many cases and got the IOPL check back to front. The other syscalls didn't check at all. sys_process.c, machdep.c: Only allow PT_WRITE_U to write to the registers (ordinary and FP). psl.h, locore.s, machdep.c: Eliminate PSL_MBZ, PSL_MBO and PSL_USERCLR. We are not supposed to assume anything about the reserved bits. Use PSL_USERCHANGE and PSL_KERNEL instead. Rename PSL_USERSET to PSL_USER. exception.s: Define a private label for use by doreti when returning to user mode fails. machdep.c: In syscalls, allow changing only the eflags that can be changed on 486's in user mode (no longer attempt to allow benign IOPL changes; allow changing the nasty PSL_NT; don't allow changing the i586 bits). Don't attempt to check all the cases involving invalid selectors and %eip's. Just check for privilege violations and let the invalid things cause a trap. procfs_machdep.c: Call the ptrace register functions to do all the work for reading and writing ordinary registers and for single stepping. trap.c: Ignore traps caused by PSL_NT being set. Previously, users could cause a fatal trap in user mode by setting PSL_NT and executing an iret, and a fatal trap in kernel mode by setting PSL_NT and making a syscall. PSL_NT was cleared too late and not in enough modes to fix the problem. Make all traps in user mode (except T_NMI) nonfatal. Recover from traps caused by attempting to load invalid user registers in doreti by restarting the traps so that they appear to occur in user mode. --- Fix bogons that I noticed while fixing the above: psl.h: Fix some comments. Uniformize idempotency ifdef. exception.s, machdep.c: Remove rsvd[0-14]. rsvd0 hasn't been reserved since the 486 came out. Replace rsvd0 by `align'. rsvd[0-11] used wrong (magic non-unique) trap numbers. Replace rsvd[1-14] by rsvd. locore.s: Enable alignment check flag on 486's and 586's. machdep.c: Use a better type for kstack[]. Use TFREGP() to find the registers. Reformat ptrace functions from SEF to something closer to KNF. procfs_machdep.c: The wrong pointer to the registers got fixed as a side effect. Implement reading and writing of FP registers. /proc/*/*regs now work (only) for processes that are in memory. Clean up comments. trap.c, trap.h: Remove unused trap types. |
||
---|---|---|
.. | ||
imgact_aout.c | ||
imgact_gzip.c | ||
imgact_shell.c | ||
inflate.c | ||
init_main.c | ||
init_sysent.c | ||
kern_acct.c | ||
kern_clock.c | ||
kern_descrip.c | ||
kern_devconf.c | ||
kern_exec.c | ||
kern_exit.c | ||
kern_fork.c | ||
kern_ktrace.c | ||
kern_lkm.c | ||
kern_lockf.c | ||
kern_malloc.c | ||
kern_ntptime.c | ||
kern_physio.c | ||
kern_proc.c | ||
kern_prot.c | ||
kern_resource.c | ||
kern_sig.c | ||
kern_subr.c | ||
kern_synch.c | ||
kern_sysctl.c | ||
kern_tc.c | ||
kern_time.c | ||
kern_timeout.c | ||
kern_xxx.c | ||
Make.tags.inc | ||
Makefile | ||
makesyscalls.sh | ||
md5c.c | ||
subr_autoconf.c | ||
subr_clist.c | ||
subr_disklabel.c | ||
subr_diskmbr.c | ||
subr_diskslice.c | ||
subr_dkbad.c | ||
subr_log.c | ||
subr_param.c | ||
subr_prf.c | ||
subr_prof.c | ||
subr_rlist.c | ||
subr_rmap.c | ||
subr_trap.c | ||
subr_xxx.c | ||
sys_generic.c | ||
sys_process.c | ||
sys_socket.c | ||
syscalls.c | ||
syscalls.master | ||
sysv_ipc.c | ||
sysv_msg.c | ||
sysv_sem.c | ||
sysv_shm.c | ||
tty_compat.c | ||
tty_conf.c | ||
tty_cons.c | ||
tty_pty.c | ||
tty_subr.c | ||
tty_tb.c | ||
tty_tty.c | ||
tty.c | ||
uipc_domain.c | ||
uipc_mbuf.c | ||
uipc_proto.c | ||
uipc_sockbuf.c | ||
uipc_socket2.c | ||
uipc_socket.c | ||
uipc_syscalls.c | ||
uipc_usrreq.c | ||
vfs_bio.c | ||
vfs_cache.c | ||
vfs_cluster.c | ||
vfs_conf.c | ||
vfs_export.c | ||
vfs_extattr.c | ||
vfs_init.c | ||
vfs_lookup.c | ||
vfs_mount.c | ||
vfs_subr.c | ||
vfs_syscalls.c | ||
vfs_vnops.c | ||
vnode_if.pl | ||
vnode_if.sh | ||
vnode_if.src |