rwatson [Sat, 5 Oct 2002 18:11:36 +0000 (18:11 +0000)]
Merge support for mac_check_vnode_link(), a MAC framework/policy entry
point that instruments the creation of hard links. Policy implementations
to follow.
rwatson [Sat, 5 Oct 2002 17:44:49 +0000 (17:44 +0000)]
While the MAC API has supported the ability to handle M_NOWAIT passed
to mbuf label initialization, that functionality was never merged to
the main tree. Go ahead and merge that functionality now. Note that
this requires policy modules to accept the case where the label
element may be destroyed even if init has not succeeded on it (in
the event that policy failed the init). This will shortly also
apply to sockets.
rwatson [Sat, 5 Oct 2002 17:38:45 +0000 (17:38 +0000)]
Rearrange object and label init/destroy functions to match the
order used in mac_policy.h and elsewhere. Sort order is basically
"by operation category", then "alphabetically by object". Sync to
MAC tree.
rwatson [Sat, 5 Oct 2002 16:57:16 +0000 (16:57 +0000)]
Another big diff, little functional change: move label internalization,
externalization, and cred label life cycle events to entirely above
devfs and vnode events. Sync from MAC tree.
rwatson [Sat, 5 Oct 2002 16:54:59 +0000 (16:54 +0000)]
Move all object label init/destroy routines to the head of the
entry points to better match the entry point ordering in mac_policy.h.
Big diff, no functional change; merge from the MAC tree.
rwatson [Sat, 5 Oct 2002 15:10:00 +0000 (15:10 +0000)]
Begin another merge from the TrustedBSD MAC branch:
- Change mpo_init_foo(obj, label) and mpo_destroy_foo(obj, label) policy
entry points to mpo_init_foo_label(label) and
mpo_destroy_foo_label(label). This will permit the use of the same
entry points for holding temporary type-specific label during
internalization and externalization, as well as for caching purposes.
- Because of this, break out mpo_{init,destroy}_socket() and
mpo_{init,destroy}_mount() into seperate entry points for socket
main/peer labels and mount main/fs labels.
- Since the prototype for label initialization is the same across almost
all entry points, implement these entry points using common
implementations for Biba, MLS, and Test, reducing the number of
almost identical looking functions.
This simplifies policy implementation, as well as preparing us for the
merge of the new flexible userland API for managing labels on objects.
deischen [Sat, 5 Oct 2002 14:36:14 +0000 (14:36 +0000)]
Fix building of minimal kernels without npx by rearranging ifdefs.
Also fix some style bugs in surrounding code, and add a comment
about FP state restoral that seems questionable.
jmallett [Sat, 5 Oct 2002 04:49:46 +0000 (04:49 +0000)]
Put an easy-to-miss assignment into the proper place. It was stray in the
middle of a block of code, with no clear assignment. While here, move one
nearby assignment out of declaration.
rwatson [Sat, 5 Oct 2002 03:44:00 +0000 (03:44 +0000)]
Get Vinum up and running with GEOM:
(1) Use namei() and devfs to discover devices rather than a hard-coded
MAKEDEV implementation. Once rootfs is in place, this will allow
Vinum to be used for the root file system partition.
(2) Pass FREAD to device opens so that GEOM will return sector size
rather than an error on attempts to read label data.
(3) Avoid clobbering return values from close_drive() and masking this
failure, resulting in a later divide by zero due to not having
updated the Vinum-cached sector size.
(4) Ignore failures from DIOCWLABEL as that appears not to be required
in the GEOM environment.
We've done testing in simple Vinum environments, but those with more
complex environments might want to give this a spin in DP2 and make
sure everything is up to speed.
Fixes in collaboration with: iedowse
Reviewed by: grog
rwatson [Sat, 5 Oct 2002 03:07:23 +0000 (03:07 +0000)]
Remove a panic on vinum module unload: make sure to destroy all mutexes
before freeing so that WITNESS doesn't dereference mutex data pointers
and page fault. It's now possible to unload vinum.ko with a GENERIC
kernel on 5.0-CURRENT without panic.
deischen [Sat, 5 Oct 2002 02:22:26 +0000 (02:22 +0000)]
Once again, remove the i386-specific hacks to save and restore
the FPU state on receiving and returning from a signal.
The FPU save and restore macros are no longer needed, but
remain defined in case we need to use them again (something
else breaks). They'll be removed permanently once new
syscalls are added to handle the new i386 ucontext size.
iwasaki [Sat, 5 Oct 2002 02:01:05 +0000 (02:01 +0000)]
Add code for ACPI PCI link object manipulation.
This allocate the best IRQ to boot-disable devices (have IRQ 0).
Allocated IRQ will be used for PCI interrupt routing when ACPI is
enabled.
Note that verbose messaging enabled for the time being so that
people can easily notice the strange behavior if it happened.
mike [Fri, 4 Oct 2002 21:31:33 +0000 (21:31 +0000)]
o Adjust the SEM_VALUE_MAX macro so that <machine/limits.h> isn't
needed.
o Remove unneeded includes which only add namespace pollution.
o Sort function prototypes.
o Add restrict type-qualifier to sem_getvalue().
sam [Fri, 4 Oct 2002 20:31:23 +0000 (20:31 +0000)]
In-kernel crypto framework derived from openbsd. This facility provides
a consistent interface to h/w and s/w crypto algorithms for use by the
kernel and (for h/w at least) by user-mode apps. Access for user-level
code is through a /dev/crypto device that'll eventually be used by openssl
to (potentially) accelerate many applications. Coming soon is an IPsec
that makes use of this service to accelerate ESP, AH, and IPCOMP protocols.
Included here is the "core" crypto support, /dev/crypto driver, various
crypto algorithms that are not already present in the KAME crypto area,
and support routines used by crypto device drivers.
jhb [Fri, 4 Oct 2002 20:19:36 +0000 (20:19 +0000)]
Fix a bogon in previous commit. bcopy() from the malloc'd memory that we
already copied into, rather than doing the bcopy() from the userland
pointer. "Oops."
deischen [Fri, 4 Oct 2002 14:50:55 +0000 (14:50 +0000)]
Add another temporary hack to allow running older i386 binaries.
This will be removed when new versions of syscalls sigreturn()
and sigaction() are added (mini is working on this but is in
the middle of a move).
phk [Fri, 4 Oct 2002 13:33:30 +0000 (13:33 +0000)]
Unhook the SCSI CD driver from the disk "mini-layer" and/or GEOM.
SCSI disks are too square pegs for the round holes in both of these.
And since atapi-cd has clearly shown that there are better acccess
models for CD media than trying to pretend to be a classical disk,
we stop the masquerade rather than patch up the costume.
But do implement the DIOCGMEDIASIZE and DIOCGSECTORSIZE so it will
be possible to manually attach to GEOM, should some the need arise.
Ideally, this driver should do media-detection and call make_dev()
when a CD is inserted and destroy_dev() when it is removed, this
would allow our future devd(8) to automount etc etc but coding that
takes SCSI-clue beyond anything I posses.
bde [Fri, 4 Oct 2002 12:54:36 +0000 (12:54 +0000)]
Use the -mno-align-long-strings on i386's to debloat the kernel a little.
This reduces the size of GENERIC's text space by 73999 bytes (about 2%).
The bloat is from approximately 3437 strings longer than 31 characters
being padded to a 32-byte boundary.
phk [Fri, 4 Oct 2002 11:20:18 +0000 (11:20 +0000)]
Ok, concensus was to install libexpat under a "private brandname", and after
some deliberation the name "libbsdxml" was chosen since it conveys the two
most important attributes: "Private to FreeBSD" and "XML".
Add a skeleton man-page to give the credit and point for further
documentation. (If somebody wants to write a true mdoc manpage for
this I am sure both the eXpat people and I will be grateful).
tjr [Fri, 4 Oct 2002 03:18:26 +0000 (03:18 +0000)]
Add a placeholder implementation of wcscoll() and wcsxfrm() which gives
locale-sensitive collation only in single-byte locales, and just does
binary comparison for the others with extended character sets.
wollman [Fri, 4 Oct 2002 03:06:16 +0000 (03:06 +0000)]
Yesterday, FreeBSD-current ate my disklabel.
Today, I wrote a program to tell me where the partitions used to be.
Now I have my /media filesystem back.
peter [Fri, 4 Oct 2002 01:31:39 +0000 (01:31 +0000)]
Add some unspeakable hackery to the tree under #ifdef __ia64__ to work
around limitations in the ia64 kernel stack handling code. Basically
preallocate a bunch of threads (and hence kstacks) while contigmalloc()
still works, and never free them back to the general memory pool. After
the system has been running for a while, contigmalloc() eventually fails
at a critical momemt and panics the system.
peter [Fri, 4 Oct 2002 01:00:35 +0000 (01:00 +0000)]
Do a bit of rude hackery to get clock interrupts on all CPUs. This
is partly based on the Alpha system which duplicates the clock to
each cpu, instead of doing a clock roundrobin like on i386. This means
we get hz * ncpu clocks per second and so we have to seperate clock
sampling from actual 'do the work' clock processing. The BSP runs the
complete processing, the rest just sample state etc.
Using the on-cpu interval timer is not ideal as it will drift. There
is more to be done here, we should use an external clock source.