Commit graph

25577 commits

Author SHA1 Message Date
Poul-Henning Kamp 855aa097af VOP_BALLOC was never really a VOP in the first place, so convert it
to UFS_BALLOC like the other "between UFS and FFS function interfaces".
2001-04-29 12:36:52 +00:00
Poul-Henning Kamp b7ebffbc08 Add a vop_stdbmap(), and make it part of the default vop vector.
Make 7 filesystems which don't really know about VOP_BMAP rely
on the default vector, rather than more or less complete local
vop_nopbmap() implementations.
2001-04-29 11:48:41 +00:00
Poul-Henning Kamp bdb8855550 Make a panic less misleading. 2001-04-29 11:45:15 +00:00
Poul-Henning Kamp f2ddd13ad2 Call ufs_bmaparray() directly instead of indirectly via VOP_BMAP(). 2001-04-29 10:25:30 +00:00
Poul-Henning Kamp 954a0e256e Remove two unused arguments from ufs_bmaparray(). 2001-04-29 10:24:58 +00:00
Poul-Henning Kamp e955479077 Remove faint traces of blind copy&paste. 2001-04-29 10:23:50 +00:00
Poul-Henning Kamp 0c25dbeb17 Remove faint traces of non-existant ffs_bmap(). 2001-04-29 10:23:32 +00:00
Alfred Perlstein f411fba5d3 Remove incorrect comment.
Submitted by: quinot@inf.enst.fr <quinot@inf.enst.fr>
PR: kern/26893
2001-04-29 03:10:24 +00:00
Greg Lehey 60fb0ce365 Revert consequences of changes to mount.h, part 2.
Requested by:	bde
2001-04-29 02:45:39 +00:00
Daniel C. Sobral 49acc8fe50 Bring in ficl 2.05.
This version has a step debugger, which now completely replaces the
old trace feature. Also, we moved all of the FreeBSD-specific MI
code to loader.c, reducing the diff between this and the official
FICL distribution.
2001-04-29 02:36:36 +00:00
Cameron Grant cd94939222 don't unlock the channel in chn_read, msleep will do it for us.
PR:		kern/26430
2001-04-29 02:31:02 +00:00
David E. O'Brien d856af0b1a Add back in the bits to remove any existing "schg" flags as we have
kernel's out in wild that still have these flags set.
2001-04-29 01:53:57 +00:00
Alfred Perlstein 6157b69f4a Instead of asserting that a mutex is not still locked after unlocking it,
assert that the mutex is owned and not recursed prior to unlocking it.

This should give a clearer diagnostic when a programming error is caught.
2001-04-28 12:11:01 +00:00
John Baldwin 4d4bc9acc6 Add in a missing call to forward_hardclock() in the SMP case.
Submitted by:	bde
2001-04-28 01:37:44 +00:00
Cameron Grant 680307ae14 be more specific in identifying the chip type 2001-04-27 22:26:36 +00:00
Alfred Perlstein 93c7ba9f09 Address a number of problems with sysctl_vm_zone().
The zone allocator's locks should be leaflocks, meaning that they
should never be held when entering into another subsystem, however
the sysctl grabs the zone global mutex and individual zone mutexes
while holding the lock it calls SYSCTL_OUT which recurses into the
VM subsystem in order to wire user memory to do a safe copy.  This
can block and cause lock order reversals.

To fix this:
  lock zone global.
  get a count of the number of zones.
  unlock global.
  allocate temporary storage.
  format and SYSCTL_OUT the banner.
  lock global.
  traverse list.
    make sure we haven't looped more than the initial count taken
      to avoid overflowing the allocated buffer.
    lock each nodes.
    read values and format into buffer.
    unlock individual node.
  unlock global.
  format and SYSCTL_OUT the rest of the data.
  free storage.
  return.

Other problems included not checking for errors when doing sysctl out
of the column header.  Fixed.

Inconsistant termination of the copied string. Fixed.

Objected to by: des (for not using sbuf)

Since the output is not variable length and I'm actually over
allocating signifigantly and I'd like to get this fixed now, I'll
work on the sbuf convertion at a later date.  I would not object
to someone else taking it upon themselves to convert it to sbuf.
I hold no MAINTIANER rights to this code (for now).
2001-04-27 22:24:45 +00:00
Bill Fenner 4f3c11a654 Better handling of ioctl(SIOCSIFFLAGS) failing in ifpromisc():
- Don't print the "promiscuous mode (enabled|disabled)" on failure
- Restore the reference count on failure
2001-04-27 22:20:22 +00:00
Søren Schmidt ed27f87339 Move the disklabel construction to the attach function instead of
in open. This prevent panics when a the disklabel is accessed on
an ATA-RAID subdisk.
2001-04-27 19:47:33 +00:00
John Baldwin 6caa8a1501 Overhaul of the SMP code. Several portions of the SMP kernel support have
been made machine independent and various other adjustments have been made
to support Alpha SMP.

- It splits the per-process portions of hardclock() and statclock() off
  into hardclock_process() and statclock_process() respectively.  hardclock()
  and statclock() call the *_process() functions for the current process so
  that UP systems will run as before.  For SMP systems, it is simply necessary
  to ensure that all other processors execute the *_process() functions when the
  main clock functions are triggered on one CPU by an interrupt.  For the alpha
  4100, clock interrupts are delievered in a staggered broadcast fashion, so
  we simply call hardclock/statclock on the boot CPU and call the *_process()
  functions on the secondaries.  For x86, we call statclock and hardclock as
  usual and then call forward_hardclock/statclock in the MD code to send an IPI
  to cause the AP's to execute forwared_hardclock/statclock which then call the
  *_process() functions.
- forward_signal() and forward_roundrobin() have been reworked to be MI and to
  involve less hackery.  Now the cpu doing the forward sets any flags, etc. and
  sends a very simple IPI_AST to the other cpu(s).  AST IPIs now just basically
  return so that they can execute ast() and don't bother with setting the
  astpending or needresched flags themselves.  This also removes the loop in
  forward_signal() as sched_lock closes the race condition that the loop worked
  around.
- need_resched(), resched_wanted() and clear_resched() have been changed to take
  a process to act on rather than assuming curproc so that they can be used to
  implement forward_roundrobin() as described above.
- Various other SMP variables have been moved to a MI subr_smp.c and a new
  header sys/smp.h declares MI SMP variables and API's.   The IPI API's from
  machine/ipl.h have moved to machine/smp.h which is included by sys/smp.h.
- The globaldata_register() and globaldata_find() functions as well as the
  SLIST of globaldata structures has become MI and moved into subr_smp.c.
  Also, the globaldata list is only available if SMP support is compiled in.

Reviewed by:	jake, peter
Looked over by:	eivind
2001-04-27 19:28:25 +00:00
Andrew Gallatin e5878540ed Make stathz match reality on platforms like the 4100 where hz!=1024
It might be more correct to make stathz as close as possible to 128,
but that would involve adding complexity to the clock intr path, which
I don't want to do.
2001-04-27 18:21:25 +00:00
Alfred Perlstein 3abedb4e01 Actually show the values that tripped the assertion "receive 1" 2001-04-27 13:42:50 +00:00
Robert Watson 80c9c40df9 o Remove the disabled p_cansched() test cases that permitted users to
modify the scheduling properties of processes with a different real
  uid but the same effective uid (i.e., daemons, et al).  (note: these
  cases were previously commented out, so this does not change the
  compiled code at al)

