summaryrefslogtreecommitdiffstats
path: root/sys/fs/procfs/procfs.c
Commit message (Collapse)AuthorAgeFilesLines
* Add procfs to jail-mountable filesystems.mm2012-02-291-1/+1
| | | | | Reviewed by: jamie MFC after: 1 week
* Convert files to UTF-8uqs2012-01-151-1/+1
|
* Do not return success and a string "unknown" when vn_fullpath() was unablekib2011-08-161-6/+9
| | | | | | | | | to resolve the path of the text vnode of the process. The behaviour is very confusing for any consumer of the procfs, in particular, java. Reported and tested by: bf MFC after: 2 weeks Approved by: re (bz)
* Add per-process osrel node to the procfs, to allow read and set p_osrelkib2009-09-231-1/+4
| | | | | | | value for the process. Approved by: des (procfs maintainer) MFC after: 3 weeks
* Fix a logic bug that caused the pfs_attr method to be called only fordes2009-02-161-5/+5
| | | | | | | PFS_PROCDEP nodes. Submitted by: Andrew Brampton <brampton@gmail.com> MFC after: 2 weeks
* Remove unnecessary locking around vn_fullpath(). The vnode lock for thejhb2008-11-041-8/+4
| | | | | | | | | | | | | | | | vnode in question does not need to be held. All the data structures used during the name lookup are protected by the global name cache lock. Instead, the caller merely needs to ensure a reference is held on the vnode (such as vhold()) to keep it from being freed. In the case of procfs' <pid>/file entry, grab the process lock while we gain a new reference (via vhold()) on p_textvp to fully close races with execve(2). For the kern.proc.vmmap sysctl handler, use a shared vnode lock around the call to VOP_GETATTR() rather than an exclusive lock. MFC after: 1 month
* VOP_LOCK1() (and so VOP_LOCK()) and VOP_UNLOCK() are only used inattilio2008-01-131-1/+1
| | | | | | | | | | | conjuction with 'thread' argument passing which is always curthread. Remove the unuseful extra-argument and pass explicitly curthread to lower layer functions, when necessary. KPI results broken by this change, which should affect several ports, so version bumping and manpage update will be further committed. Tested by: kris, pho, Diego Sardina <siarodx at gmail dot com>
* vn_lock() is currently only used with the 'curthread' passed as argument.attilio2008-01-101-1/+1
| | | | | | | | | | | | | | | | Remove this argument and pass curthread directly to underlying VOP_LOCK1() VFS method. This modify makes the code cleaner and in particular remove an annoying dependence helping next lockmgr() cleanup. KPI results, obviously, changed. Manpage and FreeBSD_version will be updated through further commits. As a side note, would be valuable to say that next commits will address a similar cleanup about VFS methods, in particular vop_lock1 and vop_unlock. Tested by: Diego Sardina <siarodx at gmail dot com>, Andrea Di Pasquale <whyx dot it at gmail dot com>
* Add a pn_destroy field to pfs_node. This field points to a destructordes2007-03-121-15/+15
| | | | | | | | | | | | | function which is called from pfs_destroy() before the node is reclaimed. Modify pfs_create_{dir,file,link}() to accept a pointer to a destructor function in addition to the usual attr / fill / vis pointers. This breaks both the programming and binary interfaces between pseudofs and its consumers. It is believed that there are no pseudofs consumers outside the source tree, so that the impact of this change is minimal. Submitted by: Aniruddha Bohra <bohra@cs.rutgers.edu>
* Fix the race of dereferencing /proc/<pid>/file with execve(2) by cachingkib2007-02-071-4/+12
| | | | | | | | | the value of p_textvp. This way, we always unlock the locked vnode. While there, vhold() the vnode around the vn_lock(). Reported and tested by: Guy Helmer (ghelmer palisadesys com) Approved by: des (procfs maintainer) MFC after: 1 week
* Upon further review, DES prefers this change over that in revision 1.13ghelmer2006-06-051-6/+4
| | | | | | | to resolve the directory access problem for processes with P_SUGID flag set. Suggested by: des
* Revision 1.4 set access for all sensitive files in /proc/<PID> to mode 0ghelmer2006-05-241-3/+6
| | | | | | | | | | if a process's uid or gid has changed, but the /proc/<PID> directory itself was also set to mode 0. Assuming this doesn't open any security holes, open access to the /proc/<PID> directory for users other than root to read or search the directory. Reviewed by: des (back in February) MFC after: 3 weeks
* /* -> /*- for copyright notices, minor format tweaks as necessaryimp2005-01-061-1/+1
|
* Lock p->p_textvp before calling vn_fullpath() on it. Note therwatson2004-01-071-0/+2
| | | | | | | | potential lock order concern due to the vnode lock held simultaneously by the caller into procfs. Reported by: kuriyama Approved by: des
* Minor whitespace and style issues.des2003-12-071-8/+5
|
* Add a proc lock assertion and move another assertion up to the top of thejhb2003-04-171-2/+4
| | | | function.
* Slightly change the semantics of vnode labels for MAC: rather thanrwatson2002-10-261-1/+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
* Remove even more '&' from pointers to functions.phk2002-10-201-26/+26
| | | | Spotted by: FlexeLint
* Introduce support for Mandatory Access Control and extensiblerwatson2002-08-011-0/+1
| | | | | | | | | | | 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
* Change p_can{debug,see,sched,signal}()'s first argument to be a threadjhb2002-05-191-1/+3
| | | | | | | 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.
* Paranoia: if the process is setugid, set all sensitive files mode 0.des2002-02-181-1/+3
|
* Fix various bugs in the debugging code and reenable it.des2001-12-091-2/+0
|
* Fix a KSEfication brain-o in procfs_doprocfile(): return the path of the ↵des2001-12-081-3/+3
| | | | | | | | | 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-0/+198
OpenPOWER on IntegriCloud