summaryrefslogtreecommitdiffstats
path: root/sys/fs/devfs
Commit message (Collapse)AuthorAgeFilesLines
* Report the correct length for symlink entries.phk2004-02-191-1/+1
|
* White-space align a struct definition.phk2004-02-153-37/+27
| | | | Move a SYSINIT to the file where it belongs.
* Fix style(9) of my previous commit.cperciva2004-01-211-1/+1
| | | | | Noticed by: nate Approved by: nate, rwatson (mentor)
* Allow devfs path rules to work on directories. Without this fix,cperciva2004-01-211-1/+2
| | | | | | | | devfs rule add path fd unhide is a no-op, while it should unhide the fd subdirectory. Approved by: phk, rwatson (mentor) PR: kern/60897
* Improve on POLA by populating DEVFS before doing devfs(8) rule ioctls.phk2004-01-021-0/+5
| | | | | PR: 60687 Spotted by: Colin Percival <cperciva@daemonology.net>
* Modify the MAC Framework so that instead of embedding a (struct label)rwatson2003-11-121-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | in various kernel objects to represent security data, we embed a (struct label *) pointer, which now references labels allocated using a UMA zone (mac_label.c). This allows the size and shape of struct label to be varied without changing the size and shape of these kernel objects, which become part of the frozen ABI with 5-STABLE. This opens the door for boot-time selection of the number of label slots, and hence changes to the bound on the number of simultaneous labeled policies at boot-time instead of compile-time. This also makes it easier to embed label references in new objects as required for locking/caching with fine-grained network stack locking, such as inpcb structures. This change also moves us further in the direction of hiding the structure of kernel objects from MAC policy modules, not to mention dramatically reducing the number of '&' symbols appearing in both the MAC Framework and MAC policy modules, and improving readability. While this results in minimal performance change with MAC enabled, it will observably shrink the size of a number of critical kernel data structures for the !MAC case, and should have a small (but measurable) performance benefit (i.e., struct vnode, struct socket) do to memory conservation and reduced cost of zeroing memory. NOTE: Users of MAC must recompile their kernel and all MAC modules as a result of this change. Because this is an API change, third party MAC modules will also need to be updated to make less use of the '&' symbol. Suggestions from: bmilekic Obtained from: TrustedBSD Project Sponsored by: DARPA, Network Associates Laboratories
* Remember to check the DE_WHITEOUT flag in the case where a clonedphk2003-10-201-4/+9
| | | | | | device is hidden by a devfs(8) rule. Spotted by: Adam Nowacki <ptnowak@bsk.vectranet.pl>
* When a driver successfully created a device on demand, we can directlyphk2003-10-201-7/+6
| | | | | | | | | pick up the DEVFS inode number from the dev_t and find our directory entry from that, we don't need to scan the directory to find it. This also solves an issue with on-demand devices in subdirectories. Submitted by: cognet
* Initialize struct vfsops C99-sparsely.phk2003-06-121-15/+4
| | | | | Submitted by: hmp Reviewed by: phk
* Remove unused variable.phk2003-05-311-6/+1
| | | | Found by: FlexeLint
* 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
* Finish cleanup of vprint() which was begun with changing v_tag to a string.njl2003-03-031-2/+0
| | | | | | Remove extraneous uses of vop_null, instead defering to the default op. Rename vnode type "vfs" to the more descriptive "syncer". Fix formatting for various filesystems that use vop_print.
* Clean up whitespace, s/register //, refrain from strong urge to ANSIfy.des2003-03-021-14/+14
|
* uiomove-related caddr_t -> void * (just the low-hanging fruit)des2003-03-021-1/+1
|
* NODEVFS cleanup:phk2003-03-021-4/+3
| | | | Replace devfs_{create,destroy} hooks with direct function calls.
* Back out M_* changes, per decision of the TRB.imp2003-02-194-12/+12
| | | | Approved by: trb
* NODEVFS cleanup: remove #ifdefs.phk2003-01-294-8/+0
|
* Remove M_TRYWAIT/M_WAITOK/M_WAIT. Callers should use 0.alfred2003-01-214-12/+12
| | | | Merge M_NOWAIT/M_DONTWAIT into a single flag M_NOWAIT.
* Originally when DEVFS was added, a global variable "devfs_present"phk2003-01-191-1/+0
| | | | | | | | | | | | was used to control code which were conditional on DEVFS' precense since this avoided the need for large-scale source pollution with #include "opt_geom.h" Now that we approach making DEVFS standard, replace these tests with an #ifdef to facilitate mechanical removal once DEVFS becomes non-optional. No functional change by this commit.
* Even if the permissions deny it, a process should be allowed tophk2003-01-131-2/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | access its controlling terminal. In essense, history dictates that any process is allowed to open /dev/tty for RW, irrespective of credential, because by definition it is it's own controlling terminal. Before DEVFS we relied on a hacky half-device thing (kern/tty_tty.c) which did the magic deep down at device level, which at best was disgusting from an architectural point of view. My first shot at this was to use the cloning mechanism to simply give people the right tty when they ask for /dev/tty, that's why you get this, slightly counter intuitive result: syv# ls -l /dev/tty `tty` crw--w---- 1 u1 tty 5, 0 Jan 13 22:14 /dev/tty crw--w---- 1 u1 tty 5, 0 Jan 13 22:14 /dev/ttyp0 Trouble is, when user u1 su(1)'s to user u2, he cannot open /dev/ttyp0 anymore because he doesn't have permission to do so. The above fix allows him to do that. The interesting side effect is that one was previously only able to access the controlling tty by indirection: date > /dev/tty but not by name: date > `tty` This is now possible, and that feels a lot more like DTRT. PR: 46635 MFC candidate: could be.
* Add symlink support to devfs_rule_matchpath(). This allows the userdd2003-01-111-1/+2
| | | | to unhide symlinks as well as hide them.
* Since Jeffr made the std* functions the default in rev 1.63 ofphk2003-01-041-6/+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
* Trim left-over and unused vop_refreshlabel() bits from devfs.rwatson2002-12-281-23/+0
| | | | Reported by: bde
* Remove dm_root entry from struct devfs_mount. It's never set, and isrwatson2002-12-094-7/+8
| | | | | | | | | | | | unused. Replace it with a dm_mount back-pointer to the struct mount that the devfs_mount is associated with. Export that pointer to MAC Framework entry points, where all current policies don't use the pointer. This permits the SEBSD port of SELinux's FLASK/TE to compile out-of-the-box on 5.0-CURRENT with full file system labeling support. Approved by: re (murray) Obtained from: TrustedBSD Project Sponsored by: DARPA, Network Associates Laboratories
* Slightly change the semantics of vnode labels for MAC: rather thanrwatson2002-10-261-1/+1
| | | | | | | | | | | | | | | | | | | | | "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
* Missed a case of _POSIX_MAC_PRESENT -> _PC_MAC_PRESENT rename.rwatson2002-10-201-2/+2
| | | | Pointed out by: phk
* Fix comments and one resulting code confusion about the type of thephk2002-10-163-3/+3
| | | | | | "command" argument to VOP_IOCTL. Spotted by: FlexeLint.
* A better solution to avoiding variable sized structs in DEVFS.phk2002-10-162-3/+5
|
* #include "opt_devfs.h" to protect against variable sized structures.phk2002-10-161-0/+2
| | | | Spotted by: FlexeLint
* Change iov_base's type from `char *' to the standard `void *'. Allmike2002-10-111-2/+2
| | | | | uses of iov_base which assume its type is `char *' (in order to do pointer arithmetic) have been updated to cast iov_base to `char *'.
* Treat the pathptrn field as a real pattern with the aid of fnmatch().dd2002-10-081-15/+1
|
* Integrate a devfs/MAC fix from the MAC tree: avoid a race condition duringrwatson2002-10-051-4/+3
| | | | | | | | | devfs VOP symlink creation by introducing a new entry point to determine the label of the devfs_dirent prior to allocation of a vnode for the symlink. Obtained from: TrustedBSD Project Sponsored by: DARPA, Network Associates Laboratories
* Move the vop-vector declaration into devfs_vnops.c where it belongs.phk2002-10-012-5/+3
|
* s/struct dev_t */dev_t */phk2002-09-281-1/+1
|
* Fix mis-indent.phk2002-09-281-1/+1
|
* Remove any VOP_PRINT that redundantly prints the tag.njl2002-09-181-15/+2
| | | | | | Move lockmgr_printinfo() into vprint() for everyone's benefit. Suggested by: bde
* Remove all use of vnode->v_tag, replacing with appropriate substitutes.njl2002-09-141-2/+2
| | | | | | | | | | | | 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)
* Introduce typedefs for the member functions of struct vfsops and employphk2002-08-131-9/+6
| | | | | | | these in the main filesystems. This does not change the resulting code but makes the source a little bit more grepable. Sponsored by: DARPA and NAI Labs.
* - Replace v_flag with v_iflag and v_vflagjeff2002-08-042-2/+2
| | | | | | | | | | | | | | | - 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-021-0/+11
| | | | | | | | | | | kernel access control. Teach devfs how to respond to pathconf() _POSIX_MAC_PRESENT queries, allowing it to indicate to user processes that individual vnode labels are available. Obtained from: TrustedBSD Project Sponsored by: DARPA, NAI Labs
* Hook up devfs_pathconf() for specfs devfs nodes, not just regularrwatson2002-08-011-0/+1
| | | | | | | devfs nodes. Obtained from: TrustedBSD Project Sponsored by: DARPA, NAI Labs
* Introduce support for Mandatory Access Control and extensiblerwatson2002-07-313-0/+90
| | | | | | | | | | | | | | | | kernel access control. Instrument devfs to support per-dirent MAC labels. In particular, invoke MAC framework when devfs directory entries are instantiated due to make_dev() and related calls, and invoke the MAC framework when vnodes are instantiated from these directory entries. Implement vop_setlabel() for devfs, which pushes the label update into the devfs directory entry for semi-persistant store. This permits the MAC framework to assign labels to devices and directories as they are instantiated, and export access control information via devfs vnodes. Obtained from: TrustedBSD Project Sponsored by: DARPA, NAI Labs
* Introduce support for Mandatory Access Control and extensiblerwatson2002-07-301-0/+1
| | | | | | | | | | | kernel access control. Label devfs directory entries, permitting labels to be maintained on device nodes in devfs instances persistently despite vnode recycling. Obtained from: TrustedBSD Project Sponsored by: DARPA, NAI Labs
* Correct misindentation of DRA_UID.dd2002-07-281-1/+1
|
* Unimplement panic(8) by making sure that we don't recurse into add2002-07-281-5/+11
| | | | | | | ruleset. If we do, that means there's a ruleset loop (10 includes 20 include 30 includes 10), which will quickly cause a double fault due to stack overflow (since "include" is implemented by recursion). (Previously, we only checked that X didn't include X.)
* Introduce the DEVFS "rule" subsystem. DEVFS rules permit thedd2002-07-175-1/+949
| | | | | | | | | | | administrator to define certain properties of new devfs nodes before they become visible to the userland. Both static (e.g., /dev/speaker) and dynamic (e.g., /dev/bpf*, some removable devices) nodes are supported. Each DEVFS mount may have a different ruleset assigned to it, permitting different policies to be implemented for things like jails. Approved by: phk
* Make devfs to give honour to PDIRUNLOCK flag.semenu2002-06-011-9/+13
| | | | | Reviewed by: jeff MFC after: 1 week
* Fix several bugs in devfs_lookupx(). When we check the nameiop tomux2002-05-101-3/+3
| | | | | | | | | make sure it's a correct operation for devfs, do it only in the ISLASTCN case. If we don't, we are assuming that the final file will be in devfs, which is not true if another partition is mounted on top of devfs or with special filenames (like /dev/net/../../foo). Reviewed by: phk
* Convert devfs to nmount.mux2002-05-021-6/+5
| | | | Reviewed by: phk
* Use vnode locking with devfs; permit VFS locking assertions to makerwatson2002-04-291-0/+6
| | | | | | | | sense for devfs vnodes, and reduce/remove potential races in the devfs code. Submitted by: iadowse Approved by: phk
OpenPOWER on IntegriCloud