1766 Commits

Author SHA1 Message Date
rodrigc
e122f21ee1 MFC: msdosfs_vfsops.c:1.150, ntfs_vfsops.c:1.83, udf_vfsops.c:1.41
ext2_vfsops.c:1.157, cd9660_vfsops.c:1.145, ffs_vfsops.c:1.314,
     reiserfs_vfsops.c:1.5

  Remove calls to vfs_export() for exporting a filesystem for NFS mounting
  from individual filesystems.  Call it instead in vfs_mount.c,
  after we call VFS_MOUNT() for a specific filesystem.
2006-06-17 20:02:28 +00:00
rodrigc
a5f9933adf MFC: 1.78, 1.79
Remove incorrect null_checkexp() routine.  This
will allow the NFS server to call vfs_stdcheckexp() on the exported nullfs
filesystem, not the underlying filesystem being nullfs mounted.
If the lower filesystem was not NFS exported, then the NFS exported
null filesystem would not work.
Modify MNT_UPDATE behavior for nullfs so that it does not
return EOPNOTSUPP if an "export" parameter was passed in.
This should allow nullfs mounts to be NFS exported.

PR:             kern/87906
2006-06-17 18:17:26 +00:00
ghelmer
7cdd81d530 MFC procfs.c revisions 1.13 and 1.14:
1.13: Revision 1.4 set access for all sensitive files in /proc/<PID> to mode 0
  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.

  1.14: Upon further review, DES prefers this change over that in revision 1.13
  to resolve the directory access problem for processes with P_SUGID flag
  set.
2006-06-14 21:20:39 +00:00
cperciva
280f83404d Enable inadvertantly disabled "securenet" access controls in ypserv. [1]
Correct a bug in the handling of backslash characters in smbfs which can
allow an attacker to escape from a chroot(2). [2]

Security:	FreeBSD-SA-06:15.ypserv [1]
Security:	FreeBSD-SA-06:16.smbfs [2]
2006-05-31 22:32:22 +00:00
rwatson
3e9d04507f Merge fifo_vnops.c:1.134 from HEAD to RELENG_6:
Add a_fdidx to comment prototype for fifo_open().

  Submitted by:   Kostik Belousov <kostikbel at gmail dot com>

Approved by:	re (mux)
2006-03-28 12:42:20 +00:00
tegge
270e3c1d30 MFC: Call vn_start_write() before locking vnode.
Approved by:	re (kensmith)
2006-03-22 17:39:27 +00:00
rwatson
aa083dc18c Merge fifo_vnops.c:1.133 from HEAD to RELENG_6:
If fifo_open() is called with a negative file descriptor, return EINVAL
  rather than panicking later.  This can occur if the kernel calls
  vn_open() on a fifo, as there will be no associated file descriptor,
  and therefore the file descriptor operations cannot be modified to
  point to the fifo operation set.

  Reported by:    Martin <nakal at nurfuerspam dot de>
  PR:             94278

Approved by:    re (scottl)
2006-03-20 14:24:21 +00:00
jeff
84448e0326 MFC Revs 1.91, 1.90
VFS SMP fixes, stack api, softupdates fixes.

Sponsored by:	Isilon Systems, Inc.
Approved by:	re (scottl)
2006-03-13 03:05:26 +00:00
jeff
c88ac06e85 MFC Revs 1.77, 1.76, 1.73
VFS SMP fixes, stack api, softupdates fixes.

Sponsored by:	Isilon Systems, Inc.
Approved by:	re (scottl)
2006-03-13 03:05:21 +00:00
jeff
a12abbc98f MFC Rev 1.50
VFS SMP fixes, stack api, softupdates fixes.

Sponsored by:	Isilon Systems, Inc.
Approved by:	re (scottl)
2006-03-13 03:05:17 +00:00
jeff
50d9f18fb2 MFC Rev 1.163
VFS SMP fixes, stack api, softupdates fixes.