Obtained from:	TrustedBSD Project
2001-04-27 01:56:32 +00:00
John Baldwin 23936bbf45 Initiate the deorbit burn sequence for sys/ipl.h by moving the software
interrupt priorities over to sys/interrupt.h next to the software interrupt
API.
2001-04-27 00:29:45 +00:00
John Baldwin bf4c03d0e9 Initialize p_md.md_kernnest to 1 for newly fork'd processes since they
start off in the kernel.
2001-04-26 23:52:40 +00:00
Poul-Henning Kamp 8ee8b21b48 vfs_subr.c is getting rather fat. The underlying repocopy and this
commit moves the filesystem export handling code to vfs_export.c
2001-04-26 20:47:14 +00:00
Bill Paul 6263665f87 Fix the definitions for memory bank sizes, which I somehow got wrong.
The constant I was using was correct, but I mislabeled it as 256K when
it should have been 512K. This doesn't actually change the code, but
it clarifies things somewhat.

Submitted by:	Chuck Cranor <chuck@research.att.com>
2001-04-26 16:40:45 +00:00
Jake Burkholder 7a72decc2e Remove a leading underscore that prevented I386_CPU kernels from
compiling.

Submitted by:	Alexander N. Kabaev <ak03@gte.com>
PR:		kern/26858
2001-04-26 13:57:03 +00:00
Mike Smith ed1c82f450 More new Dell PCI IDs.
Submitted by:	"Marty Moll" <martym@arbor.edu>
2001-04-26 01:14:37 +00:00
Kirk McKusick c9509f5865 Rather than copying all the indirect blocks of the snapshot,
simply mark them as BLK_NOCOPY. This trick cuts the initial
size of the snapshot in half and cuts the time to take a
snapshot by a third.
2001-04-26 00:50:53 +00:00
Mike Smith 71665b0add The PERC 3/Di in the Dell PowerEdge 2250 has a new subdevice ID.
Submitted by:	Chris Csanady <cc@ameslab.gov>
2001-04-26 00:32:02 +00:00
Alfred Perlstein 06336fb26d Sendfile is documented to return 0 on success, however if when a
sf_hdtr is used to provide writev(2) style headers/trailers on the
sent data the return value is actually either the result of writev(2)
from the trailers or headers of no tailers are specified.

Fix sendfile to comply with the documentation, by returning 0 on
success.

Ok'd by: dg
2001-04-26 00:14:14 +00:00
Paul Richards 9ca3a84af2 A bogus check for a char device also matched symbolic links.
Replace it with a correct check using S_ISCHR()

Symbolic links will now work again in linux compatibility.
2001-04-25 22:07:16 +00:00
David E. O'Brien ea87b3cb61 Don't install KO's with the "schg" flag.
We are way too inconsistent with our setting of the "schg" flag, and in
our default install, it doesn't really offer any additional security.

Reviewed by:	arch@
2001-04-25 20:56:15 +00:00
David E. O'Brien 58c9a20771 Fix SCM ID's and remove tailing blanks. 2001-04-25 20:40:57 +00:00
John Baldwin bb61024d88 - Make the dumping of console messages from the secondary CPU's to the
kernel console be #ifdef DIAGNOSTIC.
- Don't set ktr_mask in release_aps().
2001-04-25 17:24:57 +00:00
Andrew Gallatin 7b6630700d alpha_fpstate_save is fairly expensive (critical enter/exit, possibly
saves 32 registers) to do on every context switch.  This is only required
for SMP, so only do it there.

We should also look at moving the critical enter/exit out to the callers
2001-04-25 13:57:33 +00:00
Bruce Evans e8a28f87d8 MFffs ffs_balloc.c 1.5.
Long ago, bread() set b_blkno to the disk block number as a side effect
of doing physical i/o (or it just retained the setting from when the
i/o was done).  The setting is lost when buffers go away and then are
reconsituted from VM.  bread() originally compensated by doing a
VOP_BMAP() to recover b_blkno, but this was no good since it sometimes
caused extra i/o or even deadlock for bread()ing metadata to do the
bmap.  This was fixed in vfs_bio.c 1.33 (1995/03/03) and ffs_balloc.c
1.5, etc., by removing the VOP_BMAP() from bread() and breadn(), and
changing all (?) places that used b_blkno to set it if necessary.

ext2fs was not imported until later in 1995 and was still depending on
the old behaviour of bread() in at least ext2_balloc().  This caused
filesystem and file corruption by clobbering direct block numbers in
inodes.
2001-04-25 10:33:09 +00:00
Seigo Tanimura ebdc3f1d2d Do not leave a process with no credential in zombproc.
Reviewed by:	jhb
2001-04-25 10:22:35 +00:00
Kirk McKusick 112f737245 When closing the last reference to an unlinked file, it is freed
by the inactive routine. Because the freeing causes the filesystem
to be modified, the close must be held up during periods when the
filesystem is suspended.

For snapshots to be consistent across crashes, they must write
blocks that they copy and claim those written blocks in their
on-disk block pointers before the old blocks that they referenced
can be allowed to be written.

Close a loophole that allowed unwritten blocks to be skipped when
doing ffs_sync with a request to wait for all I/O activity to be
completed.
2001-04-25 08:11:18 +00:00
Poul-Henning Kamp a13234bb35 Move the netexport structure from the fs-specific mountstructure
to struct mount.

This makes the "struct netexport *" paramter to the vfs_export
and vfs_checkexport interface unneeded.

Consequently that all non-stacking filesystems can use
vfs_stdcheckexp().

At the same time, make it a pointer to a struct netexport
in struct mount, so that we can remove the bogus AF_MAX
and #include <net/radix.h> from <sys/mount.h>
2001-04-25 07:07:52 +00:00
Warner Losh 40afc1048e Ignore chflags errors. This makes installing to nfs mounted target
directories work.
2001-04-25 06:19:58 +00:00
Chris D. Faulhaber 0f6263079e o Separate acl_t into internal and external representations as
required by POSIX.1e.  This maintains the current 'struct acl'
  in the kernel while providing the generic external acl_t
  interface required to complete the ACL editing library.
o Add the acl_get_entry() function.
o Convert the existing ACL utilities, getfacl and setfacl, to
  fully make use of the ACL editing library.

Obtained from:	TrustedBSD Project
2001-04-24 22:45:41 +00:00
Cameron Grant 15418cf2bb get the parameters to pci_write_config the right way round. this may fix
some non-functional cards/machines
2001-04-24 22:35:11 +00:00
John Baldwin 9e438eb4f5 Add a new field 'md_kernnest' to the alpha machine dependent process
structure.  This field keeps track of how many levels deep we are nested
into the kernel.  The nesting level is bumped at the start of a trap,
interrupt, syscall, or exception and is decremented on return.  This is
used to detect the case when the kernel is returning back to a kernel
context in exception_return().  If we are returning to the kernel we need
to update the globaldata pointer register saved in the stack frame in case
we have switched CPU's between taking the initial interrupt that saved the
frame and returning.  If we don't do this fixup it is possible for a CPU to
use the wrong per-cpu data.  On UP systems this is not a problem, so the
code is conditional on SMP.

A count was used instead of simply checking the process status register in
the frame during exception_return() since there are critical sections at
the very start and end of a trap, exception, or interrupt from userland in
which we could trash the t7 register being used in userland.  The counter
is incremented after adn before these critical sections respectively so
that we will not overwrite the saved t7 register if we are interrupted
during one of these critical sections.
2001-04-24 21:06:53 +00:00
Thomas Moestl 83f3198b2b Change uipc_sockaddr so that a sockaddr_un without a path is returned
nam for an unbound socket instead of leaving nam untouched in that case.
This way, the getsockname() output can be used to determine the address
family of such sockets (AF_LOCAL).

