]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
20 years agoDo not call VOP_GETATTR in getdents function. It does not serve any
Alexander Kabaev [Wed, 19 Nov 2003 04:12:32 +0000 (04:12 +0000)]
Do not call VOP_GETATTR in getdents function. It does not serve any
purpose and the resulting vattr structure was ignored. In addition,
the VOP_GETATTR call was made with no vnode lock held, resulting in
vnode locking violation panic with debug kernels.

Reported by: truckman

Approved by: re@ (rwatson)

20 years agoLower the maximum ACK timeout for GRE packets from 10 to 1 second.
Archie Cobbs [Tue, 18 Nov 2003 20:43:23 +0000 (20:43 +0000)]
Lower the maximum ACK timeout for GRE packets from 10 to 1 second.
In practice it seems that in situations of high packet loss the ACK
timeout seems to hit this maximum (perhaps inappropriately, but the
estimation algorithm is not perfect, so apparently it happens). In
any case, 10 seconds is way too high a value so lower to 1 second.

MFC after: 3 days

20 years agoUse the class->init() to hitch up preload devices, rather than rely on
Poul-Henning Kamp [Tue, 18 Nov 2003 18:19:26 +0000 (18:19 +0000)]
Use the class->init() to hitch up preload devices, rather than rely on
the "old" SYSINIT.  This makes sure things happen in the right order.

XXX: md(4) needs to be fully geom-ified and in particluar /dev/md.ctl
should be abandonded for the GEOM OaM api.

Approved by: re@

20 years agoCall class->init() an class->fini() while the class is hooked up,
Poul-Henning Kamp [Tue, 18 Nov 2003 18:17:39 +0000 (18:17 +0000)]
Call class->init() an class->fini() while the class is hooked up,
rather than right before and right after.  This allows these routines
to manipulate the mesh.

KASSERT that nobody creates a geom on an alien class.

Assert topology in g_valid_obj().

Approved by: re@

20 years agoAdd support for the SiS964 ATA/SATA southbridge.
Søren Schmidt [Tue, 18 Nov 2003 15:27:28 +0000 (15:27 +0000)]
Add support for the SiS964 ATA/SATA southbridge.
This could not have been done without the support from kuriyama.

Approved by: re@

20 years agoWork around the problem that some CDROM drives might return different
Søren Schmidt [Tue, 18 Nov 2003 15:23:37 +0000 (15:23 +0000)]
Work around the problem that some CDROM drives might return different
TOC's for the same media!! that borks up GEOM.
Although this looks like bad HW the following patch removes the
chance for GEOM panic'ing.

Approved by: re@

20 years agoHackfix to patch around a kernel panic I introduced. Real fix to
Mark Murray [Tue, 18 Nov 2003 14:35:43 +0000 (14:35 +0000)]
Hackfix to patch around a kernel panic I introduced. Real fix to
follow. In the meanwhile, we are not harvesting interrupt entropy.

Approved by: re (jhb)

20 years agoInstall the user trap handlers that libc provides from a constructor, so
Jake Burkholder [Tue, 18 Nov 2003 14:21:41 +0000 (14:21 +0000)]
Install the user trap handlers that libc provides from a constructor, so
that they will be installed before application constructors are invoked.
Its possible to link applications such that this fails, application code
is invoked before they are installed, but, well, Don't Do That.

Approved by: re (jhb)

20 years agoReplace the dangerous strcpy() call with strlcpy(), instead of the safe one
Tim J. Robbins [Tue, 18 Nov 2003 14:21:34 +0000 (14:21 +0000)]
Replace the dangerous strcpy() call with strlcpy(), instead of the safe one
that was incorrectly changed in rev. 1.61.

Approved by: re

20 years agoFix a harmless bug and add a ')' in a debugging printf.
Poul-Henning Kamp [Tue, 18 Nov 2003 07:54:12 +0000 (07:54 +0000)]
Fix a harmless bug and add a ')' in a debugging printf.

Submitted by: "Bjoern A. Zeeb" <bzeeb-lists@lists.zabbadoz.net>

20 years agoUse UMA zone allocator for Biba and MLS labels rather than MALLOC(9).
Robert Watson [Tue, 18 Nov 2003 04:11:52 +0000 (04:11 +0000)]
Use UMA zone allocator for Biba and MLS labels rather than MALLOC(9).

Obtained from: TrustedBSD Project
Sponsored by: DARPA, Network Associates Laboratories

20 years agoCatch up with the latest in device naming.
David E. O'Brien [Tue, 18 Nov 2003 02:33:27 +0000 (02:33 +0000)]
Catch up with the latest in device naming.

20 years agoRevert a NOOP change to Makefile that slipped into the last commit.
Robert Watson [Tue, 18 Nov 2003 00:52:30 +0000 (00:52 +0000)]
Revert a NOOP change to Makefile that slipped into the last commit.

Pointed out by: tjr