Sponsored by:	Isilon Systems, Inc.
Approved by:	re (scottl)
2006-03-13 03:05:13 +00:00
jeff
d2b9be25b3 MFC Rev 1.45
VFS SMP fixes, stack api, softupdates fixes.

Sponsored by:	Isilon Systems, Inc.
Approved by:	re (scottl)
2006-03-13 03:05:06 +00:00
jeff
24d4381407 MFC Rev 1.49
VFS SMP fixes, stack api, softupdates fixes.

Sponsored by:	Isilon Systems, Inc.
Approved by:	re (scottl)
2006-03-13 03:05:02 +00:00
scottl
c5719df4a5 MFC: Call vfs_destroy_object() before v_data gets set to NULL.
Approved by: re
2006-03-12 21:50:02 +00:00
kris
733d0eda70 MFC:
----------------------------
revision 1.101
date: 2006/02/28 00:05:44;  author: kris;  state: Exp;  lines: +2 -4
Correct the vnode locking in fdescfs.

PR:             kern/93905
Submitted by:   Kostik Belousov <kostikbel@gmail.com>
Reviewed by:    jeff
----------------------------

Approved by:	re (mux)
2006-03-08 23:06:07 +00:00
jhb
3d7b05e4b2 MFC: Close some races between procfs/ptrace and exit1() by changing
exit1() to block until any current PHOLD's are released.  This includes
Simplifying the cleanup code in kern_ptrace() and removing the now
unnecessary vmspace ref counting magic from proc_rwmem().  Also, the
locking for ptrace_single_step(), ptrace_set_pc(), and
ptrace_clear_single_step() have been fixed to be consistent across the
tree.

Approved by:	re (scottl)
2006-03-07 18:08:09 +00:00
jhb
a8eaf2520e MFC: Change pfs_visible() to optionally return with the process still
locked to simplify some locking and close some races.

Approved by:	re (scottl)
2006-03-01 20:54:33 +00:00
jhb
1729bc3f72 MFC: Hold the proc lock while calling proc_sstep().
Approved by:	re (scottl)
2006-03-01 20:52:10 +00:00
yar
dbcb706f58 Work around the shortness of the size argument to
vnode_create_vobject() while preserving the binary ABI
to filesystem modules in RELENG_6: introduce a new function
vnode_create_vobject_off() that takes the size argument
as off_t; move all stock file systems to it; re-implement
the old vnode_create_vobject() using vnode_create_vobject_off()
so that old or binary-only FS modules can work w/o hitting the
bug.  The trick is to pass a size of 0 to vnode_create_vobject_off()
so that it will call VOP_GETATTR() and thus get the actual,
untruncated file size even if the calling module still uses
the old vnode_create_vobject().

PR:		kern/92243
Approved by:	re (scottl)
2006-02-20 00:53:15 +00:00
jhb
c0067121bc MFC: Correctly set the MPSAFE flag based on the lower vnode's mount.
Approved by:	re (scottl)
2006-02-14 23:15:16 +00:00
yar
25d6e2cc4f MFC:
Avoid creating (and subsequently using) fake opt_*.h files
when the modules are built with the kernel and hence actual
opt_*.h files are available in ${KERNBUILDDIR}.  Fix a few
small bugs that would prevent this from working.

At last the build options of the modules become consistent
with those of the kernel unless the MODULES_WITH_WORLD way
still is used.

Approved by:	re (kensmith, scottl)
Requested by:	ru
Tested on:	amd64 i386 sparc64
Tested by:	md5
2006-02-10 00:38:08 +00:00
rwatson
5bb071d425 MFC devfs_rule.c:1.21 from HEAD to RELENG_6:
When returning EIO from DEVFSIO_RADD ioctl, drop the exclusive rule
  lock.  Otherwise the system comes to a rather sudden and grinding
  halt.

As the underlying devfs locking changes that lead to this bug have not
been merged to RELENG_5, this fix to those locking changes does not
need to be merged.
2006-01-11 10:15:57 +00:00
maxim
ffe68f436b MFC rev. 1.41: typo fix. 2006-01-08 20:28:48 +00:00
dwhite
16e12cca71 MFC:
src/sys/fs/devfs/devfs_vnops.c		1.128
 src/sys/kern/vfs_subr.c		1.652