Reviewed by:	iedowse
Approved by:	rwatson
2001-04-24 19:09:23 +00:00
Robert Watson c7e1887023 o Change a suser() call to a suser_xxx(..., PRISON_ROOT) call in the
linuxulator so as to allow privileged processes within a jail() to
  invoke the Linux initgroups() system call.  This allows the Linux
  "su" to work properly (better) when running a complete Linux
  environment under jail().  This problem was reported by Attila
  Nagy <bra@fsn.hu>.

Reviewed by:	marcel
2001-04-24 19:08:53 +00:00
Doug Rabson a78af1ccdb When switching backing store during signal delivery, do the switch before
creating the register frame for calling the handler. Also discard that
frame before switching back to the old backing store after the handler
returns.
2001-04-24 15:57:16 +00:00
Doug Rabson 2c7122ff0f Align stack pointer and backing store pointer to 16 byte boundary when
delivering signals.
2001-04-24 15:55:47 +00:00
Doug Rabson 1eaf877f2e Don't trash the user's pr on syscalls. 2001-04-24 15:54:23 +00:00
Sheldon Hearn 4721e8a849 Revert previous delta, which was completely bogus.
The perceived problem was the symptom of a local error.
2001-04-24 12:30:49 +00:00
Sheldon Hearn da82ff05af Disconnect linux from the build. The buildkernel target has been
breaking on linux for more than two days because sys_exit_args
referenced in linux_sysent.c does not exist.
2001-04-24 08:56:42 +00:00
John Baldwin 33a9ed9d0e Change the pfind() and zpfind() functions to lock the process that they
find before releasing the allproc lock and returning.

Reviewed by:	-smp, dfr, jake
2001-04-24 00:51:53 +00:00
Ian Dowse 5d69bac493 Pre-dirpref versions of fsck may zero out the new superblock fields
fs_contigdirs, fs_avgfilesize and fs_avgfpdir. This could cause
panics if these fields were zeroed while a filesystem was mounted
read-only, and then remounted read-write.

Add code to ffs_reload() which copies the fs_contigdirs pointer
from the previous superblock, and reinitialises fs_avgf* if necessary.

Reviewed by:	mckusick
2001-04-24 00:37:16 +00:00
Greg Lehey b186f62cbc Back out previous commit.
Requested by:	bde
2001-04-23 23:51:17 +00:00
Thomas Moestl e15480f8dd Fix a bug introduced in the last commit: vaccess_acl_posix1 only checked
the file gid gainst the egid of the accessing process for the
ACL_GROUP_OBJ case, and ignored supplementary groups.

Approved by:	rwatson
2001-04-23 22:52:26 +00:00
Orion Hodson 3c43ddee02 Add als4000 subdir. 2001-04-23 21:58:23 +00:00
Orion Hodson 1f2b9fe67a Initial version of Avance Logic ALS4000 pcm driver. 2001-04-23 21:53:12 +00:00
Matt Jacob 2b4169610b fix it so it compiles again 2001-04-23 18:51:54 +00:00
Matt Jacob 140509ab5d fix it so it compiles again after twerpage elsewhere 2001-04-23 18:38:01 +00:00
Matt Jacob 3be6e0c249 add this ridiculous include foo so it will compile again 2001-04-23 18:14:41 +00:00
Matt Jacob ac60aa4908 Fix includes so it compiles again. 2001-04-23 18:08:54 +00:00
Greg Lehey d98dc34f52 Correct #includes to work with fixed sys/mount.h. 2001-04-23 09:05:15 +00:00
Greg Lehey 97d5f7bb3b Correct #includes to work with fixed sys/mount.h. 2001-04-23 08:28:44 +00:00
Greg Lehey e84a5d8372 Remove bogus #include and duplicate definition of AF_MAX. These were
made necessary by breakage in usr.sbin/pstat and usr.bin/fstat, since
fixed.

Suggested by:	phk
Unearthed by:	John Hood <jhood@sitaranetworks.com>
2001-04-23 08:17:18 +00:00
Greg Lehey 4c68f41dda Add address families AF_SLOW and AF_SCLUSTER. These are used by the
Sitara QoSworks box.

Obtained from:	Sitara Networks Inc.
2001-04-23 05:13:18 +00:00
Joerg Wunsch fc89704c57 Fix the `tape drive spinning indefinately upon mt stat' problem.
With the recent changes in the CAM error handling, some problems in
the error handling of sa(4) have been uncovered.  Basically, a number
of conditions that are not actually errors have been mistreated as
genuine errors.  In particular:

. Trying to read in variable length mode with a mismatched blocksize
  between the on-tape (virtual) blocks and the read(2) supplied buffer
  size, causing an ILI SCSI condition, have caused an attempt to retry
  the supposedly `errored' transfer, causing the tape to be read
  continuously until it eventually hit EOM.  Since by default any
  simple mt(1) operation does an initial test read, an `mt stat' was
  sufficient to trigger this bug.

  Note that it's Justin's opinion that treating a NO SENSE as an EIO
  is another bug in CAM.  I feel not authorized to fix cam_periph.c
  without another confirmation that i'm on the right track, however.

. Hitting a filemark caused the read(2) syscall to return EIO, instead
  of returning a `short read'.  Note that the current fix only solves
  this problem in variable length mode.  Fixed length mode uses a
  different code path, and since i didn't grok all the intentions behind
  that handling, i did not touch it (IOW: it's still broken, and you get
  an EIO upon hitting a filemark).

The solution is to keep track of those conditions inside saerror(),
and upon completion to not call cam_periph_error() in that case.  We
need to make sure that the device gets unfrozen if needed though (in
case of actual errors, cam_periph_error() does this on our behalf).

Not objected by:       mjacob (who currently doesn't have the time to
			      review the patch)
2001-04-22 20:13:28 +00:00
David E. O'Brien 1690d30589 Removed old version of vaccess_acl_posix1e() that snuck back in rev 1.146.
Submitted by (with good eye):	Niels Chr. Bank-Pedersen <ncbp@bank-pedersen.dk>
2001-04-22 17:01:39 +00:00
David E. O'Brien ea88c01d6e Style(9) fixes:
* get rid of space (0x20) before tab (^I)
* indent with ^I, not 0x20
* continuation line for prototypes is for 0x20's past function's name col.
* etc.
2001-04-22 01:56:09 +00:00
Matt Jacob eab341ffa4 add MARVELL to the list of phys to go into miibus 2001-04-21 23:42:19 +00:00
Robert Watson 5ea6583e2d o Remove comment indicating policy permits loop-back debugging, but
semantics don't: in practice, both policy and semantics permit
  loop-back debugging operations, only it's just a subset of debugging
  operations (i.e., a proc can open its own /dev/mem), and that's at a
  higher layer.
2001-04-21 22:41:45 +00:00
Andrew Gallatin 62dbd2f29e Block out all interrupts, even machine checks, for critical_enter()
This is will be required to prevent lowering the ipl when a critical_enter()
is present in the interrupt path when handling a machine check.