20 years agoIntroduce a MAC label reference in 'struct inpcb', which caches
Robert Watson [Tue, 18 Nov 2003 00:39:07 +0000 (00:39 +0000)]
Introduce a MAC label reference in 'struct inpcb', which caches
the   MAC label referenced from 'struct socket' in the IPv4 and
IPv6-based protocols.  This permits MAC labels to be checked during
network delivery operations without dereferencing inp->inp_socket
to get to so->so_label, which will eventually avoid our having to
grab the socket lock during delivery at the network layer.

This change introduces 'struct inpcb' as a labeled object to the
MAC Framework, along with the normal circus of entry points:
initialization, creation from socket, destruction, as well as a
delivery access control check.

For most policies, the inpcb label will simply be a cache of the
socket label, so a new protocol switch method is introduced,
pr_sosetlabel() to notify protocols that the socket layer label
has been updated so that the cache can be updated while holding
appropriate locks.  Most protocols implement this using
pru_sosetlabel_null(), but IPv4/IPv6 protocols using inpcbs use
the the worker function in_pcbsosetlabel(), which calls into the
MAC Framework to perform a cache update.

Biba, LOMAC, and MLS implement these entry points, as do the stub
policy, and test policy.

Reviewed by: sam, bms
Obtained from: TrustedBSD Project
Sponsored by: DARPA, Network Associates Laboratories

