peter [Sun, 4 Feb 2001 11:46:17 +0000 (11:46 +0000)]
Pull the rug from under the 'LKM Compatability' macro - PSEUDO_SET().
There are two 3rd party code chunks using this still - the IPv6 stuff and
i4b. Give them a private copy as an alternative to changing them too much.
XXX sys/kernel.h still has a #include <sys/module.h> in it. I will be
taking this out shortly - this affects a number of drivers.
dillon [Sun, 4 Feb 2001 06:19:28 +0000 (06:19 +0000)]
This commit represents work mainly submitted by Tor and slightly modified
by myself. It solves a serious vm_map corruption problem that can occur
with the buffer cache when block sizes > 64K are used. This code has been
heavily tested in -stable but only tested somewhat on -current. An MFC
will occur in a few days. My additions include the vm_map_simplify_entry()
and minor buffer cache boundry case fix.
Make the buffer cache use a system map for buffer cache KVM rather then a
normal map.
Ensure that VM objects are not allocated for system maps. There were cases
where a buffer map could wind up with a backing VM object -- normally
harmless, but this could also result in the buffer cache blocking in places
where it assumes no blocking will occur, possibly resulting in corrupted
maps.
Fix a minor boundry case in the buffer cache size limit is reached that
could result in non-optimal code.
Add vm_map_simplify_entry() calls to prevent 'creeping proliferation'
of vm_map_entry's in the buffer cache's vm_map. Previously only a simple
linear optimization was made. (The buffer vm_map typically has only a
handful of vm_map_entry's. This stabilizes it at that level permanently).
mckay [Sun, 4 Feb 2001 02:02:38 +0000 (02:02 +0000)]
In the hope of saving others from hours of tedious recovery work,
document that cp still isn't very useful for recursive copies even
with the -R flag. This is because hard links are broken by cp.
iedowse [Sun, 4 Feb 2001 01:52:11 +0000 (01:52 +0000)]
Extend the sanity checks in ufs_lookup to ensure that each directory
entry fits within its DIRBLKSIZ block. The surrounding code is
extremely fragile with respect to corruption of the directory entry
'd_reclen' field; if directory corruption occurs, it can blindly
scan forward beyond the end of the filesystem block. Usually this
results in a 'fault on nofault entry' panic.
Directory corruption is now much more likely to be detected, resulting
in a 'ufs_dirbad' panic. If the filesystem is read-only, it will
simply print a warning message, and skip the corrupted block.
brian [Sun, 4 Feb 2001 01:08:22 +0000 (01:08 +0000)]
Untangle some cunfusion between the CLOSE_STAYDOWN, CLOSE_LCP and
CLOSE_NORMAL meanings. CLOSE_NORMAL doesn't change the currently
required state, the others do. This should stop ppp from entering
DATALINK_READY when LCP shutdown doesn't end up happening cleanly.
iedowse [Sat, 3 Feb 2001 21:25:32 +0000 (21:25 +0000)]
Use the correct flags field when checking for a read-only filesystem
in ufs_dirbad(). The mnt_stat.f_flags field is only updated by the
syscalls *statfs and getfsstat, so mnt_flag should be used instead.
This only affects whether or not a panic is generated on detection of
certain types of directory corruption.
jkh [Sat, 3 Feb 2001 20:56:32 +0000 (20:56 +0000)]
Add a -g flag for verifying an installed package against its recorded
checksums (to see if it's been modified post-installation). Naturally,
this mechanism is only as secure as the contents of /var/db/pkg if you're
using it for auditing purposes.
julian [Sat, 3 Feb 2001 17:25:21 +0000 (17:25 +0000)]
Make the code act the same in the case of BRIDGE being defined, but not
turned on, and the case of it not being defined at all.
i.e. Disabling bridging re-enables some of the checks it disables.
Submitted by: "Rogier R. Mulhuijzen" <drwilco@drwilco.net>
peter [Sat, 3 Feb 2001 08:56:52 +0000 (08:56 +0000)]
Move wicontrol from i386 to MI section. (yes, it compiles on alpha, where
theoretically NEWCARD might work one day). if_wi.c is in the MI config
section already.
rwatson [Sat, 3 Feb 2001 02:09:20 +0000 (02:09 +0000)]
o Reinstate Kerberos IV support for sshd when MAKE_KERBEROS4 is
compiled in. This involves a commented out sshd line to match the
remainder of the commented out pam_kerberosIV.so entries. This
doesn't quite restore the correct behavior, as ticket files are
not managed properly, but it's an improvement.
brian [Sat, 3 Feb 2001 00:31:39 +0000 (00:31 +0000)]
o Allow non-root users to open /dev/tun* (remove suser()
in tunopen())
o Change the default device permissions to 0600 root:wheel
(were uucp:dialer)
o Only let root (suser()) change the MTU
This makes it possible for an administrator to open up the
permissions on /dev/tun*, letting non-root programs service
a tun interface. Co-operation is still required with a
priviledged program that will configure the interface side
of things.
phk [Fri, 2 Feb 2001 22:54:41 +0000 (22:54 +0000)]
At the point in time where most devices are created, we don't know what
time it is because boottime is not yet initialized. Finagle the relevant
fields when we get the chance.
dfr [Fri, 2 Feb 2001 10:20:30 +0000 (10:20 +0000)]
* Move exception_return to exception.s which is a more logical home for it.
* Optimise the return path for syscalls so that they only restore a minimal
set of registers instead of performing a full exception_return.
A new flag in the trapframe indicates that the frame only holds partial
state. When it is necessary to perform a full state restore (e.g. after an
execve or signal), the flag is cleared to force a full restore.
grog [Fri, 2 Feb 2001 07:14:13 +0000 (07:14 +0000)]
Allocate lock table and mutex not only for parity plexes, but also for
striped plexes. This prevents various panics introduced in the last
rewrite of the locking code.
Suffered by: "Niels Chr. Bank-Pedersen" <ncbp@bank-pedersen.dk>
jake [Thu, 1 Feb 2001 03:34:20 +0000 (03:34 +0000)]
Implement preemptive scheduling of hardware interrupt threads.
- If possible, context switch to the thread directly in sched_ithd(),
rather than triggering a delayed ast reschedule.
- Disable interrupts while restoring fpu state in the trap handler,
in order to ensure that we are not preempted in the middle, which
could cause migration to another cpu.
iedowse [Wed, 31 Jan 2001 15:16:56 +0000 (15:16 +0000)]
Fsck_ffs did not properly range-check the inode 'di_size'
field, so it was possible for a filesystem marked clean by fsck_ffs
to cause kernel crashes later when mounted. This could occur when
fsck_ffs was used to repair a badly corrupted filesystem.
As pointed out by bde, it is not sufficient to restrict di_size to
just the superblock fs_maxfilesize limit. The use of 32-bit logical
block numbers (both in fsck and the kernel) induces another file
size limit which is usually lower than fs_maxfilesize. Also, the
old 4.3BSD filesystem does not have fs_maxfilesize initialised.
Following this change, fsck_ffs will enforce exactly the same
file size limits as are used by the kernel.
dfr [Wed, 31 Jan 2001 11:17:00 +0000 (11:17 +0000)]
* Move exception_return to exception.s which is a more logical home for it.
* Optimise the return path for syscalls so that they only restore a minimal
set of registers instead of performing a full exception_return.
A new flag in the trapframe indicates that the frame only holds partial
state. When it is necessary to perform a full state restore (e.g. after an
execve or signal), the flag is cleared to force a full restore.
msmith [Wed, 31 Jan 2001 09:35:50 +0000 (09:35 +0000)]
Add some debugging.
Turn off semaphores. Nobody else implements them, and there is lots of
AML out there which does totally absurd things with them, meaning that
if we try to do the right thing we are guaranteed to fail.