reviewed by: jhb
2001-04-21 21:44:39 +00:00
Chris D. Faulhaber d33d158eb5 Fix the cut'n'paste style bugs I introduced in rev 1.16
(spaces -> tab(s) in #define's)
2001-04-21 19:52:06 +00:00
Andrey A. Chernov 475693945d Upper limit of mousechar start is UCHAR_MAX - 3, not UCHAR_MAX - 4
Restore original characters when mousechar start changes, not always 0-3

PR:		24437
Submitted by:	Cejka Rudolf <cejkar@dcse.fee.vutbr.cz>
2001-04-21 14:11:48 +00:00
Warner Losh 4d98b7a61b My fix to NEWCARD for getting the function type broke oldcard due to
a name conflict.

Pointed out by: markm

# I had to login to freefall to make this commit, so something maybe up
2001-04-21 14:10:32 +00:00
Warner Losh 04a3a05381 Set the device name for NEC PC98 PCMCIA Controller on boot.
# We really need to allocate i/o ports for it, but I need to learn
# the pc98 bus space better before attempting that.
2001-04-21 07:08:03 +00:00
Warner Losh dc8e185f93 Add accessor/ivar for the "function". This is so we can generically
match disks and serial ports and maybe others.
2001-04-21 04:08:39 +00:00
Mike Smith b8ce799cc4 Avoid divide-by-zero for devices that the adapter has not negotiated a
transfer speed with.
2001-04-21 04:08:26 +00:00
Greg Lehey ccd58ea72d Add entry for swdog, Sitara Networks' watchdog timer.
Submitted by: John Hood <jhood@sitaranetworks.com>
2001-04-21 03:09:42 +00:00
Warner Losh 19f1fe42e6 Only try to delete the resource if we actually got it. 2001-04-21 02:29:09 +00:00
John Baldwin 9d4f526475 Spelling nit: acquring -> acquiring.
Reported by:	T. William Wells <bill@twwells.com>
2001-04-21 01:50:32 +00:00
Alfred Perlstein 98689e1e70 Assert that when using an interlock mutex it is not recursed when lockmgr()
is called.

Ok'd by: jhb
2001-04-20 22:38:40 +00:00
Alfred Perlstein 38bb635d3d add a comment to note that a process's vmspace may change, but so far
only aiod does this and is also marked P_SYSTEM, the locations that
reference p->p_vmspace usually do it within the context of the caller,
the async access from the vm system is protected by the fact that it
will skip over P_SYSTEM processes.

Ok'd by: jhb
2001-04-20 22:34:48 +00:00
Jesper Skriver d1745f454d Say goodbye to TCP_COMPAT_42
Reviewed by:	wollman
Requested by:	wollman
2001-04-20 11:58:56 +00:00
Hajimu UMEMOTO d23d305519 Fix typo in previous commit.
Submitted by:	JINMEI Tatuya <jinmei@isl.rdc.toshiba.co.jp>
2001-04-20 08:43:20 +00:00
John Baldwin 242d02a13f Make the ap_boot_mtx mutex static. 2001-04-20 01:09:05 +00:00
John Baldwin 882796f8c2 Split up the db_printf's for 'show pcpu' so that we only output at most one
line for each db_printf().  Also, just use spaces to line the columns up
rather than trying to be fancy with tabs.
2001-04-20 01:08:27 +00:00
Andrew Gallatin 29b3d1c151 GC some debugging code that's been #if 0'ed since we got the file from
NetBSD
2001-04-20 00:55:21 +00:00
Hajimu UMEMOTO 8d64298407 - Fix to receive icmp6 echo reply within the host itself to ff02::1.
- Fix to receive icmp6 echo reply to link-local of itself.

Reported by:	Eriya Akasaka <eakasaka@rodfbs.org>
Submitted by:	JINMEI Tatuya <jinmei@isl.rdc.toshiba.co.jp>
2001-04-19 23:51:20 +00:00
David E. O'Brien c612c69dc7 style(9) edit.
Prompted by email from:	dfr
2001-04-19 23:15:06 +00:00
Chris D. Faulhaber 51be6918b5 o Document UFS_ACL option
o Add link to src/sys/ufs/ufs/README.extattr for UFS_EXTATTR* options

Reviewed by:	rwatson
Obtained from:	TrustedBSD Project
2001-04-19 21:33:52 +00:00
John Baldwin d8915a7f34 - Whoops, forgot to enable the clock lock in the spin order list on the
alpha.
- Change the Debugger() functions to pass in the real function name.
2001-04-19 15:49:54 +00:00
Orion Hodson 5090c9953c Add power on to start sequence for 4.x kernels.
PR:		kern/26255
Submitted by:	WATANABE Kiyoshi <aab10490@pop16.odn.ne.jp>
2001-04-19 13:23:50 +00:00
Doug Rabson 2322ee63c2 Don't unwrap the function descriptor used as the callout argument to
fork_exit(). The MI version of fork_exit() needs a real function
descriptor, not a simple function pointer.
2001-04-19 12:35:47 +00:00
Doug Rabson eed829bca9 Don't take the Giant mutex for clock interrupts. 2001-04-19 12:34:23 +00:00
Alfred Perlstein d8d5fa8805 vnode_pager_freepage() is really vm_page_free() in disguise,
nuke vnode_pager_freepage() and replace all calls to it with vm_page_free()
2001-04-19 06:18:23 +00:00
Warner Losh 3fb5ffd286 Indirect off cinfo rather than calling pcic_ functions directly. This
means that the pcic98 functionality might now work (I've tested it on
my pcic machine, but not the pcic98).  Since these functions are
rarely called, it is unlikely that this will have a measurable impact
on performance.
2001-04-19 05:45:51 +00:00
Warner Losh 7402675de4 First cut at bringing NEC PC98 original pccard bridge code back into
FreeBSD.  This code doesn't work just yet, but does compile.  We need
to start indirecting via the cinfo pointers, rather than directly
calling pcic_*.  There may be other issues as well, but you gotta
start somewhere.

Obtained from: PAO3
2001-04-19 00:04:08 +00:00
Bosko Milekic d04d50d1f7 Fix inconsistency in setup of kernel_map: we need to make sure that
we also reserve _adequate_ space for the mb_map submap; i.e. we need
space for nmbclusters, nmbufs, _and_ nmbcnt. Furthermore, we need to
rounddown, and not roundup, so that we are consistent.

Pointed out by: bde
2001-04-18 23:54:13 +00:00
Alfred Perlstein 2f3cf91876 Check validity of signal callback requested via aio routines.
Also move the insertion of the request to after the request is validated,
there's still looks like there may be some problems if an invalid address
is passed to the aio routines, basically a possible leak or having a
not completely initialized structure on the queue may still be possible.

A new sig macro was made _SIG_VALID to check the validity of a signal,
it would be advisable to use it from now on (in kern/kern_sig.c) rather
than rolling your own.

PR: kern/17152
2001-04-18 22:18:39 +00:00
John Baldwin 08b0f4f908 Convert the protection of hte i8254 from critical_enter/exit like it is
on the x86.
2001-04-18 21:47:48 +00:00
Warner Losh a5e25da40d Back out 1.103. It wasn't approved by the owner of the file and
introduced style bugs.

Submited by: bde
2001-04-18 20:57:43 +00:00
Alfred Perlstein a9fa2c05fc Protect pager object creation with sx locks.
Protect pager object list manipulation with a mutex.

It doesn't look possible to combine them under a single sx lock because
creation may block and we can't have the object list manipulation block
on anything other than a mutex because of interrupt requests.
2001-04-18 20:24:16 +00:00
John Baldwin e18935281b Back out the previous revision as it causes random sig 11's to userland
processes until a better fix is found.

Submitted by:	gallatin
2001-04-18 17:17:55 +00:00
Doug Rabson ff37c2003c Don't panic when we try to modify the kernel pmap. 2001-04-18 15:08:37 +00:00
Doug Rabson 169915f56d Print an approximation of the function arguments in the stack trace. 2001-04-18 15:07:56 +00:00
Doug Rabson 072c3a5395 Implement a simple stack trace for DDB. This will have to be redone
if/when we change to a more modern toolchain.
2001-04-18 14:15:45 +00:00
Doug Rabson dd85faa611 Record the right value for tf_ndirty for kernel interruptions so that
we can examine the interrupted register stack frame in DDB.
2001-04-18 14:10:43 +00:00
Ruslan Ermilov 701d4ac0c1 mdoc(7) police: fixed whatis(1) entry. 2001-04-18 12:56:15 +00:00
Seigo Tanimura 759cb26335 Reclaim directory vnodes held in namecache if few free vnodes are
available.

Only directory vnodes holding no child directory vnodes held in
v_cache_src are recycled, so that directory vnodes near the root of
the filesystem hierarchy remain in namecache and directory vnodes are
not reclaimed in cascade.

The period of vnode reclaiming attempt and the number of vnodes
attempted to reclaim can be tuned via sysctl(2).

Suggested by:	tegge
Approved by:	phk
2001-04-18 11:19:50 +00:00
Alfred Perlstein 4e2e455f2e NFS module now requires nfs_lock.c 2001-04-18 08:33:52 +00:00
Poul-Henning Kamp 793d6d5d57 bread() is a special case of breadn(), so don't replicate code. 2001-04-18 07:16:07 +00:00
Warner Losh f4b5609430 Add some more O2Micro devices I gleened from the web site/linux pcmcia cs.
Add TI4451 as well.

These are untested since I don't have the hardware to test against.

Also, some O2Micro devices are #define w/o numbers as place holders so that
I can encourage people to submit them when they appear in the channels.
2001-04-18 05:45:15 +00:00
Alfred Perlstein 305dd591ee Fix the botched rev 1.59 where I made it such that without INVARIANTS
the map is never locked.

Submitted by: tegge
2001-04-18 05:30:24 +00:00
Warner Losh 029f7392a5 Add support for the OZ6832.
Submitted by: Martin Nilsson <martin@svenskabutiker.se>
2001-04-18 04:42:11 +00:00
Warner Losh c18e19a64d Move setting of TI113X_PCI_CARD_CONTROL register sooner 2001-04-17 23:56:12 +00:00
Warner Losh 1f3da134c7 Minor comment that missed the last change 2001-04-17 23:50:24 +00:00
Warner Losh 82d3fe450d When booting, turn on the 3E0 compatibility address for ricoh cardbus
parts.  This is based on the newcard code that turns it off :-).  We
can now reboot after NEWCARD or Windows and have OLDCARD work.  Add
support for the RL5C466 while I'm at it.

