b1fc0ec1a7
real uid, saved uid, real gid, and saved gid to ucred, as well as the pcred->pc_uidinfo, which was associated with the real uid, only rename it to cr_ruidinfo so as not to conflict with cr_uidinfo, which corresponds to the effective uid. o Remove p_cred from struct proc; add p_ucred to struct proc, replacing original macro that pointed. p->p_ucred to p->p_cred->pc_ucred. o Universally update code so that it makes use of ucred instead of pcred, p->p_ucred instead of p->p_pcred, cr_ruidinfo instead of p_uidinfo, cr_{r,sv}{u,g}id instead of p_*, etc. o Remove pcred0 and its initialization from init_main.c; initialize cr_ruidinfo there. o Restruction many credential modification chunks to always crdup while we figure out locking and optimizations; generally speaking, this means moving to a structure like this: newcred = crdup(oldcred); ... p->p_ucred = newcred; crfree(oldcred); It's not race-free, but better than nothing. There are also races in sys_process.c, all inter-process authorization, fork, exec, and exit. o Remove sigio->sio_ruid since sigio->sio_ucred now contains the ruid; remove comments indicating that the old arrangement was a problem. o Restructure exec1() a little to use newcred/oldcred arrangement, and use improved uid management primitives. o Clean up exit1() so as to do less work in credential cleanup due to pcred removal. o Clean up fork1() so as to do less work in credential cleanup and allocation. o Clean up ktrcanset() to take into account changes, and move to using suser_xxx() instead of performing a direct uid==0 comparision. o Improve commenting in various kern_prot.c credential modification calls to better document current behavior. In a couple of places, current behavior is a little questionable and we need to check POSIX.1 to make sure it's "right". More commenting work still remains to be done. o Update credential management calls, such as crfree(), to take into account new ruidinfo reference. o Modify or add the following uid and gid helper routines: change_euid() change_egid() change_ruid() change_rgid() change_svuid() change_svgid() In each case, the call now acts on a credential not a process, and as such no longer requires more complicated process locking/etc. They now assume the caller will do any necessary allocation of an exclusive credential reference. Each is commented to document its reference requirements. o CANSIGIO() is simplified to require only credentials, not processes and pcreds. o Remove lots of (p_pcred==NULL) checks. o Add an XXX to authorization code in nfs_lock.c, since it's questionable, and needs to be considered carefully. o Simplify posix4 authorization code to require only credentials, not processes and pcreds. Note that this authorization, as well as CANSIGIO(), needs to be updated to use the p_cansignal() and p_cansched() centralized authorization routines, as they currently do not take into account some desirable restrictions that are handled by the centralized routines, as well as being inconsistent with other similar authorization instances. o Update libkvm to take these changes into account. Obtained from: TrustedBSD Project Reviewed by: green, bde, jhb, freebsd-arch, freebsd-audit |
||
---|---|---|
.. | ||
exec_ecoff.h | ||
imgact_osf1.c | ||
Makefile | ||
osf1_ioctl.c | ||
osf1_misc.c | ||
osf1_mount.c | ||
osf1_proto.h | ||
osf1_signal.c | ||
osf1_signal.h | ||
osf1_syscall.h | ||
osf1_sysent.c | ||
osf1_sysvec.c | ||
osf1_util.h | ||
osf1.h | ||
README.mach-traps | ||
syscalls.conf | ||
syscalls.master |
$NetBSD: README.mach-traps,v 1.2 1999/03/23 09:19:25 itohy Exp $ $FreeBSD$ Some Alpha AXP OSF/1 binaries directly use the facilities provided by the Mach kernel that is the basis for OSF/1. These include (but are surely not limited to) 'dd', 'ps', and 'w'. Invariably, the symptom that these binaries display is that they crash with an "unimplemented system call" trap (SIGSYS signal) for a syscall that has a negative number. In general, binaries that use the Mach syscalls appear to invoke task_self() as their first syscall. The name, number, and number of arguments for each Mach syscall is given below; this information was gleaned by looking through the OSF/1 libmach.a's object files with dbx, then double-checked against the contents of OSF/1's <mach/syscall_sw.h>. These calls would be very difficult to implement properly in the OSF/1 emulation code; by its very nature, NetBSD is not Mach, and we don't and can't provide the underlying facilities that it does. -- cgd trap name number nargs notes ---- ---- ------ ----- ----- task_self -10 0 thread_reply -11 0 task_notify -12 0 thread_self -13 0 msg_send_old -14 3 msg_receive_old -15 3 msg_rpc_old -16 5 msg_send_trap -20 4 msg_receive_trap -21 5 msg_rpc_trap -22 6 lw_wire -30 3 lw_unwire -31 1 nxm_task_init -33 2 nxm_sched_thread -34 1 nxm_idle -35 1 nxm_wakeup_idle -36 1 nxm_set_pthid -37 2 nxm_thread_kill -38 2 nxm_thread_block -39 1 nxm_thread_wakeup -40 1 inode_swap_preference -40 3 old call? init_process -41 0 map_fd -43 5 nxm_resched -44 2 htg_unix_syscall -52 3 host_self -55 1 host_priv_self -56 1 swtch_pri -59 1 swtch -60 0 thread_switch -61 3 semop_fast -62 4 mach_sctimes_0 -70 0 only if MACH_SCTIMES defined mach_sctimes_1 -71 1 only if MACH_SCTIMES defined mach_sctimes_2 -72 2 only if MACH_SCTIMES defined mach_sctimes_3 -73 3 only if MACH_SCTIMES defined mach_sctimes_4 -74 4 only if MACH_SCTIMES defined mach_sctimes_5 -75 5 only if MACH_SCTIMES defined mach_sctimes_6 -76 6 only if MACH_SCTIMES defined mach_sctimes_7 -77 0 only if MACH_SCTIMES defined mach_sctimes_8 -78 6 only if MACH_SCTIMES defined mach_sctimes_9 -79 1 only if MACH_SCTIMES defined mach_sctimes_10 -80 2 only if MACH_SCTIMES defined mach_sctimes_11 -81 2 only if MACH_SCTIMES defined mach_sctimes_port_alloc_dealloc -82 1 only if MACH_SCTIMES defined