This is a workaround for a complicated issue involving VFS cookies and devfs.
The PR and patch have the details. The ultimate fix requires architectural
changes and clarifications to the VFS API, but this will prevent the system
from panicking when someone does "ls /dev" while running in a shell under the
linuxulator.

PR:		88249
Submitted by:   "Devon H. O'Dell" <dodell@ixsystems.com>
2005-11-12 21:21:27 +00:00
kris
2eda86bb49 MFC 1.73:
Reflect mpsafety of the underlying filesystem in the nullfs image.

Approved by:	re (scottl)
2005-10-25 20:33:31 +00:00
phk
484eb21391 MFC:
Use correct criteria to determine if dirent can be removed
	right away.

Approved by:	re@ (scottl)
2005-10-19 21:25:31 +00:00
truckman
ac3fe75ffe MFC nwfs_vnops.c 1.42
Original commit message:
  Modified files:
    sys/fs/nwfs          nwfs_vnops.c
  Log:
  Update nwfs_lookup() to match the current cache_lookup() API.
  cache_lookup() has returned a ref'ed and locked vnode since
  vfs_cache.c:1.96, dated Tue Mar 29 12:59:06 2005 UTC.  This change
  is similar to the change made to smbfs_lookup() in smbfs_vnops.c:1.58.

  Tested by:      "Antony Mawer" ant AT mawer.org
  MFC after:      2 weeks

  Revision  Changes    Path
  1.42      +11 -26    src/sys/fs/nwfs/nwfs_vnops.c

Approved by:	re (scottl)
2005-10-19 20:18:44 +00:00
delphij
24b61ed7a8 MFC (by des)
| Eliminate an unnecessary bcopy().
|
| Revision  Changes    Path
| 1.57      +15 -15    src/sys/fs/pseudofs/pseudofs_vnops.c

Approved by:	re (scottl)
No objection:	des
2005-10-09 08:59:34 +00:00
delphij
7c26851aa1 MFC (by obrien)
| Ensure the full value is written into inode variables.
|
| PR:             85503
| Submitted by:   Dmitry Pryanishnikov <dmitry@atlantis.dp.ua>
|
| Revision  Changes    Path
| 1.89      +2 -2      src/sys/fs/msdosfs/msdosfs_denode.c

Approved by:	re (scottl)
2005-10-09 03:33:52 +00:00
rwatson
70be888bba Merge fifo_vnops.c:1.132 from HEAD to RELENG_6:
Second attempt at a work-around for fifo-related socket panics during
  make -j with high levels of parallelism: acquire Giant in fifo I/O
  routines.

  Discussed with: ups

Approved by:	re (scottl)
2005-10-04 15:33:06 +00:00
peadar
5f354c9a11 MFC BOOTSIG[23] removal:
msdosfs_vfsops.c v1.146
    bootsect.h v1.13

    Remove checks for BOOTSIG[23] from FAT32 bootblocks.
    There seems to be very little documentary evidence outside this
    implementation to suggest a these checks are neccessary, and more
    than one camera-formatted flash disk fails the check, but mounts
    successfully on most other systems.

Approved by: re (scottl@)
2005-10-04 13:13:57 +00:00
rwatson
f58713cf53 Merge fifo_vnops.c:1.130 from HEAD to RELENG_6:
Assert v_fifoinfo is non-NULL in fifo_close() in order to catch
  non-conforming cases sooner.

  Reported by:    Peter Holm <peter at holm dot cc>

Approved by:	re (scottl)
2005-10-02 10:07:21 +00:00
phk
d1a2719799 MFC:
one character fix in mount option name.