Treat TI1031 the same as the CLPD6832.  It doesn't work yet, but sucks
less than it did before.

Also add a few #defines for other changes in the pipe.
2001-04-17 23:15:00 +00:00
Dima Dorfman 25c7870e5d Make this driver play ball with devfs(5).
Reviewed by:	brian
2001-04-17 20:53:11 +00:00
Alfred Perlstein e04670b734 Add a sanity check on ucred refcount.
Submitted by: Terry Lambert <terry@lambert.org>
2001-04-17 20:50:43 +00:00
Alfred Perlstein 603c86672c Implement client side NFS locks.
Obtained from: BSD/os
Import Ok'd by: mckusick, jkh, motd on builder.freebsd.org
2001-04-17 20:45:23 +00:00
Poul-Henning Kamp 0dfba3cef1 Write a switch statement as less obscure if statements. 2001-04-17 20:22:07 +00:00
John Baldwin 5d52039847 Save are floating point state in cpu_switch() if needed instead of relying
completely on lazy floating point state saving.  This is needed for the
SMP case since processes can migrate to other CPUs.

Submitted by:	dfr
2001-04-17 18:27:55 +00:00
Kris Kennaway f0a04f3f51 Randomize the TCP initial sequence numbers more thoroughly.
Obtained from:	OpenBSD
Reviewed by:	jesper, peter, -developers
2001-04-17 18:08:01 +00:00
John Baldwin e3ee8974e3 Fix an old bug related to BETTER_CLOCK. Call forward_*clock if SMP
and __i386__ are defined rather than if SMP and BETTER_CLOCK are defined.
The removal of BETTER_CLOCK would have broken this except that kern_clock.c
doesn't include <machine/smptests.h>, so it doesn't see the definition of
BETTER_CLOCK, and forward_*clock aren't called, even on 4.x.  This seems to
fix the problem where a n-way SMP system would see 100 * n clk interrupts
and 128 * n rtc interrupts.
2001-04-17 17:53:36 +00:00
Nick Hibma be971a7240 Regen. 2001-04-17 15:53:35 +00:00
Nick Hibma 177f46f166 Add the HP scanner 3400C 2001-04-17 15:53:20 +00:00
Nick Hibma e47670c92d Regen. 2001-04-17 15:34:44 +00:00
Nick Hibma dacb51ca16 Lexar jumpSHOT Id.
Submitted by:	gshapiro
2001-04-17 15:34:22 +00:00
Andrew Gallatin 73f446d078 set gd_other_cpus later, when we have a better idea what the other cpus
are.

submitted by: jhb
2001-04-17 14:59:05 +00:00
Andrew Gallatin 386eac30d9 Improved support for alpha SMP. The following commit gets dual AS2100s
and AS4100s into single user mode. This work was done jointly by jhb and
myself, and builds on dfr's earlier work.

smp_init_secondary() / smp_start_secondary()
- use the uniq val to pass the globalp (me)
- fancy footwork to take any pending machine checks (me)
- doing things the FreeBSD way and getting the per-cpu idleproc created
  correctly, and synchronizing the startup of secondaries (jhb)

mp_start()
- better recognition of available cpus (jhb)

smp_rendezvous()
- if smp hasn't started, only run the rendezvous function on the current
cpu.  Sleuthing and (prior) incorrect fix by me, correct fix by jhb

smp_handle_ipi()
- more verbose handling of console messages (jhb)
- grab sched lock around setting PS_ASTPENDING (jhb)

forward_*clock()
- commented out.  Joint decision by dfr, jhb and myself

 General synchronization improvements (more mb()s, etc) (jhb)

 Printf cleanups (joint)

 Whitespace cleanups (jhb)
2001-04-17 14:55:09 +00:00
Andrew Gallatin 3706fa1be6 Changes to support SMP:
- don't do the stack overflow sanity check on MP systems -- p->p_addr
will be malloc'ed memory (not K0SEG) and the check will fail.

- don't ignore clock interrupts on secondaries.  Alphas apparently
roundrobin clock interrupts to all cpus, so we're going to take clock
interrupts on all CPUS and not forward them.
2001-04-17 14:20:33 +00:00
Andrew Gallatin ed4835b64d changes to smp_init_secondary_glue():
- use the unique value to save the per-cpu globalp struct like the
  comment says

- don't lower the ipl to ALPHA_PSL_IPL_HIGH: we may have a pending machine
  check to take and we're not prepared for that yet, as we haven't setup
  our interrupt entry points. (this may only happen on sable/lynx)

