summaryrefslogtreecommitdiff
path: root/sys/miscfs/procfs/procfs_status.c
Commit message (Collapse)AuthorAgeFilesLines
* - FDESC, FIFO, NULL, PORTAL, PROC, UMAP and UNION fileRuslan Ermilov2001-05-231-265/+0
| | | | | | | | | | | | | | | | | | systems were repo-copied from sys/miscfs to sys/fs. - Renamed the following file systems and their modules: fdesc -> fdescfs, portal -> portalfs, union -> unionfs. - Renamed corresponding kernel options: FDESC -> FDESCFS, PORTAL -> PORTALFS, UNION -> UNIONFS. - Install header files for the above file systems. - Removed bogus -I${.CURDIR}/../../sys CFLAGS from userland Makefiles. Notes: svn path=/head/; revision=77031
* Undo part of the tangle of having sys/lock.h and sys/mutex.h included inMark Murray2001-05-011-5/+8
| | | | | | | | | | | | | | 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) Notes: svn path=/head/; revision=76166
* Protect read to p_pptr with proc lock rather than proctree lock.John Baldwin2001-03-071-2/+2
| | | | Notes: svn path=/head/; revision=73919
* o Move per-process jail pointer (p->pr_prison) to inside of the subjectRobert Watson2001-02-211-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 Notes: svn path=/head/; revision=72786
* Change and clean the mutex lock interface.Bosko Milekic2001-02-091-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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) Notes: svn path=/head/; revision=72200
* - Catch up to proc flag changes.John Baldwin2001-01-241-2/+6
| | | | Notes: svn path=/head/; revision=71569
* Protect proc.p_pptr and proc.p_children/p_sibling with theJake Burkholder2000-12-231-0/+2
| | | | | | | | | | | proctree_lock. linprocfs not locked pending response from informal maintainer. Reviewed by: jhb, -smp@ Notes: svn path=/head/; revision=70317
* More paranoia against overflowsEivind Eklund2000-11-081-18/+45
| | | | Notes: svn path=/head/; revision=68505
* Fix overflow from jail hostname.Eivind Eklund2000-11-011-1/+1
| | | | | | | Bug found by: Esa Etelavuori <eetelavu@cc.hut.fi> Notes: svn path=/head/; revision=68199
* o Centralize inter-process access control, introducing:Robert Watson2000-08-301-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | int p_can(p1, p2, operation, privused) which allows specification of subject process, object process, inter-process operation, and an optional call-by-reference privused flag, allowing the caller to determine if privilege was required for the call to succeed. This allows jail, kern.ps_showallprocs and regular credential-based interaction checks to occur in one block of code. Possible operations are P_CAN_SEE, P_CAN_SCHED, P_CAN_KILL, and P_CAN_DEBUG. p_can currently breaks out as a wrapper to a series of static function checks in kern_prot, which should not be invoked directly. o Commented out capabilities entries are included for some checks. o Update most inter-process authorization to make use of p_can() instead of manual checks, PRISON_CHECK(), P_TRESPASS(), and kern.ps_showallprocs. o Modify suser{,_xxx} to use const arguments, as it no longer modifies process flags due to the disabling of ASU. o Modify some checks/errors in procfs so that ENOENT is returned instead of ESRCH, further improving concealment of processes that should not be visible to other processes. Also introduce new access checks to improve hiding of processes for procfs_lookup(), procfs_getattr(), procfs_readdir(). Correct a bug reported by bp concerning not handling the CREATE case in procfs_lookup(). Remove volatile flag in procfs that caused apparently spurious qualifier warnigns (approved by bde). o Add comment noting that ktrace() has not been updated, as its access control checks are different from ptrace(), whereas they should probably be the same. Further discussion should happen on this topic. Reviewed by: bde, green, phk, freebsd-security, others Approved by: bde Obtained from: TrustedBSD Project Notes: svn path=/head/; revision=65237
* Fix typo "," vs ";"Peter Wemm1999-12-271-1/+1
| | | | | | | | PR: 15696 Submitted by: Takashi Okumura <taka@cs.pitt.edu> Notes: svn path=/head/; revision=55153
* Add a sysctl to control if argv is disclosed to the world:Poul-Henning Kamp1999-11-261-1/+1
| | | | | | | | | | kern.ps_argsopen It defaults to 1 which means that all users can see all argvs in ps(1). Reviewed by: Warner Notes: svn path=/head/; revision=53709
* Introduce the new functionPoul-Henning Kamp1999-11-211-1/+1
| | | | | | | | | | | | | | | | | p_trespass(struct proc *p1, struct proc *p2) which returns zero or an errno depending on the legality of p1 trespassing on p2. Replace kern_sig.c:CANSIGNAL() with call to p_trespass() and one extra signal related check. Replace procfs.h:CHECKIO() macros with calls to p_trespass(). Only show command lines to process which can trespass on the target process. Notes: svn path=/head/; revision=53518
* Make proc/*/cmdline use the cached argv if available.Poul-Henning Kamp1999-11-171-21/+31
| | | | | | | | Submitted by: Paul Saab <paul@mu.org> Reviewed by: phk Notes: svn path=/head/; revision=53301
* $Id$ -> $FreeBSD$Peter Wemm1999-08-281-1/+1
| | | | Notes: svn path=/head/; revision=50477
* Let processes retrieve their argv through procfs. Revert to the originalMarcel Moolenaar1999-08-191-8/+41
| | | | | | | | | behaviour in all other cases. Submitted by: Andrew Gordon <arg@arg1.demon.co.uk> Notes: svn path=/head/; revision=50061
* Don't call calcru() on a swapped-out process. calcru() access p_stats, whichDmitrij Tejblum1999-05-221-16/+10
| | | | | | | is in U-area. Notes: svn path=/head/; revision=47407
* This Implements the mumbled about "Jail" feature.Poul-Henning Kamp1999-04-281-1/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a seriously beefed up chroot kind of thing. The process is jailed along the same lines as a chroot does it, but with additional tough restrictions imposed on what the superuser can do. For all I know, it is safe to hand over the root bit inside a prison to the customer living in that prison, this is what it was developed for in fact: "real virtual servers". Each prison has an ip number associated with it, which all IP communications will be coerced to use and each prison has its own hostname. Needless to say, you need more RAM this way, but the advantage is that each customer can run their own particular version of apache and not stomp on the toes of their neighbors. It generally does what one would expect, but setting up a jail still takes a little knowledge. A few notes: I have no scripts for setting up a jail, don't ask me for them. The IP number should be an alias on one of the interfaces. mount a /proc in each jail, it will make ps more useable. /proc/<pid>/status tells the hostname of the prison for jailed processes. Quotas are only sensible if you have a mountpoint per prison. There are no privisions for stopping resource-hogging. Some "#ifdef INET" and similar may be missing (send patches!) If somebody wants to take it from here and develop it into more of a "virtual machine" they should be most welcome! Tools, comments, patches & documentation most welcome. Have fun... Sponsored by: http://www.rndassociates.com/ Run for almost a year by: http://www.servetheweb.com/ Notes: svn path=/head/; revision=46155
* A partial implementation of the procfs cmdline pseudo-file. ThisPeter Wemm1999-01-051-1/+38
| | | | | | | | | | | is enough to satisfy things like StarOffice. This is a hack, but doing it properly would be a LOT of work, and would require extensive grovelling around in the user address space to find the argv[]. Obtained from: Mostly from Andrzej Bialecki <abial@nask.pl>. Notes: svn path=/head/; revision=42301
* Fixed printf format errors.Bruce Evans1998-07-111-6/+6
| | | | Notes: svn path=/head/; revision=37555
* Removed unused #includes.Bruce Evans1997-08-021-4/+1
| | | | Notes: svn path=/head/; revision=27845
* Don't include <sys/ioctl.h> in the kernel. Stage 1: don't includeBruce Evans1997-03-241-2/+1
| | | | | | | | it when it is not used. In most cases, the reasons for including it went away when the special ioctl headers became self-sufficient. Notes: svn path=/head/; revision=24203
* Back out part 1 of the MCFH that changed $Id$ to $FreeBSD$. We are notPeter Wemm1997-02-221-1/+1
| | | | | | | ready for it yet. Notes: svn path=/head/; revision=22975
* This is the kernel Lite/2 commit. There are some requisite userlandJohn Dyson1997-02-101-2/+3
| | | | | | | | | | | | | | | | | | changes, so don't expect to be able to run the kernel as-is (very well) without the appropriate Lite/2 userland changes. The system boots and can mount UFS filesystems. Untested: ext2fs, msdosfs, NFS Known problems: Incorrect Berkeley ID strings in some files. Mount_std mounts will not work until the getfsent library routine is changed. Reviewed by: various people Submitted by: Jeffery Hsu <hsu@freebsd.org> Notes: svn path=/head/; revision=22521
* Make the long-awaited change from $Id$ to $FreeBSD$Jordan K. Hubbard1997-01-141-1/+1
| | | | | | | | | | | This will make a number of things easier in the future, as well as (finally!) avoiding the Id-smashing problem which has plagued developers for so long. Boy, I'm glad we're not using sup anymore. This update would have been insane otherwise. Notes: svn path=/head/; revision=21673
* add ruid and rgid to file 'status'Wolfram Schneider1996-02-021-4/+12
| | | | Notes: svn path=/head/; revision=13838
* Remove trailing whitespace.Rodney W. Grimes1995-05-301-2/+2
| | | | Notes: svn path=/head/; revision=8876
* Cosmetics. reduce the noise from gcc -Wall.Poul-Henning Kamp1994-10-101-5/+5
| | | | Notes: svn path=/head/; revision=3496
* Added $Id$David Greenman1994-08-021-2/+1
| | | | Notes: svn path=/head/; revision=1817
* BSD 4.4 Lite Kernel SourcesRodney W. Grimes1994-05-241-0/+145
Notes: svn path=/head/; revision=1541