summaryrefslogtreecommitdiffstats
path: root/sys/compat/linprocfs
Commit message (Collapse)AuthorAgeFilesLines
* Part 1 of KSE-IIIjulian2002-06-291-19/+44
| | | | | | | | | | | | | The ability to schedule multiple threads per process (one one cpu) by making ALL system calls optionally asynchronous. to come: ia64 and power-pc patches, patches for gdb, test program (in tools) Reviewed by: Almost everyone who counts (at various times, peter, jhb, matt, alfred, mini, bernd, and a cast of thousands) NOTE: this is still Beta code, and contains lots of debugging stuff. expect slight instability in signals..
* Change p_can{debug,see,sched,signal}()'s first argument to be a threadjhb2002-05-191-1/+1
| | | | | | | pointer instead of a proc pointer and require the process pointed to by the second argument to be locked. We now use the thread ucred reference for the credential checks in p_can*() as a result. p_canfoo() should now no longer need Giant.
* - p_cansee() needs the target process locked.jhb2002-04-131-17/+15
| | | | - We need the proc lock held for more of procfs_doprocstatus().
* - Change fill_kinfo_proc() to require that the process is locked when itjhb2002-04-091-2/+2
| | | | | | | | | | | | | | is called. - Change sysctl_out_proc() to require that the process is locked when it is called and to drop the lock before it returns. If this proves too complex we can change sysctl_out_proc() to simply acquire the lock at the very end and have the calling code drop the lock right after it returns. - Lock the process we are going to export before the p_cansee() in the loop in sysctl_kern_proc() and hold the lock until we call sysctl_out_proc(). - Don't call p_cansee() on the process about to be exported twice in the aforementioned loop.
* Protect proc struct (p_args and p_comm) when doing procfs IO that pullsalfred2002-03-291-11/+17
| | | | | | data from it. Submitted by: Jonathan Mini <mini@haikugeek.com>
* Remove references to vm_zone.h and switch over to the new uma API.jeff2002-03-201-1/+0
|
* remove "discards qualifier" erro by not potentially writing tojulian2002-02-261-2/+5
| | | | a const *.
* Lock struct pgrp, session and sigio.tanimura2002-02-231-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | New locks are: - pgrpsess_lock which locks the whole pgrps and sessions, - pg_mtx which protects the pgrp members, and - s_mtx which protects the session members. Please refer to sys/proc.h for the coverage of these locks. Changes on the pgrp/session interface: - pgfind() needs the pgrpsess_lock held. - The caller of enterpgrp() is responsible to allocate a new pgrp and session. - Call enterthispgrp() in order to enter an existing pgrp. - pgsignal() requires a pgrp lock held. Reviewed by: jhb, alfred Tested on: cvsup.jp.FreeBSD.org (which is a quad-CPU machine running -current)
* Pull in more stuff from procfs now that it's been pseudofsized.des2001-12-091-31/+3
|
* o Introduce pr_mtx into struct prison, providing protection for therwatson2001-12-031-3/+8
| | | | | | | | | | | | | | | | | | mutable contents of struct prison (hostname, securelevel, refcount, pr_linux, ...) o Generally introduce mtx_lock()/mtx_unlock() calls throughout kern/ so as to enforce these protections, in particular, in kern_mib.c protection sysctl access to the hostname and securelevel, as well as kern_prot.c access to the securelevel for access control purposes. o Rewrite linux emulator abstractions for accessing per-jail linux mib entries (osname, osrelease, osversion) so that they don't return a pointer to the text in the struct linux_prison, rather, a copy to an array passed into the calls. Likewise, update linprocfs to use these primitives. o Update in_pcb.c to always use prison_getip() rather than directly accessing struct prison. Reviewed by: jhb
* promote tv_sec in printf to make it type agnosticdillon2001-10-291-4/+4
|
* Reporting device drivers by traversing cdevsw[] is at best a hackphk2001-10-261-2/+6
| | | | | | | | | | | which may or may not return something which is partially right. Disable the "devices" file until we find out what this is needed for, and what exactly those apps need. This will allow cdevsw to become static again. Approved by: DES
* Add proc/mtab which simulates a Linux system's /etc/mtab.des2001-10-211-1/+72
|
* #if 0 out some code that depends on other uncommitted patches.des2001-10-191-0/+2
|
* Adapt to pseudofs changes (dynamic initialization, not static).des2001-10-191-67/+60
| | | | | Use the new linux_ifname() function from the linuxulator rather than roll our own interface name translation.
* Catch up with the visibility callback stuff, and give up trying to keep thedes2001-10-011-19/+37
| | | | file definitions on single lines.
* Specify readability and / or writeability for all nodes that need it.des2001-09-301-18/+18
|
* Adapt to pseudofs version 2. Sorry about the breakage - I had this readydes2001-09-291-20/+18
| | | | to commit along with the pseudofs patches, but just plain forgot.
* Clean up my source tree to avoid getting hit too badly by the next KSE ordes2001-09-251-20/+37
| | | | | whatever mega-commit. No real functional changes, just some experiments / work in progress.
* KSE Milestone 2julian2001-09-121-7/+7
| | | | | | | | | | | | | | Note ALL MODULES MUST BE RECOMPILED make the kernel aware that there are smaller units of scheduling than the process. (but only allow one thread per process at this time). This is functionally equivalent to teh previousl -current except that there is a thread associated with each process. Sorry john! (your next MFC will be a doosie!) Reviewed by: peter@freebsd.org, dillon@freebsd.org X-MFC after: ha ha ha ha
* o Replace calls to p_can(..., P_CAN_xxx) with calls to p_canxxx().rwatson2001-07-051-1/+1
| | | | | | | | | | | | | | | | | | | | | The p_can(...) construct was a premature (and, it turns out, awkward) abstraction. The individual calls to p_canxxx() better reflect differences between the inter-process authorization checks, such as differing checks based on the type of signal. This has a side effect of improving code readability. o Replace direct credential authorization checks in ktrace() with invocation of p_candebug(), while maintaining the special case check of KTR_ROOT. This allows ktrace() to "play more nicely" with new mandatory access control schemes, as well as making its authorization checks consistent with other "debugging class" checks. o Eliminate "privused" construct for p_can*() calls which allowed the caller to determine if privilege was required for successful evaluation of the access control check. This primitive is currently unused, and as such, serves only to complicate the API. Approved by: ({procfs,linprocfs} changes) des Obtained from: TrustedBSD Project
* Say one thing, do the other... nextpid -> lastpiddes2001-06-111-1/+1
|
* Implement proc/cpuinfo for the Alpha (thanks to gallatin).des2001-06-111-10/+160
| | | | Implement proc/pid/cmdline.
* Minor whitespace changes.des2001-06-111-57/+57
|
* These aren't needed any more.des2001-06-105-2163/+0
|
* New pseudofs-based linprocfs (repo-copied from linprocfs_misc.c).des2001-06-101-210/+142
|
* o Merge contents of struct pcred into struct ucred. Specifically, add therwatson2001-05-253-11/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Add new 'loadavg' entry, fix overflow with meminfo.jlemon2001-05-194-16/+84
| | | | | PR: 27253, 27350 Submitted by: Jim Pirzyk
* Introduce a global lock for the vm subsystem (vm_mtx).alfred2001-05-192-0/+2
| | | | | | | | | | | | | | | | | | | vm_mtx does not recurse and is required for most low level vm operations. faults can not be taken without holding Giant. Memory subsystems can now call the base page allocators safely. Almost all atomic ops were removed as they are covered under the vm mutex. Alpha and ia64 now need to catch up to i386's trap handlers. FFS and NFS have been tested, other filesystems will need minor changes (grabbing the vm lock when twiddling page properties). Reviewed (partially) by: jake, jhb
* Avoid overflow when converting ticks to jiffies.des2001-05-092-2/+2
| | | | | PR: 27215 Submitted by: Jim Pirzyk <Jim.Pirzyk@disney.com>
* Fix the problem of some directory entries going missing whenjlemon2001-05-041-2/+1
| | | | | | read by the linux version of 'ls'. Spotted by: rwatson
* Undo part of the tangle of having sys/lock.h and sys/mutex.h included inmarkm2001-05-014-14/+23
| | | | | | | | | | | other "system" header files. Also help the deprecation of lockmgr.h by making it a sub-include of sys/lock.h and removing sys/lockmgr.h form kernel .c files. Sort sys/*.h includes where possible in affected files. OK'ed by: bde (with reservations)
* Add a vop_stdbmap(), and make it part of the default vop vector.phk2001-04-291-32/+0
| | | | | | Make 7 filesystems which don't really know about VOP_BMAP rely on the default vector, rather than more or less complete local vop_nopbmap() implementations.
* Change the pfind() and zpfind() functions to lock the process that theyjhb2001-04-245-32/+33
| | | | | | find before releasing the allproc lock and returning. Reviewed by: -smp, dfr, jake
* Add missing includes of <sys/sx.h>jhb2001-03-281-0/+1
| | | | Reported by: peter
* Convert the allproc and proctree locks from lockmgr locks to sx locks.jhb2001-03-281-2/+2
|
* Eliminate global node types and instead use an operations vector forjlemon2001-03-126-687/+564
| | | | | | | | | each node in order to make it easier to add new entries. Rewrite the internal directory structure so that it is possible to have independent subdirectories. Utilize this to add /proc/net/dev. Reviewed by: DES
* Grab the process lock while calling psignal and before calling psignal.jhb2001-03-071-3/+3
|
* Just hold the proc lock while getting the parent's PID rather than ajhb2001-03-072-20/+10
| | | | proctree lock.
* Reviewed by: jlemonadrian2001-03-011-3/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | An initial tidyup of the mount() syscall and VFS mount code. This code replaces the earlier work done by jlemon in an attempt to make linux_mount() work. * the guts of the mount work has been moved into vfs_mount(). * move `type', `path' and `flags' from being userland variables into being kernel variables in vfs_mount(). `data' remains a pointer into userspace. * Attempt to verify the `type' and `path' strings passed to vfs_mount() aren't too long. * rework mount() and linux_mount() to take the userland parameters (besides data, as mentioned) and pass kernel variables to vfs_mount(). (linux_mount() already did this, I've just tidied it up a little more.) * remove the copyin*() stuff for `path'. `data' still requires copyin*() since its a pointer into userland. * set `mount->mnt_statf_mntonname' in vfs_mount() rather than in each filesystem. This variable is generally initialised with `path', and each filesystem can override it if they want to. * NOTE: f_mntonname is intiailised with "/" in the case of a root mount.
* o Move per-process jail pointer (p->pr_prison) to inside of the subjectrwatson2001-02-212-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | credential structure, ucred (cr->cr_prison). o Allow jail inheritence to be a function of credential inheritence. o Abstract prison structure reference counting behind pr_hold() and pr_free(), invoked by the similarly named credential reference management functions, removing this code from per-ABI fork/exit code. o Modify various jail() functions to use struct ucred arguments instead of struct proc arguments. o Introduce jailed() function to determine if a credential is jailed, rather than directly checking pointers all over the place. o Convert PRISON_CHECK() macro to prison_check() function. o Move jail() function prototypes to jail.h. o Emulate the P_JAILED flag in fill_kinfo_proc() and no longer set the flag in the process flags field itself. o Eliminate that "const" qualifier from suser/p_can/etc to reflect mutex use. Notes: o Some further cleanup of the linux/jail code is still required. o It's now possible to consider resolving some of the process vs credential based permission checking confusion in the socket code. o Mutex protection of struct prison is still not present, and is required to protect the reference count plus some fields in the structure. Reviewed by: freebsd-arch Obtained from: TrustedBSD Project
* Change and clean the mutex lock interface.bmilekic2001-02-092-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | mtx_enter(lock, type) becomes: mtx_lock(lock) for sleep locks (MTX_DEF-initialized locks) mtx_lock_spin(lock) for spin locks (MTX_SPIN-initialized) similarily, for releasing a lock, we now have: mtx_unlock(lock) for MTX_DEF and mtx_unlock_spin(lock) for MTX_SPIN. We change the caller interface for the two different types of locks because the semantics are entirely different for each case, and this makes it explicitly clear and, at the same time, it rids us of the extra `type' argument. The enter->lock and exit->unlock change has been made with the idea that we're "locking data" and not "entering locked code" in mind. Further, remove all additional "flags" previously passed to the lock acquire/release routines with the exception of two: MTX_QUIET and MTX_NOSWITCH The functionality of these flags is preserved and they can be passed to the lock/unlock routines by calling the corresponding wrappers: mtx_{lock, unlock}_flags(lock, flag(s)) and mtx_{lock, unlock}_spin_flags(lock, flag(s)) for MTX_DEF and MTX_SPIN locks, respectively. Re-inline some lock acq/rel code; in the sleep lock case, we only inline the _obtain_lock()s in order to ensure that the inlined code fits into a cache line. In the spin lock case, we inline recursion and actually only perform a function call if we need to spin. This change has been made with the idea that we generally tend to avoid spin locks and that also the spin locks that we do have and are heavily used (i.e. sched_lock) do recurse, and therefore in an effort to reduce function call overhead for some architectures (such as alpha), we inline recursion for this case. Create a new malloc type for the witness code and retire from using the M_DEV type. The new type is called M_WITNESS and is only declared if WITNESS is enabled. Begin cleaning up some machdep/mutex.h code - specifically updated the "optimized" inlined code in alpha/mutex.h and wrote MTX_LOCK_SPIN and MTX_UNLOCK_SPIN asm macros for the i386/mutex.h as we presently need those. Finally, caught up to the interface changes in all sys code. Contributors: jake, jhb, jasone (in no particular order)
* - Proc locking.jhb2001-01-233-27/+73
| | | | | | | - Use queue macros. - Use NULL instead of 0 for pointers. Reviewed by: des
* Protect proc.p_pptr with the proctree lock.jake2001-01-102-4/+20
|
* Use kinfo_proc instead of eproc (which Kirk deep-sixed earlier this week)des2000-12-132-216/+260
| | | | | | | | | | Generate a version string that looks just like a real Linux one - almost :) Use sbufs everywhere instead of sprintf(). Note that this is still imperfect, as the code does not check whether the sbuf overflowed - but it'll still work better than before, since if the sbuf overflows, the code now simply copies out 0 bytes instead of causing a trap (or worse, corrupting kernel structures)
* Add dependency on linux, which is needed for proc/version.des2000-12-131-0/+1
|
* Lock the allproc list.jake2000-12-131-1/+4
| | | | Approved by: DES
* Point #includes at compat/linprocfs instead of i386/linux/linprocfs.des2000-12-125-5/+5
|
* Add proc/<pid>/cmdline.des2000-12-093-1/+9
|
* Add a dependency on procfs.des2000-12-091-0/+1
|
OpenPOWER on IntegriCloud