Commit Graph

256 Commits

Author SHA1 Message Date
bde
291e109fed Removed yet more vestiges of config-time swap configuration and/or
cleaned up nearby cruft.
1997-09-07 16:21:11 +00:00
bde
6cba0e5bd6 Removed vestiges of config-time "argument processing" configuration. 1997-09-07 13:49:56 +00:00
bde
bab4d1583f Staticized. 1997-09-07 06:46:34 +00:00
bde
b1c7917c66 Some staticized variables were still declared to be extern. 1997-09-07 05:27:26 +00:00
kato
347336b3e2 Support read-only mount. 1997-09-04 03:14:49 +00:00
bde
ec06a8cbcf Removed unused #includes. 1997-09-02 20:06:59 +00:00
kato
b91306ebeb Include "opt_ddb.h" only when NULLFS_DIAGNOSTIC is defined. 1997-08-28 00:44:43 +00:00
kato
51cc097afa Fixed NULLFS_DIAGNOSTIC stuff. 1997-08-27 08:44:43 +00:00
julian
00deec3cd4 remove un-needed if statement (now the poul removed the 'then' clause) 1997-08-27 02:58:40 +00:00
julian
decee54d74 two fixes submitted by Dmitrij Tejblum <dima@tejblum.dnttm.rssi.ru>
fixes problems in unmounting and propogation.
1997-08-26 17:17:52 +00:00
phk
4f3d704934 Copy&Paste considered harmful:
Remove all traces of the name_cache from devfs.  It is hardly sensible to
use the namecache for an all-RAM filesystem.
1997-08-25 20:31:00 +00:00
wollman
c07b59bf2b Fix all areas of the system (or at least all those in LINT) to avoid storing
socket addresses in mbufs.  (Socket buffers are the one exception.)  A number
of kernel APIs needed to get fixed in order to make this happen.  Also,
fix three protocol families which kept PCBs in mbufs to not malloc them
instead.  Delete some old compatibility cruft while we're at it, and add
some new routines in the in_cksum family.
1997-08-16 19:16:27 +00:00
kato
94c40ee122 Added DIAGNOSTIC routine to test inconsistency of vnode when cnp
points `.'.

Obtained from:	NetBSD
1997-08-15 02:36:28 +00:00
kato
20d8e0fed2 Deleted unused code which adjust UN_UNLOCK flag. 1997-08-15 02:35:00 +00:00
kato
14df8fa6f4 If the user doesn't have read permission, union_copyup should not copy
a file to upper layer.

Reviewed by:	Naofumi Honda <honda@Kururu.math.sci.hokudai.ac.jp>
1997-08-14 03:57:46 +00:00
kato
f14cc75316 Backed out part of previous change. The example of -b mount in
manpage works again.
1997-08-14 03:52:27 +00:00
kato
69f3239838 Fixed vnode corruption by undefined case in union_lookup(). When
uerror == 0 && lerror == EACCES, lowervp == NULLVP and union_allocvp
doesn't find existing union node and new union node is created.

Sicne it is dificult to cover all the case, union_lookup always
returns when union_lookup1() returns EACCES.

Submitted by:	Naofumi Honda <honda@Kururu.math.sci.hokudai.ac.jp>
Obtained from:	NetBSD/pc98
1997-08-12 07:18:59 +00:00
sef
70eff1f337 Check permissions for fp regs as well as normal regs. 1997-08-12 05:23:51 +00:00
sef
169e0822bf Fix procfs security hole -- check permissions on meaningful I/Os (namely,
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
1997-08-12 04:34:30 +00:00
bde
2b60d80b5b Removed unused #includes. 1997-08-02 14:33:27 +00:00
julian
9816133b95 two tiny typo's 1997-07-14 04:53:52 +00:00
julian
f132e54fe7 remove annoying debug message 1997-07-14 04:30:22 +00:00
alex
6c7b4daebe More comment cleanup. 1997-06-26 17:12:59 +00:00
alex
0807c535d3 Typo police. 1997-06-26 16:13:56 +00:00
alex
0835dca454 Style fix my previous commit. 1997-06-26 16:12:53 +00:00
alex
8628d27490 Block all write operations to /proc/1/* when securelevel > 0.
The additional check in procfs_ctl.c could be backed out, but
I'm leaving it in for good measure.

Reviewed by:	Theo de Raadt <deraadt@OpenBSD.org>
1997-06-21 16:09:49 +00:00
tegge
d8a754a14d Don't remove the controlling tty from the session if the vnode is being
cleaned. This should help for PR kern/3581.
1997-05-29 13:29:13 +00:00
peter
b8ce5e7105 Fix some warnings (missing prototypes, wrong "generic" args etc)
umapfs uses one of nullfs's functions...
1997-05-25 04:50:02 +00:00
kato
6d01a1befe 1. Added cast and parenthesis in block size calculaion in
union_statfs().
2. staticized union vops.

Submitted by:	Doug Rabson <dfr@nlsystems.com>
1997-05-07 14:37:32 +00:00
joerg
d73eaa67b9 Fix the umount problems for DEVFS.
PR:		3276 & 3469 (the fixes), 2738, 2033 (reports)
Submitted by:	Dmitrij Tejblum <dima@tejblum.dnttm.rssi.ru>
1997-05-03 21:19:54 +00:00
kato
6d4ed1002a Fixed panic message in union_lock(): union_link --> union_lock. 1997-05-03 01:55:19 +00:00
kato
3543c94e94 Access correct union mount point in union_access. Old vnode is saved
in savedvp variable and it is used for the argument of
MOUNTTOUNIONMOUNT().  I didn't realize ap->a_vp is modified before
MOUNTTOUNIONMOUNT(), so the change by revision 1.22 is incorrect.
1997-05-02 03:21:54 +00:00
sos
0480684d63 Remove the dependancy on DEV_BSIZE, now specfs works on != 512byte
sector devices given that the fs uses a blocksize of at least a physical
sector size.
1997-05-01 19:12:22 +00:00
kato
8ed1e5f090 Revised fix for locking violation when unionfs calls vput with
UN_KLOCK flag.

When UN_KLOCK is set, VOP_UNLOCK should keep uppervp locked and clear
UN_ULOCK flag.  To do this, when UN_KLOCK is set, (1) union_unlock
clears UN_ULOCK and does not clear UN_KLOCK, (2) union_lock() does not
access uppervp and does not clear UN_KLOCK, and (3) callers of
vput/VOP_UNLOCK should clear UN_KLOCK.  For example, vput becomes:

	SETKLOCK(union_node);
	vput(vnode);
	CLEARKLOCK(union_node);

where SETKLOCK macro sets UN_KLOCK and CLEARKLOCK macro clears
UN_KLOCK.
1997-04-29 02:06:07 +00:00
alex
137a8b8024 Removed bogon from previous commit: doubly included sys/systm.h. 1997-04-27 21:32:21 +00:00
alex
f000c2c35f Prevent debugger attachment to init when securelevel > 0.
Noticed by:	Brian Buchanan <brian@wasteland.calbbs.com>
1997-04-27 19:02:37 +00:00
kato
472a01781c Undo 1.29. 1997-04-27 10:49:37 +00:00
kato
502e72cb9c Do nothing instead of adjusting un_flags when (uppervp is locked) &&
(UN_ULOCK is not set) in union_lock.  This condition may indicate
race.  DIAGNOSTIC kernel still panic here.
1997-04-26 13:43:25 +00:00
kato
3489b2e78d Do not clear UN_ULOCK in certain case.
Our vput calls vm_object_deallocate() --> vm_object_terminate().  The
vm_object_terminate() calls vn_lock(), since UN_LOCKED has been
already cleared in union_unlock().  Then, union_lock locks upper vnode
when UN_ULOCK is not set.  The upper vnode is not unlocked when
UN_KLOCK is set in union_unlock(), thus, union_lock tries to lock
locked vnode and we get panic.
1997-04-26 04:09:40 +00:00
kato
f6f6759e21 Dirty change in union_lock(). Sometimes upper vnode is locked without
UN_ULOCK flag.  This shows a locking violation but I couldn't find the
reason UN_ULOCK is not set or upper vnode is not unlocked.  I added
the code that detect this case and adjust un_flags.  DIAGNOSTIC kernel
doesn't adjust un_flags, but just panic here to help debug by kernel
hackers.
1997-04-21 15:32:24 +00:00
kato
82ccb21289 Replace VOP_LOCK with vn_lock. 1997-04-21 12:40:42 +00:00
dyson
2a2e02b1cf Fix both a problem with accessing backing objects, and also release
the process map on nonexistant pages.
PR:		kern/3327
Submitted by:	Tor Egge <Tor.Egge@idi.ntnu.no>
1997-04-20 17:12:11 +00:00
kato
510586dbcd Avoid `lock against myself' panic by following operation:
# mount -t union (or null) dir1 dir2
	# mount -t union (or null) dir2 dir1