- indicate the fact that the working version of smp_init_secondary() doesn't
  return (this is tied up in other changes and hasn't yet been committed).
2001-04-17 14:15:12 +00:00
Brian Somers 395692dae2 Dont (ab)use drv2 to know if (si_flags & SI_NAMED) (pointed out by dd)
Call cdevsw_remove when we unload.
2001-04-17 09:59:34 +00:00
Poul-Henning Kamp f84e29a06c This patch removes the VOP_BWRITE() vector.
VOP_BWRITE() was a hack which made it possible for NFS client
side to use struct buf with non-bio backing.

This patch takes a more general approach and adds a bp->b_op
vector where more methods can be added.

The success of this patch depends on bp->b_op being initialized
all relevant places for some value of "relevant" which is not
easy to determine.  For now the buffers have grown a b_magic
element which will make such issues a tiny bit easier to debug.
2001-04-17 08:56:39 +00:00
Kirk McKusick 5819ab3f12 Add debugging option to always read/write cylinder groups as full
sized blocks. To enable this option, use: `sysctl -w debug.bigcgs=1'.
Add debugging option to disable background writes of cylinder
groups. To enable this option, use: `sysctl -w debug.dobkgrdwrite=0'.
These debugging options should be tried on systems that are panicing
with corrupted cylinder group maps to see if it makes the problem
go away. The set of panics in question are:

	ffs_clusteralloc: map mismatch
	ffs_nodealloccg: map corrupted
	ffs_nodealloccg: block not in map
	ffs_alloccg: map corrupted
	ffs_alloccg: block not in map
	ffs_alloccgblk: cyl groups corrupted
	ffs_alloccgblk: can't find blk in cyl
	ffs_checkblk: partially free fragment

The following panics are less likely to be related to this problem,
but might be helped by these debugging options:

	ffs_valloc: dup alloc
	ffs_blkfree: freeing free block
	ffs_blkfree: freeing free frag
	ffs_vfree: freeing free inode

If you try these options, please report whether they helped reduce your
bitmap corruption panics to Kirk McKusick at <mckusick@mckusick.com>
and to Matt Dillon <dillon@earth.backplane.com>.
2001-04-17 05:37:51 +00:00
Kirk McKusick f0f3f19f05 Background fsck sysctl operations must use vn_start_write and
vn_finished_write so that they do not attempt to modify a
suspended filesystem.
2001-04-17 05:06:37 +00:00
Robert Watson b114e127e6 In my first reading of POSIX.1e, I misinterpreted handling of the
ACL_USER_OBJ and ACL_GROUP_OBJ fields, believing that modification of the
access ACL could be used by privileged processes to change file/directory
ownership.  In fact, this is incorrect; ACL_*_OBJ (+ ACL_MASK and
ACL_OTHER) should have undefined ae_id fields; this commit attempts
to correct that misunderstanding.

o Modify arguments to vaccess_acl_posix1e() to accept the uid and gid
  associated with the vnode, as those can no longer be extracted from
  the ACL passed as an argument.  Perform all comparisons against
  the passed arguments.  This actually has the effect of simplifying
  a number of components of this call, as well as reducing the indent
  level, but now seperates handling of ACL_GROUP_OBJ from ACL_GROUP.

o Modify acl_posix1e_check() to return EINVAL if the ae_id field of
  any of the ACL_{USER_OBJ,GROUP_OBJ,MASK,OTHER} entries is a value
  other than ACL_UNDEFINED_ID.  As a temporary work-around to allow
  clean upgrades, set the ae_id field to ACL_UNDEFINED_ID before
  each check so that this cannot cause a failure in the short term
  (this work-around will be removed when the userland libraries and
  utilities are updated to take this change into account).

o Modify ufs_sync_acl_from_inode() so that it forces
  ACL_{USER_OBJ,GROUP_OBJ,MASK,OTHER} ae_id fields to ACL_UNDEFINED_ID
  when synchronizing the ACL from the inode.

o Modify ufs_sync_inode_from_acl to not propagate uid and gid
  information to the inode from the ACL during ACL update.  Also
  modify the masking of permission bits that may be set from
  ALLPERMS to (S_IRWXU|S_IRWXG|S_IRWXO), as ACLs currently do not
  carry none-ACCESSPERMS (S_ISUID, S_ISGID, S_ISTXT).

o Modify ufs_getacl() so that when it emulates an access ACL from
  the inode, it initializes the ae_id fields to ACL_UNDEFINED_ID.

o Clean up ufs_setacl() substantially since it is no longer possible
  to perform chown/chgrp operations using vop_setacl(), so all the
  access control for that can be eliminated.

o Modify ufs_access() so that it passes owner uid and gid information
  into vaccess_acl_posix1e().

Pointed out by:	jedger
Obtained from:	TrustedBSD Project
2001-04-17 04:33:34 +00:00
John Baldwin abd9053ee4 Blow away the panic mutex in favor of using a single atomic_cmpset() on a
panic_cpu shared variable.  I used a simple atomic operation here instead
of a spin lock as it seemed to be excessive overhead.  Also, this can avoid
recursive panics if, for example, witness is broken.
2001-04-17 04:18:08 +00:00
John Baldwin 3c41f323c9 Check to see if enroll() returns NULL in the witness initialization. This
can happen if witness runs out of resources during initialization or if
witness_skipspin is enabled.

Sleuthing by:	Peter Jeremy <peter.jeremy@alcatel.com.au>
2001-04-17 03:35:38 +00:00
John Baldwin 7141f2ad46 Exit and re-enter the critical section while spinning for a spinlock so
that interrupts can come in while we are waiting for a lock.
2001-04-17 03:34:52 +00:00
John Baldwin 8c321ed95f - Add appropriate #ifndef/#define/#endif to protect against multiple
inclusions.
- Blow away all evidence of a static curpcb as curpcb is a per-CPU variable
  and this definition is now bogus.
2001-04-17 02:51:28 +00:00
John Baldwin 2bec909c3d - Fix memory barriers in atomic operations so that the barriers are always
"inside" of locked regions.  That is, an acquire atomic operation will
  always enforce a memory barrier after the atomic operation and a release
  operation will always enforce a memory barrier before the atomic
  operation.
- Explicitly use 'mb' instead of 'wmb' in release atomic operations.  The
  'wmb' memory barrier is not strong enough to guarantee coherence with
  other processors.  This is effectively a nop since alpha_wmb() actually
  performs a 'mb' and not a 'wmb', but I wanted the code to be more
  correct since at some point in the future alpha_wmb()'s implementation
  may switch to being a real 'wmb'.
2001-04-17 02:50:05 +00:00
John Baldwin 85eba1489b Add a cpu_throw() function that secondary CPU's can use for their first
context switch.
2001-04-17 02:46:13 +00:00
John Baldwin 0f98ef505a In exception_return(), test for usermode before testing the IPL to see if
we should call ast().  This allows us to branch to a separate Lkernelret
label so we can fixup the saved t7 register in the trapframe.  Otherwise
we can run into a problem on SMP systems where a process is interrupted by
a trap or interrupt on one CPU, migrates to another CPU, and then returns
with the t7 in the stack clobbering the CPU's t7.  As a result, two CPU's
would both point to the same per-CPU data and things would go downhill from
there.

Sleuthing help by:	gallatin
2001-04-17 02:44:35 +00:00
John Baldwin 1a72a97045 - Stop other CPU's in the SMP case when we enter ddb.
- Add a new ddb command: 'show pcpu' similar to the i386 command added
  recently.  By default it displays the current CPU's info, but an optional
  argument can specify the logical ID of a specific CPU to examine.
2001-04-17 02:41:41 +00:00
Søren Schmidt b952dabaa1 Add support the the Intel ICH2 mobile
Tidy chip name printing a bit.
2001-04-16 21:22:34 +00:00
Mark Murray 573bc39917 Add missing sound module.
OK'ed by:	cg
2001-04-16 17:04:41 +00:00
Kenneth D. Merry 623db3603c Fix an off-by-2 error in periphdriver_register(). The read side of the
bcopy would go off the end of the array by two elements, which sometimes
causes a panic if it happens to cross into a page that isn't mapped.

Submitted by:	gibbs
Reviewed by:	peter
2001-04-16 15:53:54 +00:00
John Hay 0d1b4aef96 Move the isa parts to a separate file. 2001-04-16 13:20:39 +00:00
John Hay 24dbea46a9 Update to the 2001-04-02 version of the nanokernel code from Dave Mills. 2001-04-16 13:05:05 +00:00
KATO Takenori 1a476993b0 Merged from sys/i386/isa/npx.c revision 1.95. 2001-04-16 09:15:40 +00:00
KATO Takenori 0af2322303 Merged from sys/conf/options.i386 revision 1.148. 2001-04-16 09:13:51 +00:00
David E. O'Brien c5e70d92ce Turn on kernel debugging support (DDB, INVARIANTS, INVARIANT_SUPPORT, WITNESS)
by default while SMPng is still being developed.

Submitted by:	jhb
2001-04-15 19:37:28 +00:00
Alfred Perlstein cc64b484dd use TAILQ_FOREACH, fix a comment's location 2001-04-15 10:22:04 +00:00
Brian Somers 56700d4634 Call strlen() once instead of twice. 2001-04-14 21:33:58 +00:00
Mark Murray b4edbce08c Back out wrapping the asm ... ; bits in #ifndef lint macros. There
are some good reasons for not doing this, even if the linting of
the code breaks.

1) If lint were ever to understand the stuff inside the macros,
   that would break the checks.

