summaryrefslogtreecommitdiffstats
path: root/sys/fs/procfs/procfs.h
Commit message (Collapse)AuthorAgeFilesLines
* Add per-process osrel node to the procfs, to allow read and set p_osrelkib2009-09-231-0/+1
| | | | | | | value for the process. Approved by: des (procfs maintainer) MFC after: 3 weeks
* /* -> /*- for copyright notices, minor format tweaks as necessaryimp2005-01-061-1/+1
|
* Remove advertising clause from University of California Regent'simp2004-04-071-4/+0
| | | | | | | license, per letter dated July 22, 1999 and email from Peter Wemm, Alan Cox and Robert Watson. Approved by: core, peter, alc, rwatson
* Slightly change the semantics of vnode labels for MAC: rather thanrwatson2002-10-261-3/+0
| | | | | | | | | | | | | | | | | | | | | "refreshing" the label on the vnode before use, just get the label right from inception. For single-label file systems, set the label in the generic VFS getnewvnode() code; for multi-label file systems, leave the labeling up to the file system. With UFS1/2, this means reading the extended attribute during vfs_vget() as the inode is pulled off disk, rather than hitting the extended attributes frequently during operations later, improving performance. This also corrects sematics for shared vnode locks, which were not previously present in the system. This chances the cache coherrency properties WRT out-of-band access to label data, but in an acceptable form. With UFS1, there is a small race condition during automatic extended attribute start -- this is not present with UFS2, and occurs because EAs aren't available at vnode inception. We'll introduce a work around for this shortly. Approved by: re Obtained from: TrustedBSD Project Sponsored by: DARPA, Network Associates Laboratories
* Introduce support for Mandatory Access Control and extensiblerwatson2002-08-011-0/+3
| | | | | | | | | | | kernel access control. Modify procfs so that (when mounted multilabel) it exports process MAC labels as the vnode labels of procfs vnodes associated with processes. Approved by: des Obtained from: TrustedBSD Project Sponsored by: DARPA, NAI Labs
* Spelling fix for comment.rwatson2002-04-201-1/+1
|
* Remove an obsolete prototype for procfs_kmemaccess().des2001-12-111-3/+0
| | | | Submitted by: rwatson
* Fix a KSEfication brain-o in procfs_doprocfile(): return the path of the ↵des2001-12-081-0/+2
| | | | | | | | | target process, not the calling process. While we're here, also unstaticize procfs_doprocfile() and procfs_docurproc() so linprocfs can call them directly instead of duplicating them. Submitted by: Dominic Mitchell <dom@semantico.com>
* Pseudofsize procfs(5).des2001-12-041-99/+20
|
* Dissociate ptrace from procfs.des2001-10-071-9/+0
| | | | | | | | | | | | | | | | | Until now, the ptrace syscall was implemented as a wrapper that called various functions in procfs depending on which ptrace operation was requested. Most of these functions were themselves wrappers around procfs_{read,write}_{,db,fp}regs(), with only some extra error checks, which weren't necessary in the ptrace case anyway. This commit moves procfs_rwmem() from procfs_mem.c into sys_process.c (renaming it to proc_rwmem() in the process), and implements ptrace() directly in terms of procfs_{read,write}_{,db,fp}regs() instead of having it fake up a struct uio and then call procfs_do{,db,fp}regs(). It also moves the prototypes for procfs_{read,write}_{,db,fp}regs() and proc_rwmem() from proc.h to ptrace.h, and marks all procfs files except procfs_machdep.c as "optional procfs" instead of "standard".
* KSE Milestone 2julian2001-09-121-14/+14
| | | | | | | | | | | | | | 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
* Remove dangling prototype for the now defunct procfs_kmemaccess()rwatson2001-08-031-3/+0
| | | | | | call. Obtained from: TrustedBSD Project
* Prior to support for almost all ps activity via sysctl, ps used procfs,rwatson2001-08-031-2/+0
| | | | | | | | | | | | | | | | | | | | and so special-casing was introduced to provide extra procfs privilege to the kmem group. With the advent of non-setgid kmem ps, this code is no longer required, and in fact, can is potentially harmful as it allocates privilege to a gid that is increasingly less meaningful. Knowledge of specific gid's in kernel is also generally bad precedent, as the kernel security policy doesn't distinguish gid's specifically, only uid 0. This commit removes reference to kmem in procfs, both in terms of access control decisions, and the applying of gid kmem to the /proc/*/mem file, simplifying the associated code considerably. Processes are still permitted to access the mem file based on the debugging policy, so ps -e still works fine for normal processes and use. Reviewed by: tmm Obtained from: TrustedBSD Project
* Change the pfind() and zpfind() functions to lock the process that theyjhb2001-04-241-1/+1
| | | | | | find before releasing the allproc lock and returning. Reviewed by: -smp, dfr, jake
* Move procfs_fullpath() to vfs_cache.c, with a rename to textvp_fullpath().green2000-04-261-1/+0
| | | | | | | | | | There's no excuse to have code in synthetic filestores that allows direct references to the textvp anymore. Feature requested by: msmith Feature agreed to by: warner Move requested by: phk Move agreed to by: bde
* Welcome back our old friend from procfs, "file"!green2000-04-221-0/+1
|
* Change #ifdef KERNEL to #ifdef _KERNEL in the public headers. "KERNEL"peter1999-12-291-2/+2
| | | | | | is an application space macro and the applications are supposed to be free to use it as they please (but cannot). This is consistant with the other BSD's who made this change quite some time ago. More commits to come.
* Introduce the new functionphk1999-11-211-13/+0
| | | | | | | | | | | | | | 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.
* s/p_cred->pc_ucred/p_ucred/gphk1999-11-211-1/+1
|
* A process should be able to examine itself.sef1999-11-201-2/+3
|
* $Id$ -> $FreeBSD$peter1999-08-281-1/+1
|
* Implement support for hardware debug registers on the i386.jlemon1999-07-091-1/+7
| | | | Submitted by: Brian Dean <brdean@unx.sas.com>
* Eliminate the bogus procfs private almost struct dirent structure.phk1999-06-131-14/+2
| | | | | Spotted by: Lars Hamren Reviewed by: bde
* Add even more () to CHECKIO which by now feels positively LISPish.phk1999-05-041-3/+4
| | | | | Submitted by: bde Reviewed by: phk
* Add a new "file" to procfs: "rlimit" which shows the resource limits forphk1999-04-301-2/+4
| | | | | | | | the process. PR: 11342 Submitted by: Adrian Chadd adrian@freebsd.org Reviewed by: phk
* This Implements the mumbled about "Jail" feature.phk1999-04-281-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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/
* Suser() simplification:phk1999-04-271-3/+2
| | | | | | | | | | | | | | | | | | | 1: s/suser/suser_xxx/ 2: Add new function: suser(struct proc *), prototyped in <sys/proc.h>. 3: s/suser_xxx(\([a-zA-Z0-9_]*\)->p_ucred, \&\1->p_acflag)/suser(\1)/ The remaining suser_xxx() calls will be scrutinized and dealt with later. There may be some unneeded #include <sys/cred.h>, but they are left as an exercise for Bruce. More changes to the suser() API will come along with the "jail" code.
* A partial implementation of the procfs cmdline pseudo-file. Thispeter1999-01-051-2/+4
| | | | | | | | 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>.
* Quick fix for type mismatches which were fatal if longs aren't 32bde1998-07-071-5/+5
| | | | | | | | bits. We used a private, wrong, version of `struct dirent' to help break getdirentries(), and we use a silly check that the size of this struct is a power of 2 to help break mount() if getdirentries() would not work. This fix just changes the struct to match `struct dirent' (except for the name length).
* Disallow reading the current kernel stack. Only the user structure andtegge1998-05-191-1/+4
| | | | | the current registers should be accessible. Reviewed by: David Greenman <dg@root.com>
* Fixed a missing/misplaced/misstyled prototype.bde1997-12-301-1/+3
|
* Some staticized variables were still declared to be extern.bde1997-09-071-2/+1
|
* Fix procfs security hole -- check permissions on meaningful I/Os (namely,sef1997-08-121-1/+13
| | | | | | | reading/writing of mem and regs). Also have to check for the requesting process being group KMEM -- this is a bit of a hack, but ps et al need it. Reviewed by: davidg
* Back out part 1 of the MCFH that changed $Id$ to $FreeBSD$. We are notpeter1997-02-221-1/+1
| | | | ready for it yet.
* This is the kernel Lite/2 commit. There are some requisite userlanddyson1997-02-101-24/+26
| | | | | | | | | | | | | | | 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>
* Make the long-awaited change from $Id$ to $FreeBSD$jkh1997-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.
* Implement locking for pfs nodes, when at the leaf. Concurrent accessdyson1996-07-021-1/+2
| | | | | | | to information from a single process causes hangs. Specifically, this fixes problems (hangs) with concurrent ps commands, when the system is under heavy memory load. Reviewed by: davidg
* Clean-up the new VM map procfs code, and also add support for executabledyson1996-06-181-2/+7
| | | | | format file "etype". It contains a description of the binary type for a process.
* Add a feature to procfs to allow display of the process address mapdyson1996-06-171-2/+3
| | | | | | | with multiple entries as follows: start address, end address, resident pages in range, private pages in range, RW/RO, COW or not, (vnode/device/swap/default).
* Major fixes for procfs..peter1996-01-241-1/+6
| | | | | | | | | | | | | | | | Implement a "variable" directory structure. Files that do not make sense for the given process do not "appear" and cannot be opened. For example, "system" processes do not have "file", "regs" or "fpregs", because they do not have a user area. "attempt" to fill in the user area of a given process when it is being accessed via /proc/pid/mem (the user struct is just after VM_MAXUSER_ADDRESS in the process address space.) Dont do IO to the U area while it's swapped, hold it in place if possible. Lock off access to the "ctl" file if it's done a setuid like the other pseudo-files in there.
* Moved declarations for static functions to the correct place (not in abde1995-11-161-44/+1
| | | | | | header). Removed stupid comments.
* Introduced a type `vop_t' for vnode operation functions and usedbde1995-11-091-2/+2
| | | | | | | | | | | | | | | it 1138 times (:-() in casts and a few more times in declarations. This change is null for the i386. The type has to be `typedef int vop_t(void *)' and not `typedef int vop_t()' because `gcc -Wstrict-prototypes' warns about the latter. Since vnode op functions are called with args of different (struct pointer) types, neither of these function types is any use for type checking of the arg, so it would be preferable not to use the complete function type, especially since using the complete type requires adding 1138 casts to avoid compiler warnings and another 40+ casts to reverse the function pointer conversions before calling the functions.
* Make a lot of private stuff static.phk1995-11-071-14/+14
| | | | | | | | | Should anybody out there wonder about this vendetta against global variables, it is basically to make it more visible what our interfaces in the kernel really are. I'm almost convinced we should have a #define PUBLIC /* public interface */ and use it in the #includes...
* Fixed panic that resulted from mmaping files in kernfs and procfs. Adg1995-05-251-2/+2
| | | | | | | | | | regular user could panic the machine with a simple "tail /proc/curproc/mem" command. The problem was twofold: both kernfs and procfs didn't fill in the mnt_stat statfs struct (which would later lead to an integer divide fault in the vnode pager), and kernfs bogusly paniced if a bmap was attempted. Reviewed by: John Dyson
* Made /proc/n/mem file group kmem and group readable. Needed to fix ps sodg1995-04-151-1/+2
| | | | that it doesn't need to be setuid root.
* Add and move declarations to fix all of the warnings from `gcc -Wimplicit'bde1995-03-161-1/+3
| | | | | | (except in netccitt, netiso and netns) and most of the warnings from `gcc -Wnested-externs'. Fix all the bugs found. There were no serious ones.
* Added $Id$dg1994-08-021-2/+1
|
* BSD 4.4 Lite Kernel Sourcesrgrimes1994-05-241-0/+186
OpenPOWER on IntegriCloud