20 years agoDocument that the live dump command (`dump -L') creates its snapshot
Kirk McKusick [Tue, 18 Nov 2003 00:36:40 +0000 (00:36 +0000)]
Document that the live dump command (`dump -L') creates its snapshot
in the .snap directory in the root of the filesystem being dumped.
Document that if the .snap directory is missing that it must be
created manually and that it should be owned by user root and
group operator and set to mode 770 before a live dump can be run.

20 years agoClarify UPDATING language: do buildworld before buildkernel, and
Robert Watson [Mon, 17 Nov 2003 23:25:16 +0000 (23:25 +0000)]
Clarify UPDATING language: do buildworld before buildkernel, and
do installkernel before installworld, rather than don't make world
before installkernel.

Pointed out by: gad

20 years agoMerged from sys/dev/sio/sio.c revisions 1.415 and 1.416.
Bruce Evans [Mon, 17 Nov 2003 23:13:08 +0000 (23:13 +0000)]
Merged from sys/dev/sio/sio.c revisions 1.415 and 1.416.

Approved by: nyan
(Blanket approval for simple changes in sio.)

20 years agoOverhaul the entropy device:
Mark Murray [Mon, 17 Nov 2003 23:02:21 +0000 (23:02 +0000)]
Overhaul the entropy device:

o Each source gets its own queue, which is a FIFO, not a ring buffer.
  The FIFOs are implemented with the sys/queue.h macros. The separation
  is so that a low entropy/high rate source can't swamp the harvester
  with low-grade entropy and destroy the reseeds.

o Each FIFO is limited to 256 (set as a macro, so adjustable) events
  queueable. Full FIFOs are ignored by the harvester. This is to
  prevent memory wastage, and helps to keep the kernel thread CPU
  usage within reasonable limits.

o There is no need to break up the event harvesting into ${burst}
  sized chunks, so retire that feature.

o Break the device away from its roots with the memory device, and
  allow it to get its major number automagically.

20 years agoAdd a sysctl, security.bsd.see_other_gids, similar in semantics
Robert Watson [Mon, 17 Nov 2003 20:20:53 +0000 (20:20 +0000)]
Add a sysctl, security.bsd.see_other_gids, similar in semantics
to see_other_uids but with the logical conversion.  This is based
on (but not identical to) the patch submitted by Samy Al Bahra.

Submitted by: Samy Al Bahra <samy@kerneled.com>

20 years agoStaticize label_default_head to prevent it from leaking out of mac.c.
Robert Watson [Mon, 17 Nov 2003 19:48:35 +0000 (19:48 +0000)]
Staticize label_default_head to prevent it from leaking out of mac.c.

Obtained from: TrustedBSD Project
Sponsored by: DARPA, Network Associates Laboratories

20 years agoIn rip_abort(), unlock the inpcb if we didn't detach it, or we may
Olivier Houchard [Mon, 17 Nov 2003 19:21:53 +0000 (19:21 +0000)]
In rip_abort(), unlock the inpcb if we didn't detach it, or we may
recurse on the lock before destroying the mutex.

Submitted by: sam

20 years agomove rate control change messages under ath_debug
Sam Leffler [Mon, 17 Nov 2003 19:15:09 +0000 (19:15 +0000)]
move rate control change messages under ath_debug

20 years agoFixed two memory leaks.
Ruslan Ermilov [Mon, 17 Nov 2003 19:13:44 +0000 (19:13 +0000)]
Fixed two memory leaks.

Reviewed by: harti

20 years agoCheck the correct set of interface flags and fix a memory leak.
Ruslan Ermilov [Mon, 17 Nov 2003 19:13:01 +0000 (19:13 +0000)]
Check the correct set of interface flags and fix a memory leak.

Reviewed by: harti

20 years agoo fix WEP use in hostap mode; need to reset the pointer to the
Sam Leffler [Mon, 17 Nov 2003 19:12:52 +0000 (19:12 +0000)]
o fix WEP use in hostap mode; need to reset the pointer to the
  802.11 packet header after stripping the WEP header on input

20 years agoon a beacon miss try to reassociate before starting a scan
Sam Leffler [Mon, 17 Nov 2003 19:02:18 +0000 (19:02 +0000)]
on a beacon miss try to reassociate before starting a scan

Submitted by: Henry Qian

20 years agoAdd a MAC check for VOP_LOOKUP() in the Linux getwcd() implementation.
Robert Watson [Mon, 17 Nov 2003 18:57:20 +0000 (18:57 +0000)]
Add a MAC check for VOP_LOOKUP() in the Linux getwcd() implementation.

Obtained from: TrustedBSD Project
Sponsored by: DARPA, Network Associates Laboratories

20 years ago - Change the i386's sf_buf implementation so that it never allocates
Alan Cox [Mon, 17 Nov 2003 18:22:24 +0000 (18:22 +0000)]
 - Change the i386's sf_buf implementation so that it never allocates
   more than one sf_buf for one vm_page.  To accomplish this, we add
   a global hash table mapping vm_pages to sf_bufs and a reference
   count to each sf_buf.  (This is similar to the patches for RELENG_4
   at http://www.cs.princeton.edu/~yruan/debox/.)

   For the uninitiated, an sf_buf is nothing more than a kernel virtual
   address that is used for temporary virtual-to-physical mappings by
   sendfile(2) and zero-copy sockets.  As such, there is no reason for
   one vm_page to have several sf_bufs mapping it.  In fact, using more
   than one sf_buf for a single vm_page increases the likelihood that
   sendfile(2) blocks, hurting throughput.
   (See http://www.cs.princeton.edu/~yruan/debox/.)

20 years agoUpdate hier(7) to reflect the world with respect to /lib and /libexec.
Gordon Tetlow [Mon, 17 Nov 2003 17:29:04 +0000 (17:29 +0000)]
Update hier(7) to reflect the world with respect to /lib and /libexec.

20 years agoAdd an entry to the BUGS section indicating that Vinum cannot currently
Robert Watson [Mon, 17 Nov 2003 16:04:52 +0000 (16:04 +0000)]
Add an entry to the BUGS section indicating that Vinum cannot currently
be used on devices with a block size other than DEV_BSIZE (512),
which specifically includes being unable to run on a swap-backed
md device.  Swap-backed md devices use a 4k block size.

20 years agoDon't attempt to make devices if we're using devfs. This
Robert Watson [Mon, 17 Nov 2003 15:56:00 +0000 (15:56 +0000)]
Don't attempt to make devices if we're using devfs.  This
substantially cleans up the output when running the vinum
management tool, and also makes it work better.

Long sustained silence from: grog

20 years agoNo need for two copies of this file; there is already a distribution
Mark Murray [Mon, 17 Nov 2003 14:59:06 +0000 (14:59 +0000)]
No need for two copies of this file; there is already a distribution
copy in src/crypto/heimdal/...

Reported by: ru

20 years ago* Auto-detect what device to use if none is specified
Eivind Eklund [Mon, 17 Nov 2003 14:02:04 +0000 (14:02 +0000)]
* Auto-detect what device to use if none is specified
* Replace references to mcd0 with acd0 (doc only)
* Remove references to the "c" partition (doc only - code was already fixed)

20 years ago__FBSDID; remove duplicate <ctype.h>; try to reduce style inconsistencies.
Dag-Erling Smørgrav [Mon, 17 Nov 2003 11:26:51 +0000 (11:26 +0000)]
__FBSDID; remove duplicate <ctype.h>; try to reduce style inconsistencies.

20 years agoSort includes, and remove superfluous <sys/types.h>
Dag-Erling Smørgrav [Mon, 17 Nov 2003 11:14:34 +0000 (11:14 +0000)]
Sort includes, and remove superfluous <sys/types.h>

20 years agoInstead of blindly loading the ums module and bailing out if that fails,
Dag-Erling Smørgrav [Mon, 17 Nov 2003 11:08:28 +0000 (11:08 +0000)]
Instead of blindly loading the ums module and bailing out if that fails,
check if it's already loaded or compiled into the kernel, and only try to
load it if it isn't.

PR: bin/59368
Submitted by: Jens Rehsack <rehsack@liwing.de>

20 years agoAdd SMP changes as should have been committed as rev 1.28
Peter Wemm [Mon, 17 Nov 2003 09:19:12 +0000 (09:19 +0000)]
Add SMP changes as should have been committed as rev 1.28

20 years agoRestore file accidently killed in the crossfire from the smp commit.
Peter Wemm [Mon, 17 Nov 2003 09:11:04 +0000 (09:11 +0000)]
Restore file accidently killed in the crossfire from the smp commit.

20 years agoInitial landing of SMP support for FreeBSD/amd64.
Peter Wemm [Mon, 17 Nov 2003 08:58:16 +0000 (08:58 +0000)]
Initial landing of SMP support for FreeBSD/amd64.

- This is heavily derived from John Baldwin's apic/pci cleanup on i386.
- I have completely rewritten or drastically cleaned up some other parts.
  (in particular, bootstrap)
- This is still a WIP.  It seems that there are some highly bogus bioses
  on nVidia nForce3-150 boards.  I can't stress how broken these boards
  are.  I have a workaround in mind, but right now the Asus SK8N is broken.
  The Gigabyte K8NPro (nVidia based) is also mind-numbingly hosed.
- Most of my testing has been with SCHED_ULE.  SCHED_4BSD works.
- the apic and acpi components are 'standard'.
- If you have an nVidia nForce3-150 board, you are stuck with 'device
  atpic' in addition, because they somehow managed to forget to connect the
  8254 timer to the apic, even though its in the same silicon!  ARGH!
  This directly violates the ACPI spec.

20 years ago - Mark ksq_assigned as volatile so that when this code is used without
Jeff Roberson [Mon, 17 Nov 2003 08:27:11 +0000 (08:27 +0000)]
 - Mark ksq_assigned as volatile so that when this code is used without
   sched_lock we can be sure that we'll pick up the new value.

20 years ago - Remove long dead code. rslices hasn't been used in some time and neither
Jeff Roberson [Mon, 17 Nov 2003 08:24:14 +0000 (08:24 +0000)]
 - Remove long dead code.  rslices hasn't been used in some time and neither
   has sched_pickcpu().

20 years agocorrect to look right interface.
Hajimu UMEMOTO [Mon, 17 Nov 2003 07:53:32 +0000 (07:53 +0000)]
correct to look right interface.

20 years agoOh, how embarresing. I broke my own platform. :-)
Peter Wemm [Mon, 17 Nov 2003 07:50:59 +0000 (07:50 +0000)]
Oh, how embarresing.  I broke my own platform. :-)

20 years agoTweaked the siointr1() so that it works better at 921600 bps, especially
Bruce Evans [Mon, 17 Nov 2003 07:21:19 +0000 (07:21 +0000)]
Tweaked the siointr1() so that it works better at 921600 bps, especially
with multiple ports on a shared interrupt demultiplexed by the puc_intr()
handler.

siointr1() first read as much input as possible and then checked all
possibly-relevant status registers, partly for robustness and partly
for historical reasons.  This is very bad if it is called for every
port sharing an interrupt like puc_intr() does.  It can spend too long
reading all the input for some ports when the interrupt is for a more
urgent event on another, or just too long checking all the status
registers when there are lots of ports.  The inter-character time is
too long for reading all the input even when the interrupt is for a
transmitter interrupt on the same port, and at 921600 bps the inter-char
time is 10.85 usec and was often exceeded with just 2 ports, leaving
the transmitters idle for about 6% of the time.

The tweak is to break out of the read loop after reading 1 char if
output can be done.  This avoids most of the idle transmitter time for
2 active ports at 921600 bps bidirectional on the test system.  It
also reduces overhead by about 20%.  More complete fixes use the
programmable tx low watermark on 16950's and reduce overhead by another
65%.

20 years agoRemove the BUGS section introduced in rev 1.11 now that the problem
David Schultz [Mon, 17 Nov 2003 06:39:54 +0000 (06:39 +0000)]
Remove the BUGS section introduced in rev 1.11 now that the problem
has been addressed.

20 years agoReimplement nologin(8) as a C program. This allows us to statically
David Schultz [Mon, 17 Nov 2003 06:39:38 +0000 (06:39 +0000)]
Reimplement nologin(8) as a C program.  This allows us to statically
link it at low cost and avoid environment poisoning attacks associated
with LD_LIBRARY_PATH.

Suggested by: rwatson

20 years agoWiden the enable/disable helper function's argument in line with the
Peter Wemm [Mon, 17 Nov 2003 06:10:15 +0000 (06:10 +0000)]
Widen the enable/disable helper function's argument in line with the
ithread_create() changes etc.  This should be mostly a NOP.

20 years agoExpand the argument to the ithread enable/disable helper hooks from an
Peter Wemm [Mon, 17 Nov 2003 06:08:10 +0000 (06:08 +0000)]
Expand the argument to the ithread enable/disable helper hooks from an
int to something big enough to hold a pointer.  amd64 needs this.

20 years agoDeclare crc32 static. There's a copy in libz that conflicts for the
Marcel Moolenaar [Mon, 17 Nov 2003 05:47:42 +0000 (05:47 +0000)]
Declare crc32 static. There's a copy in libz that conflicts for the
crunched binary.

Found by: make release

20 years agoStart turning on a few devices in the amd64 hardware notes, based on
Bruce A. Mah [Mon, 17 Nov 2003 05:45:21 +0000 (05:45 +0000)]
Start turning on a few devices in the amd64 hardware notes, based on
things that I've observed to work.

Obtained from: sledge, various dmesg(1) output messages from peter

20 years agoIgnore errors on ln. This is a quick fix for the make depend twice in
Warner Losh [Mon, 17 Nov 2003 05:21:18 +0000 (05:21 +0000)]
Ignore errors on ln.  This is a quick fix for the make depend twice in
a row being broken.  A better filx will come as soon as I have time to
analyse things more deeply.

20 years ago/rescue/b{,un}zip exists, so build this dynamically now.
David E. O'Brien [Mon, 17 Nov 2003 05:19:37 +0000 (05:19 +0000)]
/rescue/b{,un}zip exists, so build this dynamically now.

20 years ago/rescue/g{{,un}zip,zcat} exist, so build this dynamically now.
David E. O'Brien [Mon, 17 Nov 2003 05:18:36 +0000 (05:18 +0000)]
/rescue/g{{,un}zip,zcat} exist, so build this dynamically now.

20 years ago/rescue/tar exists, so build this dynamic now.
David E. O'Brien [Mon, 17 Nov 2003 05:16:26 +0000 (05:16 +0000)]
/rescue/tar exists, so build this dynamic now.

20 years agoFixed pedantic warnings for statement-expressions using __extension__
Bruce Evans [Mon, 17 Nov 2003 04:40:58 +0000 (04:40 +0000)]
Fixed pedantic warnings for statement-expressions using __extension__
and by not using a statement-expression for the non-expression
__PCPU_SET().

20 years agoCopy ukbdmap.h rules from .i386.
Warner Losh [Mon, 17 Nov 2003 04:38:14 +0000 (04:38 +0000)]
Copy ukbdmap.h rules from .i386.

# maybe this should be in files.

# This may fix sparc64 tinderbox.  I'll kinow in a few hours.

20 years agoBaby steps. Set WARNS=1 for libc.
Jacques Vidrine [Mon, 17 Nov 2003 04:20:02 +0000 (04:20 +0000)]
Baby steps.  Set WARNS=1 for libc.

20 years agoDetect range errors when using the %s specifier. Previously, LONG_MAX
Jacques Vidrine [Mon, 17 Nov 2003 04:19:15 +0000 (04:19 +0000)]
Detect range errors when using the %s specifier.  Previously, LONG_MAX
was rejected as a range error, while any values less than LONG_MIN
were silently substituted with LONG_MIN.  Furthermore, on some
platforms `time_t' has less range than `long' (e.g. alpha), which may
give incorrect results when parsing some strings.

20 years agoFixed a pedantic syntax error (a stray semicolon at the end of
Bruce Evans [Mon, 17 Nov 2003 03:40:41 +0000 (03:40 +0000)]
Fixed a pedantic syntax error (a stray semicolon at the end of
PCPU_MD_FIELDS).

20 years agoFix a few cases where MT_TAG-type "fake mbufs" are created on the stack, but
Brian Feldman [Mon, 17 Nov 2003 03:17:49 +0000 (03:17 +0000)]
Fix a few cases where MT_TAG-type "fake mbufs" are created on the stack, but
do not have mh_nextpkt initialized.  Somtimes what's there is "1", and the
ip_input() code pukes trying to m_free() it, rendering divert sockets and
such broken.
This really underscores the need to get rid of MT_TAG.

Reviewed by: rwatson

20 years agoFixed pedantic syntax errors. Many macros didn't permit a semicolon after
Bruce Evans [Mon, 17 Nov 2003 02:55:25 +0000 (02:55 +0000)]
Fixed pedantic syntax errors.  Many macros didn't permit a semicolon after
their invocation in the !KLD_MODULE case, but a semicolon is provided after
all invocations and is required in the KLD_MODULE case.

20 years agoAvoid a warning for compiling with `gcc -Wbad-function cast'. (This
Bruce Evans [Mon, 17 Nov 2003 02:11:13 +0000 (02:11 +0000)]
Avoid a warning for compiling with `gcc -Wbad-function cast'.  (This
is the warning that points to the bug in `(char *)malloc(...)' where
malloc() is implicitly declared as returning int.  We do similar things
here, but they work because u_int is the same as uintptr_t on i386's.)

20 years agoPrint the dirpref avgfilesize and avgfpdir parameters.
Don Lewis [Mon, 17 Nov 2003 01:22:07 +0000 (01:22 +0000)]
Print the dirpref avgfilesize and avgfpdir parameters.

MFC after: 2 weeks

20 years agoDon't implement mpo_destroy() for Biba, LOMAC, and MLS, as they
Robert Watson [Mon, 17 Nov 2003 01:04:07 +0000 (01:04 +0000)]
Don't implement mpo_destroy() for Biba, LOMAC, and MLS, as they
aren't allowed to be unloaded.

Obtained from: TrustedBSD Project
Sponsored by: DARPA, Network Associates Laboratories

20 years agoUpdate a comment about needing to fix NFS server credential use
Robert Watson [Mon, 17 Nov 2003 00:56:53 +0000 (00:56 +0000)]
Update a comment about needing to fix NFS server credential use
by 5.0-RELEASE: make it now read 5.3-RELEASE to be realistic.  Still
needs fixing...

20 years agoDocument nologin(8) as being insecure in conjunction with a dynamic
David Schultz [Mon, 17 Nov 2003 00:08:28 +0000 (00:08 +0000)]
Document nologin(8) as being insecure in conjunction with a dynamic
root and suggest alternatives.

20 years ago - Remove unnecessary synchronization from sf_buf_init(). (There is only
Alan Cox [Sun, 16 Nov 2003 23:40:06 +0000 (23:40 +0000)]
 - Remove unnecessary synchronization from sf_buf_init().  (There is only
   one active CPU when sf_buf_init() is performed.)

20 years agoImplement sockets support for __mac_get_fd() and __mac_set_fd()
Robert Watson [Sun, 16 Nov 2003 23:31:45 +0000 (23:31 +0000)]
Implement sockets support for __mac_get_fd() and __mac_set_fd()
system calls, and prefer these calls over getsockopt()/setsockopt()
for ABI reasons.  When addressing UNIX domain sockets, these calls
retrieve and modify the socket label, not the label of the
rendezvous vnode.

- Create mac_copy_socket_label() entry point based on
  mac_copy_pipe_label() entry point, intended to copy the socket
  label into temporary storage that doesn't require a socket lock
  to be held (currently Giant).

- Implement mac_copy_socket_label() for various policies.

- Expose socket label allocation, free, internalize, externalize
  entry points as non-static from mac_net.c.

- Use mac_socket_label_set() in __mac_set_fd().

MAC-aware applications may now use mac_get_fd(), mac_set_fd(), and
mac_get_peer() to retrieve and set various socket labels without
directly invoking the getsockopt() interface.

Obtained from: TrustedBSD Project
Sponsored by: DARPA, Network Associates Laboratories

20 years agoDon't waste so much space for the latency debugging buffer. Its size
Bruce Evans [Sun, 16 Nov 2003 23:05:52 +0000 (23:05 +0000)]
Don't waste so much space for the latency debugging buffer.  Its size
will now need editing except for spot checks.

Changed this buffer from a circular one to a linear one.  This is more
useful for some cases and the sysctl that prints it doesn't support
circular buffers.

Fixed (output) formatting bugs in this sysctl.  An off by 1 error caused
a garbage byte to be returned after annotation of large deltas, and
a race with the writer sometimes caused premature string termination.

20 years agoGross kludge:
Warner Losh [Sun, 16 Nov 2003 22:33:42 +0000 (22:33 +0000)]
Gross kludge:
o when compiling lint, undefine certain things and redefine them so that the
  driver doesn't #error out.  Since lint kernels aren't supposed to be
  bootable, I'm no troubled by this breakage.

This fixes the tinderbox

Suggested by: rwatson
Approved by: bms

20 years agoDocument NO_DYNAMICROOT.
Simon L. B. Nielsen [Sun, 16 Nov 2003 22:15:09 +0000 (22:15 +0000)]
Document NO_DYNAMICROOT.

Reviewed by: gordon

20 years agoFix build on alpha
Kris Kennaway [Sun, 16 Nov 2003 21:53:05 +0000 (21:53 +0000)]
Fix build on alpha

Pointy hat to: alfred

20 years agologerror is used in syslogd to log errors from syslogd itself. It
David Malone [Sun, 16 Nov 2003 21:51:06 +0000 (21:51 +0000)]
logerror is used in syslogd to log errors from syslogd itself. It
is possible for an error to occur while trying to log an error, and
this can result in infinite recursion (or at least until we run out
of stack).

Rather than this, we ignore requests to log an error while logging an
error.

PR: 51253
MFC after: 2 weeks

20 years agoRemove an argument to printf that is unused.
David Malone [Sun, 16 Nov 2003 21:42:00 +0000 (21:42 +0000)]
Remove an argument to printf that is unused.

20 years agoInvert the condition that installs the dynamic linker early, since
Gordon Tetlow [Sun, 16 Nov 2003 21:17:43 +0000 (21:17 +0000)]
Invert the condition that installs the dynamic linker early, since
DYNAMICROOT is now the default. Also document -DNO_DYNAMICROOT since
that is going to be a documented feature.

Submitted by: matusita, rushani

20 years agoModified release note: dynamically linked /bin and /sbin is now the
Bruce A. Mah [Sun, 16 Nov 2003 20:34:46 +0000 (20:34 +0000)]
Modified release note:  dynamically linked /bin and /sbin is now the
default.

20 years agoUpdate mac_set.3 to account for new behavior of mac_set_fd() in the
Robert Watson [Sun, 16 Nov 2003 20:21:21 +0000 (20:21 +0000)]
Update mac_set.3 to account for new behavior of mac_set_fd() in the
context of sockets, and document EINVAL as a possible failure mode
based on the object selected, not just the label provided.

Obtained from: TrustedBSD Project
Sponsored by: DARPA, Network Associates Laboratories

20 years agoImplement mac_get_peer(3) using getsockopt() with SOL_SOCKET and
Robert Watson [Sun, 16 Nov 2003 20:18:24 +0000 (20:18 +0000)]
Implement mac_get_peer(3) using getsockopt() with SOL_SOCKET and
SO_PEERLABEL.  This provides an interface to query the label of a
socket peer without embedding implementation details of mac_t in
the application.  Previously, sizeof(*mac_t) had to be specified
by an application when performing getsockopt().

Document mac_get_peer(3), and expand documentation of the other
mac_get(3) functions.  Note that it's possible to get EINVAL back
from mac_get_fd(3) when pointing it at an inappropriate object.

NOTE: mac_get_fd() and mac_set_fd() support for sockets will
follow shortly, so the documentation is slightly ahead of the
code.

Obtained from: TrustedBSD Project
Sponsored by: DARPA, Network Associates Laboratories

20 years agoAbstract the label checking and setting logic from
Robert Watson [Sun, 16 Nov 2003 20:01:50 +0000 (20:01 +0000)]
Abstract the label checking and setting logic from
mac_setsockopt_label() into mac_socket_label_set(); make it non-static
so that it can be invoked from kern_mac.c for mac_set_fd().

Obtained from: TrustedBSD Project
Sponsored by: DARPA, Network Associates Laboratories

20 years agoImplement mpo_copy_{mbuf,pipe,vnode}_label() entry points for
Robert Watson [Sun, 16 Nov 2003 18:28:58 +0000 (18:28 +0000)]
Implement mpo_copy_{mbuf,pipe,vnode}_label() entry points for
mac_stub and mac_test.

Obtained from: TrustedBSD Project
Sponsored by: DARPA, Network Associates Laboratories

20 years agoReduce gratuitous redundancy and length in function names:
Robert Watson [Sun, 16 Nov 2003 18:25:20 +0000 (18:25 +0000)]
Reduce gratuitous redundancy and length in function names:

  mac_setsockopt_label_set() -> mac_setsockopt_label()
  mac_getsockopt_label_get() -> mac_getsockopt_label()
  mac_getsockopt_peerlabel_get() -> mac_getsockopt_peerlabel()

Obtained from: TrustedBSD Project
Sponsored by: DARPA, Network Associates Laboratories

20 years agoWhen rebooting the machine jump to 0xf000:0xfff0 instead of 0xffff:0x0.
Poul-Henning Kamp [Sun, 16 Nov 2003 18:24:23 +0000 (18:24 +0000)]
When rebooting the machine jump to 0xf000:0xfff0 instead of 0xffff:0x0.

While we end up the same place, we end up with two different CS register
values after the jump and 0xf000 is compatible with the hardware reset
value.

This makes a difference if the BIOS does a near jump before a far jump.

Detective work and patch by:  Adrian Steinmann <ast@marabu.ch>

20 years agoAdd the ports/arabic category to the examples.
Ceri Davies [Sun, 16 Nov 2003 17:55:54 +0000 (17:55 +0000)]
Add the ports/arabic category to the examples.

MFC After: 4 days

20 years agoIf the unmount by file system ID fails, don't warn before retrying
Ian Dowse [Sun, 16 Nov 2003 16:48:18 +0000 (16:48 +0000)]
If the unmount by file system ID fails, don't warn before retrying
a non-fsid unmount if the file system ID is all zeros. This is a
temporary workaround for warnings that occur in the vfs.usermount=1
case because non-root users get a zeroed filesystem ID. I have a
more complete fix in the works, but I won't get it done for 5.2.

20 years agomdoc(7) janitor:
Simon L. B. Nielsen [Sun, 16 Nov 2003 15:16:19 +0000 (15:16 +0000)]
mdoc(7) janitor:
- Use .Aq macro instead of <foo>.
- Kill EOL whitespace.

20 years agoPull latest changes from OpenBSD:
Maxim Sobolev [Sun, 16 Nov 2003 15:07:10 +0000 (15:07 +0000)]
Pull latest changes from OpenBSD:

- improve sysinfo(2) syscall;
- add dummy fadvise64(2) syscall;
- add dummy *xattr(2) family of syscalls;
- add protos for the syscalls 222-225, 238-249 and 253-267;
- add exit_group(2) syscall, which is currently just wired to exit(2).

Obtained from:  OpenBSD
MFC after:      2 weeks

20 years agoBack out last change and go back to using KSE locks instead of thread
Daniel Eischen [Sun, 16 Nov 2003 15:01:26 +0000 (15:01 +0000)]
Back out last change and go back to using KSE locks instead of thread
locks until we know why this breaks ia64.

Reported by: marcel

20 years agoAdd the following devices to the list of supported devices, to sync
Simon L. B. Nielsen [Sun, 16 Nov 2003 14:02:37 +0000 (14:02 +0000)]
Add the following devices to the list of supported devices, to sync
manual page with the source code:
- HAL Corporation Crossam2+USB IR commander
- RATOC REX-USB60
- SOURCENEXT KeikaiDenwa 8 (with and without charger)

20 years agoRestored the call to schedsofttty() (now spelled swi_sched(...)) again.
Bruce Evans [Sun, 16 Nov 2003 13:31:45 +0000 (13:31 +0000)]
Restored the call to schedsofttty() (now spelled swi_sched(...)) again.
Its restoration in rev.1.102 was mistranslated to the equivalent of
setsofttty() in rev.1.105.  This increased overheads by causing a
context switch to the SWI handler after almost every interrupt.  The
increase was approx. 50% on a Celeron 366 (from 23 usec to 34 usec
per interrupt).

20 years agoFix comment typo.
Shunsuke Akiyama [Sun, 16 Nov 2003 13:13:16 +0000 (13:13 +0000)]
Fix comment typo.

Noticed by: simon

20 years agoMake two casts correct for all types of 64bit platforms.
Andre Oppermann [Sun, 16 Nov 2003 12:50:33 +0000 (12:50 +0000)]
Make two casts correct for all types of 64bit platforms.

Explained by: bde

20 years agoMake interrupt pipe interval time configurable.
Shunsuke Akiyama [Sun, 16 Nov 2003 12:26:10 +0000 (12:26 +0000)]
Make interrupt pipe interval time configurable.
- Add kernel options: {UPLCOM,UVSCOM}_INTR_INTERVAL
- Add sysctl variables: 'hw.usb.{uplcom,uvscom}.interval'

MFC after: 1 week

20 years agoApply some fixups in the driver_t's.
Shunsuke Akiyama [Sun, 16 Nov 2003 12:13:39 +0000 (12:13 +0000)]
Apply some fixups in the driver_t's.

MFC after: 1 week

20 years agoRegen.
Shunsuke Akiyama [Sun, 16 Nov 2003 12:07:01 +0000 (12:07 +0000)]
Regen.

20 years agoAdd vendor IDs, and device IDs supported by uplcom(4).
Shunsuke Akiyama [Sun, 16 Nov 2003 12:05:11 +0000 (12:05 +0000)]
Add vendor IDs, and device IDs supported by uplcom(4).

- SOURCENEXT Corp. KeikaiDenwa 8 [1]
- SOUECENEXT Corp. KeikaiDenwa 8 with charger [2]
- HAL Corp. Crossam2+USB [3]

Submitted by: [1] Ryo ONODERA <ryo3327@netscape.net>
[2] Masaki Mizutani <m-saki@rr.iij4u.or.jp>
[3] FUJISHIMA Satsuki <sf@FreeBSD.org>
MFC after: 1 week

20 years agoAdd missing ioctl functions.
Shunsuke Akiyama [Sun, 16 Nov 2003 11:58:21 +0000 (11:58 +0000)]
Add missing ioctl functions.

MFC after: 1 week

20 years agoAdd rue(4) into list of miibus-using drivers and reference.
Shunsuke Akiyama [Sun, 16 Nov 2003 11:52:26 +0000 (11:52 +0000)]
Add rue(4) into list of miibus-using drivers and reference.

MFC after: 1 week

20 years agoRemove an annoying printf that somehow leaked into rev 1.21.
Nate Lawson [Sun, 16 Nov 2003 08:41:24 +0000 (08:41 +0000)]
Remove an annoying printf that somehow leaked into rev 1.21.

20 years agoAs mentioned by warner, previous revision (opt_ddb.h) was just a fluke --
Brian Feldman [Sun, 16 Nov 2003 08:10:59 +0000 (08:10 +0000)]
As mentioned by warner, previous revision (opt_ddb.h) was just a fluke --
I'm having bad luck with different parts of the sys tree being checked
out at slightly different times.  Back it out, noting it doesn't cause
harm in any case.  Tinderbox also makes these things more fun.

20 years agoConvert the live dump command (`dump -L') to use mksnap_ffs instead
Kirk McKusick [Sun, 16 Nov 2003 08:01:58 +0000 (08:01 +0000)]
Convert the live dump command (`dump -L') to use mksnap_ffs instead
of trying to directly create the snapshot itself. This change allows
users logged into the system as operator to run live dumps.

Note that dump no longer tries to create the snapshot in the root of
the filesystem, but rather in a .snap directory in the root of the
filesystem. The reason is that the operator is usually not permitted
to write into the root of the filesystem. The newfs command and
background fsck have both been modified to create a .snap directory
in the root of the filesystem, but if neither of these have been run,
then the .snap directory must be created manually by the superuser
before a live dump can be run. The .snap directory should be owned
by user root and group operator and set to mode 770.