2) There are ways to use __GNUC__ to exclude overly specific
   code.

3) (Not yet practical) Lint(1) needs to properlyu understand
   all of te code we actually run.

Complained about by:	bde
Education by:		jake, jhb, eivind
2001-04-14 20:42:04 +00:00
Søren Schmidt cffeef75e7 The VIA 586 chip does UDMA from rev 0x3 onwards.
MFC candidate!
2001-04-14 18:33:08 +00:00
Kirk McKusick 74046077a7 Update to describe use of mdconfig instead of deprecated vnconfig.
Submitted by:	Steve Ames <steve@virtual-voodoo.com>
2001-04-14 18:32:09 +00:00
Brian Somers fa9a4c8a8d dgm now builds as a module 2001-04-14 15:36:45 +00:00
Brian Somers b432115ffd New-busify and ansify.
I've cleaned up a bit of the formatting here, but it's still a long way
from style(9).
2001-04-14 15:32:16 +00:00
Kirk McKusick 1a6a661032 This checkin adds support in ufs/ffs for the FS_NEEDSFSCK flag.
It is described in ufs/ffs/fs.h as follows:

/*
 * Filesystem flags.
 *
 * Note that the FS_NEEDSFSCK flag is set and cleared only by the
 * fsck utility. It is set when background fsck finds an unexpected
 * inconsistency which requires a traditional foreground fsck to be
 * run. Such inconsistencies should only be found after an uncorrectable
 * disk error. A foreground fsck will clear the FS_NEEDSFSCK flag when
 * it has successfully cleaned up the filesystem. The kernel uses this
 * flag to enforce that inconsistent filesystems be mounted read-only.
 */
#define FS_UNCLEAN    0x01	/* filesystem not clean at mount */
#define FS_DOSOFTDEP  0x02	/* filesystem using soft dependencies */
#define FS_NEEDSFSCK  0x04	/* filesystem needs sync fsck before mount */
2001-04-14 05:26:28 +00:00
Chris D. Faulhaber 9a227c5754 Add acl_get_perm_np(3), a non-portable function to check if a
permission is in a permission set, required for third-party
applications such as Samba.

Reviewed by:	rwatson
Obtained from:	TrustedBSD Project
2001-04-13 19:37:04 +00:00
Chris D. Faulhaber 94ef417e4b Add the remaining POSIX.1e ACL definitions:
ACL_UNDEFINED_TAG, ACL_UNDEFINED_ID, ACL_FIRST_ENTRY, ACL_NEXT_ENTRY

Reviewed by:	rwatson
Obtained from:	TrustedBSD Project
2001-04-13 19:14:38 +00:00
John Baldwin adccbaa77d People are still having problems with i586_* on UP machines and SMP
machines, so just hack it to disable them for now until it can be fixed.

Inspired by hair pulling of:	asmodai
2001-04-13 17:14:53 +00:00
Robert Watson e9e7ff5b22 o Since uid checks in p_cansignal() are now identical between P_SUGID
and non-P_SUGID cases, simplify p_cansignal() logic so that the
  P_SUGID masking of possible signals is independent from uid checks,
  removing redundant code and generally improving readability.

Reviewed by:	tmm
Obtained from:	TrustedBSD Project
2001-04-13 14:33:45 +00:00
Boris Popov e59572b595 Add smbfs module. Currently it includes smbfs, netsmb and DES parts.
Kernel should be compiled with options LIBMCHAIN and LIBICONV.
2001-04-13 12:11:19 +00:00
Boris Popov 0fdabd3a45 Move VT_SMBFS definition to the proper place. Undefine VI_LOCK/VI_UNLOCK. 2001-04-13 11:26:54 +00:00
Alfred Perlstein 971dd34298 if/panic -> KASSERT 2001-04-13 11:15:40 +00:00
Boris Popov de847dd07c All NETSMB* options should use opt_netsmb.h file (the joy of multiple repos). 2001-04-13 10:53:56 +00:00
Boris Popov 34ae6c7541 This file also depends on sys/types.h and sys/ioccom.h.
Remove some old junk.

Submitted by:	bde
2001-04-13 10:50:48 +00:00
Alfred Perlstein 2a758ebe58 protect pbufs and associated counts with a mutex 2001-04-13 10:23:32 +00:00
Alfred Perlstein 493607117e use %p for pointer printf, include sys/systm.h for printf proto 2001-04-13 10:22:14 +00:00
Alfred Perlstein 1375ed7eb7 convert if/panic -> KASSERT, explain what triggered the assertion 2001-04-13 10:15:53 +00:00
Mark Murray c13d191de3 Make this more lint-friendly. This file seems to be invoked in just
about any .c file that includes a .h, and lint produces copious
whining because of the asm ...; stuff.
2001-04-13 09:46:54 +00:00
Murray Stokely a4e6da691f Generate useful error messages. 2001-04-13 09:37:25 +00:00
Mark Murray f0b60d7560 Handle a rare but fatal race invoked sometimes when SIGSTOP is
invoked.
2001-04-13 09:29:34 +00:00
John Baldwin 7a9aa5d372 - Add a comment at the start of the spin locks list.
- The alpha SMP code uses an "ap boot" spinlock as well.
2001-04-13 08:31:38 +00:00
Alfred Perlstein 7d26b6a450 Use a macro wrapper over printf along with KASSERT to reduce the amount
of code here.
2001-04-13 08:07:37 +00:00
Alfred Perlstein 7bbd138e2f Make SOMAXCONN a kernel option.
Submitted by: Terry Lambert <terry@lambert.org>
2001-04-13 03:50:37 +00:00
Robert Watson 44c3e09cdc o Disallow two "allow this" exceptions in p_cansignal() restricting
the ability of unprivileged processes to deliver arbitrary signals
  to daemons temporarily taking on unprivileged effective credentials
  when P_SUGID is not set on the target process:
  Removed:
     (p1->p_cred->cr_ruid != ps->p_cred->cr_uid)
     (p1->p_ucred->cr_uid != ps->p_cred->cr_uid)