The function namei in union_mount calls union_root.  The upper vnode
has been already locked and vn_lock in union_root causes above panic.

Add printf's included in `#ifdef DIAGNOSTIC' for EDEADLK cases.
1997-04-19 06:04:13 +00:00
kato
8aa41dd3dc Fix `locking against myself' panic by multi nullfs mount of same
directory pair.
1997-04-17 11:24:57 +00:00
kato
8d5f374630 Use NULLVP instead of NULL. 1997-04-17 11:17:30 +00:00
kato
a4038201b6 Do not set the uppervp to NULLVP in union_removed_upper. If lowervp
is NULLVP, union node will have neither uppervp nor lowervp.  This
causes page fault trap.

The union_removed_upper just remove union node from cache and it
doesn't set uppervp to NULLVP.  Since union node is removed from
cache, it will not be referenced.

The code that remove union node from cache was copied from
union_inactive.
1997-04-16 16:24:24 +00:00
kato
23aaeee7d3 Undo previous commit to avoid panic, and fix order of argument of
VOP_LINK().  The reason of strange behavior was wrong order of the
argument, that is, the operation

	# ln foo bar

in a union fs tried to do

	# ln bar foo

in ufs layer.

Now we can make a link in a union fs.
1997-04-16 03:08:34 +00:00
kato
8c9468c896 Quick-hack to avoid `lock against myself' panic. It is not the real
fix!

The ufs_link() assumes that vnode is not unlocked and tries to lock it
in certain case.  Because union_link calls VOP_LINK after locking vnode,
vn_lock in ufs_link causes above panic.

Currently, I don't know the real fix for a locking violation in
union_link, but I think it is important to avoid panic.

A vnode is unlocked before calling VOP_LINK and is locked after it if
the vnode is not union fs.  Even though panic went away, the process
that access the union fs in which link was made will hang-up.

Hang-up can be easily reproduced by following operation:

	mount -t union a b
	cd b
	ln foo bar
	ls
1997-04-15 12:56:57 +00:00
kato
a89bb5f7f7 Fix `lockmgr: locking against myself' panic by multi union mount of
same directory pair.

If we do:
    mount -t union a b
    mount -t union a b
then, (1) namei tries to lock fs which has been already locked by
first union mount and (2) union_root() tries to lock locked fs.  To
avoid first deadlock condition, unlock vnode if lowerrootvp is union
node, and to avoid second case, union_mount returns EDEADLK when multi
union mount is detected.
1997-04-14 10:52:25 +00:00
kato
c3f358a1d3 Fix locking violation when accessing `..'.
Obtained from:	NetBSD
1997-04-14 05:13:55 +00:00