summaryrefslogtreecommitdiffstats
path: root/sys/fs/pseudofs
Commit message (Collapse)AuthorAgeFilesLines
* Add pfs_visible() checks to pfs_getattr() and pfs_getextattr(). Thisdes2003-08-191-0/+6
| | | | | | | | also fixes pfs_access() since it relies on VOP_GETATTR() which will call pfs_getattr(). This prevents jailed processes from discovering the existence, start time and ownership of processes outside the jail. PR: kern/48156
* Spell the name of the lock right in addition to getting the type right.jhb2003-08-181-1/+1
| | | | Submitted by: Kim Culhan <kimc@w8hd.org>
* The allproc lock is a sx lock, not a mutex, so fix the assertion. Thisjhb2003-08-181-1/+1
| | | | | asserts that the sx lock is held, but does not specify if the lock is held shared or exclusive, thus either type of lock satisfies the assertion.
* Rework pfs_iterate() a bit to eliminate a bug related to processdes2003-08-181-9/+12
| | | | | | | | | | | | | | directories. Previously, pfs_iterate() would return -1 when it reached the end of the process list while processing a process directory node, even if the parent directory contained further nodes (which is the case for the linprocfs root directory, where the process directory node is actually first in the list). With this patch, pfs_iterate() will continue to traverse the parent directory's node list after exhausting the process list (as was the intention all along). The code should hopefully be easier to read as well. While I'm here, have pfs_iterate() assert that the allproc lock is held.
* fix grammar in commentjmg2003-06-201-1/+1
|
* Initialize struct vfsops C99-sparsely.phk2003-06-121-15/+6
| | | | | Submitted by: hmp Reviewed by: phk
* Don't unlock the parent directory vnode twice if the ISDOTDOT flagtruckman2003-06-011-1/+2
| | | | is set.
* Deprecate machine/limits.h in favor of new sys/limits.h.kan2003-04-291-2/+1
| | | | | | | Change all in-tree consumers to include <sys/limits.h> Discussed on: standards@ Partially submitted by: Craig Rodrigues <rodrigc@attbi.com>
* Replace the at_fork, at_exec, and at_exit functions with the slightly morejhb2003-03-241-5/+7
| | | | | | | | | flexible process_fork, process_exec, and process_exit eventhandlers. This reduces code duplication and also means that I don't have to go duplicate the eventhandler locking three more times for each of at_fork, at_exec, and at_exit. Reviewed by: phk, jake, almost complete silence on arch@
* Rename vfs_stdsync function to vfs_stdnosync which matches morekan2003-03-111-1/+1
| | | | | | | | | | | | | closely what function is really doing. Update all existing consumers to use the new name. Introduce a new vfs_stdsync function, which iterates over mount point's vnodes and call FSYNC on each one of them in turn. Make nwfs and smbfs use this new function instead of rolling their own identical sync implementations. Reviewed by: jeff
* Get rid of caddr_t.des2003-03-022-2/+2
|
* Back out M_* changes, per decision of the TRB.imp2003-02-193-8/+8
| | | | Approved by: trb
* Do not allow a cached vnode to be shared among multiple mounts of the sametjr2003-01-281-1/+2
| | | | | | | | | kind of pseudofs-based filesystem. Fixes (at least) one problem where when procfs is mounted mupltiple times, trying to unmount one will often cause the wrong one to get unmounted, and other problem where mounting one procfs on top of another caused the kernel to lock up. Reviewed by: des
* Remove M_TRYWAIT/M_WAITOK/M_WAIT. Callers should use 0.alfred2003-01-213-8/+8
| | | | Merge M_NOWAIT/M_DONTWAIT into a single flag M_NOWAIT.
* GC an unused reference to vop_refreshlabel_desc; reference torwatson2003-01-211-3/+0
| | | | | | | opt_mac.h was removed previously so it was never compiled in. Obtained from: TrustedBSD Project Sponsored by: DARPA, Network Associates Laboratories
* Since Jeffr made the std* functions the default in rev 1.63 ofphk2003-01-041-3/+0
| | | | | | | kern/vfs_defaults.c it is wrong for the individual filesystems to use the std* functions as that prevents override of the default. Found by: src/tools/tools/vop_table
* Slightly change the semantics of vnode labels for MAC: rather thanrwatson2002-10-262-57/+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
* '&' not used for pointers to functions.phk2002-10-201-2/+2
| | | | Spotted by: FlexeLint
* Plug an infrequent (I think) memory leak.phk2002-10-151-1/+3
| | | | Spotted by: FlexeLint
* Regularize the vop_stdlock'ing protocol across all the filesystemsmckusick2002-10-141-2/+1
| | | | | | | | | | | | | | | | | | | | that use it. Specifically, vop_stdlock uses the lock pointed to by vp->v_vnlock. By default, getnewvnode sets up vp->v_vnlock to reference vp->v_lock. Filesystems that wish to use the default do not need to allocate a lock at the front of their node structure (as some still did) or do a lockinit. They can simply start using vn_lock/VOP_UNLOCK. Filesystems that wish to manage their own locks, but still use the vop_stdlock functions (such as nullfs) can simply replace vp->v_vnlock with a pointer to the lock that they wish to have used for the vnode. Such filesystems are responsible for setting the vp->v_vnlock back to the default in their vop_reclaim routine (e.g., vp->v_vnlock = &vp->v_lock). In theory, this set of changes cleans up the existing filesystem lock interface and should have no function change to the existing locking scheme. Sponsored by: DARPA & NAI Labs.
* - Use vrefcnt() where it is safe to do so instead of doing direct andjeff2002-09-251-1/+1
| | | | | | | unlocked accesses to v_usecount. - Lock access to the buf lists in the various sync routines. interlock locking could be avoided almost entirely in leaf filesystems if the fsync function had a generic helper.
* Remove all use of vnode->v_tag, replacing with appropriate substitutes.njl2002-09-142-2/+11
| | | | | | | | | | | | v_tag is now const char * and should only be used for debugging. Additionally: 1. All users of VT_NTS now check vfsconf->vf_type VFCF_NETWORK 2. The user of VT_PROCFS now checks for the new flag VV_PROCDEP, which is propagated by pseudofs to all child vnodes if the fs sets PFS_PROCDEP. Suggested by: phk Reviewed by: bde, rwatson (earlier version)
* - Replace v_flag with v_iflag and v_vflagjeff2002-08-041-1/+1
| | | | | | | | | | | | | | | - v_vflag is protected by the vnode lock and is used when synchronization with VOP calls is needed. - v_iflag is protected by interlock and is used for dealing with vnode management issues. These flags include X/O LOCK, FREE, DOOMED, etc. - All accesses to v_iflag and v_vflag have either been locked or marked with mp_fixme's. - Many ASSERT_VOP_LOCKED calls have been added where the locking was not clear. - Many functions in vfs_subr.c were restructured to provide for stronger locking. Idea stolen from: BSD/OS
* Introduce support for Mandatory Access Control and extensiblerwatson2002-08-012-0/+60
| | | | | | | | | | | | | | | kernel access control. Modify pseudofs so that it can support synthetic file systems with the multilabel flag set. In particular, implement vop_refreshlabel() as pn_refreshlabel(). Implement pfs_refreshlabel() to invoke this, and have it fall back to the mount label if the file system does not implement pn_refreshlabel() for the node. Otherwise, permit the file system to determine how the service is provided. Approved by: des Obtained from: TrustedBSD Project Sponsored by: DARPA, NAI Labs
* Lock down pseudofs:jeff2002-07-082-0/+29
| | | | | | | - Initialize lock structure in vncache_alloc - Return locked vnodes from vncache_alloc - Setup vnode op vectors to use default lock, unlock, and islocked - Implement simple locking scheme required for lookup
* Gratuitous whitespace cleanup.des2002-06-065-88/+88
|
* 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.
* s/pfs_badop/vop_eopnotsupp/des2002-05-031-17/+9
| | | | Submitted by: phk
* Convert the pseudofs framework to nmount (thus procfs and linprocfs).mux2002-05-022-8/+8
| | | | Reviewed by: des (some time ago), phk
* Remove stale XXX comment.jhb2002-04-141-1/+0
|
* Change callers of mtx_init() to pass in an appropriate lock type name. Injhb2002-04-043-3/+4
| | | | | | | most cases NULL is passed, but in some cases such as network driver locks (which use the MTX_NETWORK_LOCK macro) and UMA zone locks, a name is used. Tested on: i386, alpha, sparc64
* Part I: Update extended attribute API and ABI:rwatson2002-02-102-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | o Modify the system call syntax for extattr_{get,set}_{fd,file}() so as not to use the scatter gather API (which appeared not to be used by any consumers, and be less portable), rather, accepts 'data' and 'nbytes' in the style of other simple read/write interfaces. This changes the API and ABI. o Modify system call semantics so that extattr_get_{fd,file}() return a size_t. When performing a read, the number of bytes read will be returned, unless the data pointer is NULL, in which case the number of bytes of data are returned. This changes the API only. o Modify the VOP_GETEXTATTR() vnode operation to accept a *size_t argument so as to return the size, if desirable. If set to NULL, the size will not be returned. o Update various filesystems (pseodofs, ufs) to DTRT. These changes should make extended attributes more useful and more portable. More commits to rebuild the system call files, as well as update userland utilities to follow. Obtained from: TrustedBSD Project Sponsored by: DARPA, NAI Labs
* Change EPERM to EOPNOTSUPP when failing pseudofs_setattr() arbitrarily.rwatson2002-02-041-4/+2
| | | | Quoth the alfred: The latter would be better.
* Return EPERM instead of 0 in the un-implemented pseudofs_setattr().rwatson2002-02-041-2/+1
| | | | Conceivably, it should even return EOPNOTSUPP.
* Staticise pfs_vncache, it's not used anywhere else.msmith2002-01-081-1/+1
| | | | Reviewed by: des
* Do not derefer null.tanimura2002-01-041-0/+4
| | | | Reviewed by: des
* Pseudofs was leaking VFS cache entries badly due to its cache and use ofdillon2001-12-192-4/+22
| | | | | | the wrong VOP descriptor. This misuse caused VFS-cached vnodes to be re-cached, resulting in the leak. This commit is an interim fix until DES has a chance to rework the code involved.
* Add VOP_GETEXTATTR(9) passthrough support to pseudofs.green2001-12-112-0/+55
| | | | | Obtained from: TrustedBSD Project Sponsored by: DARPA, NAI Labs
* Update to C99, s/__FUNCTION__/__func__/,obrien2001-12-101-8/+8
| | | | also don't use ANSI string concatenation.
* Fix an incorrect PFS_TRACE. Also, use __func__ instead of __FUNCTION__.des2001-12-091-3/+3
|
* Add support for a last-close handler.des2001-11-273-3/+38
| | | | | Revert the module version bumps; they're quite pointless as long as the only pseudofs consumer is linprocfs, which is in the tree.
* Reduce the number of #include dependencies by declaring some of the structsdes2001-11-034-6/+19
| | | | used in pseudofs.h as opaque structs.
* Add VOP_IOCTL support, and fix a bug that would cause a panic if a file ordes2001-10-262-4/+58
| | | | symlink lacked a filler function.
* Argh! I updated the version number in the MODULE_DEPEND() thingamagook butdes2001-10-191-1/+1
| | | | not in the actual MODULE_VERSION(). Pass me the pointy hat.
* Switch to dynamic rather than static initialization.des2001-10-193-62/+288
| | | | | This makes it possible (in theory) for nodes to be added and / or removed from pseudofs filesystems at runtime.
* Add missing includes of sys/lock.h.jhb2001-10-111-0/+1
|
* Add a PFS_DISABLED flag; pfs_visible() automatically returns 0 if it is setdes2001-10-023-10/+57
| | | | | on the node in question. Also add two API functions for setting and clearing this flag; setting it also reclaims all vnodes associated with the node.
* Only print "XXX (un)registered" message if bootverbose.des2001-10-021-2/+4
|
* [the previous commit to pseudofs_vncache.c got the wrong log message]des2001-10-011-0/+2
| | | | | | | | | | | | YA pseudofs megacommit, part 2: - Merge the pfs_vnode and pfs_vdata structures, and make the vnode cache a doubly-linked list. This eliminates the need to walk the list in pfs_vncache_free(). - Add an exit callout which revokes vnodes associated with the process that just exited. Since it needs to lock the cache when it does this, pfs_vncache_mutex needs MTX_RECURSE.
* YA pseudofs megacommit, part 1:des2001-10-013-79/+181
| | | | | | | | | | | | | | | | - Add a third callback to the pfs_node structure. This one simply returns non-zero if the specified requesting process is allowed to access the specified node for the specified target process. This is used in addition to the usual permission checks, e.g. when certain files don't make sense for certain (system) processes. - Make sure that pfs_lookup() and pfs_readdir() don't yap about files which aren't pfs_visible(). Also check pfs_visible() before performing reads and writes, to prevent the kind of races reported in SA-00:77 and SA-01:55 (fork a child, open /proc/child/ctl, have that child fork a setuid binary, and assume control of it). - Add some more trace points.
OpenPOWER on IntegriCloud