o Replace two "allow this" exceptions in p_cansignal() restricting
  the ability of unprivileged processes to deliver arbitrary signals
  to daemons temporarily taking on unprivileged effective credentials
  when P_SUGID is set on the target process:
  Replaced:
     (p1->p_cred->p_ruid != p2->p_ucred->cr_uid)
     (p1->p_cred->cr_uid != p2->p_ucred->cr_uid)
  With:
     (p1->p_cred->p_ruid != p2->p_ucred->p_svuid)
     (p1->p_ucred->cr_uid != p2->p_ucred->p_svuid)
o These changes have the effect of making the uid-based handling of
  both P_SUGID and non-P_SUGID signal delivery consistent, following
  these four general cases:
     p1's ruid equals p2's ruid
     p1's euid equals p2's ruid
     p1's ruid equals p2's svuid
     p1's euid equals p2's svuid
  The P_SUGID and non-P_SUGID cases can now be largely collapsed,
  and I'll commit this in a few days if no immediate problems are
  encountered with this set of changes.
o These changes remove a number of warning cases identified by the
  proc_to_proc inter-process authorization regression test.
o As these are new restrictions, we'll have to watch out carefully for
  possible side effects on running code: they seem reasonable to me,
  but it's possible this change might have to be backed out if problems
  are experienced.

Submitted by:		src/tools/regression/security/proc_to_proc/testuid
Reviewed by:		tmm
Obtained from:	TrustedBSD Project
2001-04-13 03:06:22 +00:00
Robert Watson 0489082737 o Disable two "allow this" exceptions in p_cansched()m retricting the
ability of unprivileged processes to modify the scheduling properties
  of daemons temporarily taking on unprivileged effective credentials.
  These cases (p1->p_cred->p_ruid == p2->p_ucred->cr_uid) and
  (p1->p_ucred->cr_uid == p2->p_ucred->cr_uid), respectively permitting
  a subject process to influence the scheduling of a daemon if the subject
  process has the same real uid or effective uid as the daemon's effective
  uid.  This removes a number of the warning cases identified by the
  proc_to_proc iner-process authorization regression test.
o As these are new restrictions, we'll have to watch out carefully for
  possible side effects on running code: they seem reasonable to me,
  but it's possible this change might have to be backed out if problems
  are experienced.

Reported by:	src/tools/regression/security/proc_to_proc/testuid
Obtained from:	TrustedBSD Project
2001-04-12 22:46:07 +00:00
Alfred Perlstein b28cb1ca07 remove truncated part from commment 2001-04-12 21:50:03 +00:00
Robert Watson e386f9bda3 o Make kqueue's filt_procattach() function use the error value returned
by p_can(...P_CAN_SEE), rather than returning EACCES directly.  This
  brings the error code used here into line with similar arrangements
  elsewhere, and prevents the leakage of pid usage information.

Reviewed by:	jlemon
Obtained from:	TrustedBSD Project
2001-04-12 21:32:02 +00:00
Robert Watson d34f8d3030 o Limit process information leakage by introducing a p_can(...P_CAN_SEE...)
in rtprio()'s RTP_LOOKIP implementation.

Obtained from:	TrustedBSD Project
2001-04-12 20:46:26 +00:00
Robert Watson eb9e5c1d72 o Reduce information leakage into jails by adding invocations of
p_can(...P_CAN_SEE...) to getpgid(), getsid(), and setpgid(),
  blocking these operations on processes that should not be visible
  by the requesting process.  Required to reduce information leakage
  in MAC environments.

Obtained from:	TrustedBSD Project
2001-04-12 19:39:00 +00:00
KATO Takenori 4dfe1d3b64 Merged from options.i386 revision 1.147. 2001-04-12 12:28:42 +00:00
KATO Takenori a3758914a0 Merged from files.i386 revisions 1.359 and 1.360. 2001-04-12 12:26:40 +00:00
Nick Hibma 1470e6aaeb Regen. 2001-04-12 11:08:59 +00:00
Nick Hibma 47a9ad6b89 TDK ids
Submitted by:	Hidetoshi Shimokawa <simokawa@sat.t.u-tokyo.ac.jp>
2001-04-12 11:04:08 +00:00
Nick Hibma 426128e90b From NetBSD 2001-04-12 10:59:30 +00:00
Robert Watson 4c5eb9c397 o Replace p_cankill() with p_cansignal(), remove wrappage of p_can()
from signal authorization checking.
o p_cansignal() takes three arguments: subject process, object process,
  and signal number, unlike p_cankill(), which only took into account
  the processes and not the signal number, improving the abstraction
  such that CANSIGNAL() from kern_sig.c can now also be eliminated;
  previously CANSIGNAL() special-cased the handling of SIGCONT based
  on process session.  privused is now deprecated.
o The new p_cansignal() further limits the set of signals that may
  be delivered to processes with P_SUGID set, and restructures the
  access control check to allow it to be extended more easily.
o These changes take into account work done by the OpenBSD Project,
  as well as by Robert Watson and Thomas Moestl on the TrustedBSD
  Project.

Obtained from:  TrustedBSD Project
2001-04-12 02:38:08 +00:00
Warner Losh a9304a4eb5 Fix minor typo in comment. 112x -> 12xx 2001-04-11 22:49:00 +00:00
Archie Cobbs 422c727634 Don't reference a node after we dropped a reference to it
(same as in previous checkin, but in a different function).
2001-04-11 22:04:47 +00:00
Boris Popov cdcb16abd2 Pull constants from netsmb/smb.h. 2001-04-11 21:35:51 +00:00
Warner Losh a17e1baffd Add IBM3765 to newcard's pcic pnp device list 2001-04-11 20:22:16 +00:00
Robert Watson 40829dd2dc o Regenerated following introduction of __setugid() system call for
"options REGRESSION".

Obtained from:	TrustedBSD Project
2001-04-11 20:21:37 +00:00
Robert Watson 130d0157d1 o Introduce a new system call, __setsugid(), which allows a process to
toggle the P_SUGID bit explicitly, rather than relying on it being
  set implicitly by other protection and credential logic.  This feature
  is introduced to support inter-process authorization regression testing
  by simplifying userland credential management allowing the easy
  isolation and reproduction of authorization events with specific
  security contexts.  This feature is enabled only by "options REGRESSION"
  and is not intended to be used by applications.  While the feature is
  not known to introduce security vulnerabilities, it does allow
  processes to enter previously inaccessible parts of the credential
  state machine, and is therefore disabled by default.  It may not
  constitute a risk, and therefore in the future pending further analysis
  (and appropriate need) may become a published interface.

Obtained from:	TrustedBSD Project
2001-04-11 20:20:40 +00:00
Warner Losh e5eac10b13 Add #define for IBM3765.
Fix SWAMPBOX.  It had actiontec's ID.
Reorder pnpids so they are in alphabetical order.
2001-04-11 20:18:29 +00:00
Robert Watson 0b5438c6d1 o Introduce "options REGRESSION", a kernel option which enables
interfaces and functionality intended for use during correctness and
  regression testing.  Features enabled by "options REGRESSION" may
  in and of themselves introduce security or correctness problems if
  used improperly, and so are not intended for use in production
  systems, only in testing environments.

Obtained from:	TrustedBSD Project
2001-04-11 19:29:24 +00:00
John Baldwin 7b531e6037 Stick proc0 in the PID hash table. 2001-04-11 18:50:50 +00:00