Approved by:	re@ (scottl)
2005-10-01 17:39:50 +00:00
delphij
15d6d1b68d MFC sys/fs/hpfs/hpfs_vfsops.c:1.54-1.56,
sys/fs/msdosfs/msdosfs_vfsops.c:1.145,
    sys/fs/ntfs/ntfs_vfsops.c:1.79-1.80,
    sys/fs/udf/udf_vfsops.c:1.34-1.35,
    sys/gnu/fs/ext2fs/ext2_vfsops.c:1.152-1.153,
    sys/gnu/fs/reiserfs/reiserfs_vfsops.c:1.2-1.3 (by ssouhlal):

*_mountfs() (if the filesystem mounts from a device) needs devvp to be
locked, so lock it.

Approved by:	re (scottl)
2005-09-30 06:26:42 +00:00
rwatson
14efd49e2f Merge fifo_vnops.c:1.129 from HEAD to RELENG_6:
Lock the read socket receive buffer when frobbing the sb_state flag on
  that socket during open, not the write socket receive buffer.

  Spotted by:	ups

Approved by:	re (scottl)
2005-09-28 06:55:02 +00:00
rwatson
442db0620a Merge fifo_vnops.c:1.128 from HEAD to RELENG_6:
For reasons of consistency (and necessity), assert an exclusive vnode
  lock on the fifo vnode in fifo_open(): we rely on the vnode lock to
  serialize access to v_fifoinfo.

Approved by:	re (scottl)
2005-09-28 06:47:32 +00:00
phk
6c1584f5fc MFC:
DEVFS fixes of many sorts.

Approved by:	re@ (scottl)
2005-09-26 14:36:54 +00:00
rwatson
533efa352a Merge fifo_vnops.c:1.126 from HEAD to RELENG_6:
Assert that (vp) is locked in fifo_close(), since we rely on the
  exclusive vnode lock to synchronize the reference counts on struct
  fifoinfo.

Approved by:	re (scottl)
2005-09-21 15:31:26 +00:00
rwatson
d14a3e32b7 Merge fifo_vnops.c:1.125 from HEAD to RELENG_6:
The socket pointers in fifoinfo are not permitted to be NULL, so
  don't check if they are, it just confuses the fifo code more.

Approved by:	re (kensmith)
2005-09-20 13:57:17 +00:00
phk
051ea6d1a8 MFC:
Various fixes for DEVFS, in particular "devfs ruleset already running".

Approved by:	re@ (scottl)
2005-09-18 07:10:57 +00:00
delphij
80a9b1b6e7 Oops, actually MFC 1.89 (by kan) which was missed in previous commit:
Handle a race condition where NULLFS vnode can be cleaned while threads
can still be asleep waiting for lowervp lock.

Tested by:	kkenn
Discussed with: ssouhlal, jeffr

(this is an early MFC for inclusion in the upcoming 6.0-BETA5)

Approved by:	re (scottl)
2005-09-17 15:51:41 +00:00
delphij
691b9ef2ea MFC 1.88 (by ssouhlal):
Use vput() instead of vrele() in null_reclaim() since the lower vnode
is locked.

MFC 1.89 (by kan):

Handle a race condition where NULLFS vnode can be cleaned while threads
can still be asleep waiting for lowervp lock.

Tested by:	kkenn
Discussed with: ssouhlal, jeffr

(rev. 1.89 is an early MFC for inclusion in the upcoming 6.0-BETA5)

Approved by:	re (scottl)
2005-09-17 15:48:05 +00:00
rwatson
f32e67ff68 Merge fifo_vnops.c:1.124 from HEAD to RELENG_6:
Trim down now (believed to be) unused fifo_ioctl() and
  fifo_kqfilter() VOP implementations, since they in theory are used
  only on open file descriptors, in which case the ioctls are via
  fifo_ioctl_f() and kqueue requests are via fifo_kqfilter_f().
  Generate warnings if they are entered for now.  These printf()
  calls should become panic() calls.

  Annotate and re-implement fifo_ioctl_f(): don't arbitrarily
  forward ioctls to the socket layer, only forward the ones we
  explicitly support for fifos.  In the case of FIONREAD, don't
  forward the request to the write socket on a read-write fifo, or
  the read result is overwritten.  Annotate a nasty case for the
  undefined POSIX O_RDWR on fifos, in which failure of the second
  ioctl will result in the socket pair being in an inconsistent
  state.

  Assert copyright as I find myself rewriting non-trivial parts of
  fifofs.

Approved by:	re (scottl)
2005-09-16 14:03:57 +00:00
rwatson
ae28f5cb27 Merge fifo_vnops.c:1.122 from HEAD to RELENG_6:
Annotate two issues:

  1) fifo_kqfilter() is not actually ever used, it likely should be GC'd.

  2) fifo_kqfilter_f() doesn't implement EVFILT_VNODE, so detecting events
     on the underlying vnode for a fifo no longer works (it did in 4.x).
     Likely, fifo_kqfilter_f() should forward the request to the VFS using
     fp->f_vnode, which would work once fifo_kqfilter() was detached from
     the vnode operation vector (removing the fifo override).

  Discussed with: phk

Approved by:	re (scottl)
2005-09-16 14:03:10 +00:00
rwatson
f254bafe68 Merge fifo_vnops.c:1.123 from HEAD to RELENG_6:
As a result of kqueue locking work, socket buffer locks will always
  be held when entering a kqueue filter for fifos via a socket buffer
  event: as such, assert the lock unconditionally rather than acquiring
  it conditionally.

Approved by:	re (scottl)
2005-09-16 13:36:44 +00:00
rwatson
504a02736d Merge fifo_vnops.c:1.121 from HEAD to RELENG_6:
Introduce no-op nosup fifo kqueue filter and detach routine, which are
  used when a read filter is requested on a write-only fifo descriptor, or
  a write filter is requested on a read-only fifo descriptor.  This
  permits the filters to be registered, but never raises the event, which
  causes kqueue behavior for fifos to more closely match similar semantics
  for poll and select, which permit testing for the condition even though
  the condition will never be raised, and is consistent with POSIX's notion
  that a fifo has identical semantics to a one-way IPC channel created
  using pipe() on most operating systems.

  The fifo regression test suite can now run to completion on HEAD without
  errors.

Approved by:	re (kensmith)
2005-09-15 20:53:56 +00:00
rwatson
6a6cd36b7c Merge fifo_vnops.c:1.120 from HEAD to RELENG_6:
When a request is made to register a filter on a fifo that doesn't
  apply to the fifo (i.e., not EVFILT_READ or EVFILT_WRITE), reject
  it as EINVAL, not by returning 1 (EPERM).

Approved by:	re (kensmith)
2005-09-15 20:50:31 +00:00
rwatson
6185980a8f Merge fifo_vnops.c:1.119 from HEAD to RELENG_6:
Remove DFLAG_SEEKABLE from fifo file descriptors: fifos are not seekable
  according to POSIX, not to mention the fact that it doesn't make sense
  (and hence isn't really implemented).  This causes the fifo_misc
  regression test to succeed.

Approved by:	re (scottl)
2005-09-15 20:50:04 +00:00
rwatson
dcebacb956 Merge fifo_vnops.c:1.118 from HEAD to RELENG_6:
Only poll the fifo for read events if the fifo is attached to a readable
  file descriptor.  Otherwise, the read end of a fifo might return that it
  is writable (which it isn't).

  Only poll the fifo for write events if the fifo attached to a writable
  file descriptor.  Otherwise, the write end of a fifo might return that
  it is readable (which it isn't).

  In the event that a file is FREAD|FWRITE (which is allowed by POSIX, but
  has undefined behavior), we poll for both.

Approved by:	re (kensmith)
2005-09-15 20:28:56 +00:00
rwatson
8c6b46594b Merge fifo_vnops.c:1.117 from HEAD to RELENG_6:
After going to some trouble to identify only the write-related events
  to poll the write socket for, the fifo polling code proceeded to poll
  for the complete set of events.  Use 'levents' instead of 'events' as
  the argument to poll, and only poll the write socket if there is
  interest in write events.

Approved by:	re (kensmith)
2005-09-15 20:28:27 +00:00