]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
21 years ago o Lock page queue accesses by vm_page_deactivate().
alc [Fri, 2 Aug 2002 03:56:31 +0000 (03:56 +0000)]
 o Lock page queue accesses by vm_page_deactivate().

21 years agoIntroduce support for Mandatory Access Control and extensible
rwatson [Fri, 2 Aug 2002 03:12:40 +0000 (03:12 +0000)]
Introduce support for Mandatory Access Control and extensible
kernel access control.

Teach devfs how to respond to pathconf() _POSIX_MAC_PRESENT queries,
allowing it to indicate to user processes that individual vnode labels
are available.

Obtained from: TrustedBSD Project
Sponsored by: DARPA, NAI Labs

21 years agoPrevent out of bounds writting for too many slashes case.
ache [Fri, 2 Aug 2002 01:04:49 +0000 (01:04 +0000)]
Prevent out of bounds writting for too many slashes case.
Replace strnpy + ='\0' with strlcpy

MFC after: 1 day

21 years agoIntroduce support for Mandatory Access Control and extensible
rwatson [Thu, 1 Aug 2002 22:37:08 +0000 (22:37 +0000)]
Introduce support for Mandatory Access Control and extensible
kernel access control.

Create directories for per-policy include files.

Obtained from: TrustedBSD Project
Sponsored by: DARPA, NAI Labs

21 years agoHook up devfs_pathconf() for specfs devfs nodes, not just regular
rwatson [Thu, 1 Aug 2002 22:27:57 +0000 (22:27 +0000)]
Hook up devfs_pathconf() for specfs devfs nodes, not just regular
devfs nodes.

Obtained from: TrustedBSD Project
Sponsored by: DARPA, NAI Labs

21 years agoDemonstrate that MAC modules can also be linked statically as
rwatson [Thu, 1 Aug 2002 22:26:38 +0000 (22:26 +0000)]
Demonstrate that MAC modules can also be linked statically as
well as loaded as modules by hooking up mac_none if
'options MAC_NONE' is defined.

Obtained from: TrustedBSD Project
Sponsored by: DARPA, NAI Labs

21 years agoIntroduce support for Mandatory Access Control and extensible
rwatson [Thu, 1 Aug 2002 22:23:02 +0000 (22:23 +0000)]
Introduce support for Mandatory Access Control and extensible
kernel access control.

Invoke appropriate MAC entry points for a number of VFS-related
operations in the Linux ABI module.  In particular, handle uselib
in a manner similar to open() (more work is probably needed here),
as well as handle statfs(), and linux readdir()-like calls.

Obtained from: TrustedBSD Project
Sponsored by: DARPA, NAI Labs

21 years agoSample loader.conf lines for various MAC modules.
rwatson [Thu, 1 Aug 2002 22:03:19 +0000 (22:03 +0000)]
Sample loader.conf lines for various MAC modules.

21 years agoForgot to commit this.
jake [Thu, 1 Aug 2002 21:39:54 +0000 (21:39 +0000)]
Forgot to commit this.

Spotted by: scottl

21 years agoIntroduce support for Mandatory Access Control and extensible
rwatson [Thu, 1 Aug 2002 21:37:34 +0000 (21:37 +0000)]
Introduce support for Mandatory Access Control and extensible
kernel access control.

Add MAC support for the UDP protocol.  Invoke appropriate MAC entry
points to label packets that are generated by local UDP sockets,
and to authorize delivery of mbufs to local sockets both in the
multicast/broadcast case and the unicast case.

Obtained from: TrustedBSD Project
Sponsored by: DARPA, NAI Labs

21 years agoIntroduce support for Mandatory Access Control and extensible
rwatson [Thu, 1 Aug 2002 21:15:53 +0000 (21:15 +0000)]
Introduce support for Mandatory Access Control and extensible
kernel access control.

Introduce two ioctls, SIOCGIFMAC, SIOCSIFMAC, which permit user
processes to manage the MAC labels on network interfaces.  Note
that this is part of the user process API/ABI that will be revised
prior to 5.0-RELEASE.

Obtained from: TrustedBSD Project
Sponsored by: DARPA, NAI Labs

21 years agoIntroduce support for Mandatory Access Control and extensible
rwatson [Thu, 1 Aug 2002 21:13:47 +0000 (21:13 +0000)]
Introduce support for Mandatory Access Control and extensible
kernel access control.

Add MAC support for if_ppp.  Label packets as they are removed from
the raw PPP mbuf queue.  Preserve the mbuf MAC label across various
PPP data-munging and reconstitution operations.  Perform access
control checks on mbufs to be transmitted via the interface.

Obtained from: TrustedBSD Project
Sponsored by: DARPA, NAI Labs

21 years agoIntroduce support for Mandatory Access Control and extensible
rwatson [Thu, 1 Aug 2002 21:00:05 +0000 (21:00 +0000)]
Introduce support for Mandatory Access Control and extensible
kernel access control.

Label packets generated by the gif virtual interface.

Perform access control on packets delivered to gif virtual interfaces.

Obtained from: TrustedBSD Project
Sponsored by: DARPA, NAI Labs

21 years agoIntroduce support for Mandatory Access Control and extensible
rwatson [Thu, 1 Aug 2002 20:44:52 +0000 (20:44 +0000)]
Introduce support for Mandatory Access Control and extensible
kernel access control.

Invoke appropriate MAC framework entry points to authorize readdir()
operations in the native ABI.

Obtained from: TrustedBSD Project
Sponsored by: DARPA, NAI Labs

21 years agoFix a comment.
julian [Thu, 1 Aug 2002 19:10:40 +0000 (19:10 +0000)]
Fix a comment.

21 years agoSlight cleanup of some comments/whitespace.
julian [Thu, 1 Aug 2002 18:45:10 +0000 (18:45 +0000)]
Slight cleanup of some comments/whitespace.
Make idle process state more consistant.
Add an assert on thread state.
Clean up idleproc/mi_switch() interaction.
Use a local instead of referencing curthread 7 times in a row
(I've been told curthread can be expensive on some architectures)
Remove some commented out code.
Add a little commented out code (completion coming soon)

Reviewed by: jhb@freebsd.org

21 years agoSince we have the struct file data pointer cached in vp, use that
rwatson [Thu, 1 Aug 2002 18:29:30 +0000 (18:29 +0000)]
Since we have the struct file data pointer cached in vp, use that
instead when invoking VOP_POLL().

21 years ago o Acquire the page queues lock before calling vm_page_io_finish().
alc [Thu, 1 Aug 2002 17:57:42 +0000 (17:57 +0000)]
 o Acquire the page queues lock before calling vm_page_io_finish().
 o Assert that the page queues lock is held in vm_page_io_finish().

21 years agoInclude file cleanup; mac.h and malloc.h at one point had ordering
rwatson [Thu, 1 Aug 2002 17:47:56 +0000 (17:47 +0000)]
Include file cleanup; mac.h and malloc.h at one point had ordering
relationship requirements, and no longer do.

Reminded by: bde

21 years agoIntroduce support for Mandatory Access Control and extensible
rwatson [Thu, 1 Aug 2002 17:41:27 +0000 (17:41 +0000)]
Introduce support for Mandatory Access Control and extensible
kernel access control.

Hook up various policy modules to the kernel build.

Note that a number of these modules require futher entry point commits
in the remainder of the kernel to become fully functional, but enough
of the pieces are in place to allow experimentation.

Note also that it would be desirable to not build the mac_*.ko modules
if 'options MAC' is not defined in the kernel configuration, because
the resulting modules are not useful without the kernel option.  There
doesn't appear to be precedent for a way to do this -- for example,
we allow ipfw.ko to be built even if 'options NETINET' isn't defined.
Suggests welcomed on the "best" way to do this.

Obtained from: TrustedBSD Project
Sponsored by: DARPA, NAI Labs

21 years agoMove even closer to matching behaviour of our old tar(1) wrt preserving
sobomax [Thu, 1 Aug 2002 17:32:08 +0000 (17:32 +0000)]
Move even closer to matching behaviour of our old tar(1) wrt preserving
modes of extracted files. This effectively disables special threating
of uid 0 for mode-preserving purposes and should fix problems with
pkg_add(1) and probably other things when extracting files/dirs with
sticky mode bits set.

Pointed out by: bde
MFC in: 2 weeks

21 years agoChange macop_t to const, use macop_t in MAC policy entry point definition
rwatson [Thu, 1 Aug 2002 17:32:01 +0000 (17:32 +0000)]
Change macop_t to const, use macop_t in MAC policy entry point definition
structure.  This prevents a boatload of warnings in the MAC modules,
so we can hook them up to the build.

Obtained from: TrustedBSD Project
Sponsored by: DARPA, NAI Labs

21 years agoIntroduce support for Mandatory Access Control and extensible
rwatson [Thu, 1 Aug 2002 17:23:22 +0000 (17:23 +0000)]
Introduce support for Mandatory Access Control and extensible
kernel access control

Invoke appropriate MAC framework entry points to authorize a number
of vnode operations, including read, write, stat, poll.  This permits
MAC policies to revoke access to files following label changes,
and to limit information spread about the file to user processes.

Note: currently the file cached credential is used for some of
these authorization check.  We will need to expand some of the
MAC entry point APIs to permit multiple creds to be passed to
the access control check to allow diverse policy behavior.

Obtained from: TrustedBSD Project
Sponsored by: DARPA, NAI Labs

21 years agoFix the link to the Handbook
blackend [Thu, 1 Aug 2002 17:21:18 +0000 (17:21 +0000)]
Fix the link to the Handbook

21 years agoIntroduce support for Mandatory Access Control and extensible
rwatson [Thu, 1 Aug 2002 17:14:28 +0000 (17:14 +0000)]
Introduce support for Mandatory Access Control and extensible
kernel access control.

Restructure the vn_open_cred() access control checks to invoke
the MAC entry point for open authorization.  Note that MAC can
reject open requests where existing DAC code skips the open
authorization check due to O_CREAT.  However, the failure mode
here is the same as other failure modes following creation,
wherein an empty file may be left behind.

Obtained from: TrustedBSD Project
Sponsored by: DARPA, NAI Labs

21 years agoDon't depend on namespace pollution from <netinet/in_pcb.h>.
des [Thu, 1 Aug 2002 16:49:31 +0000 (16:49 +0000)]
Don't depend on namespace pollution from <netinet/in_pcb.h>.

Submitted by: bde

21 years agoIntroduce support for Mandatory Access Control and extensible
rwatson [Thu, 1 Aug 2002 15:37:12 +0000 (15:37 +0000)]
Introduce support for Mandatory Access Control and extensible
kernel access control.

Invoke appropriate MAC entry points to authorize the following
operations:

        truncate on open()                      (write)
        access()                                (access)
        readlink()                              (readlink)
        chflags(), lchflags(), fchflags()       (setflag)
        chmod(), fchmod(), lchmod()             (setmode)
        chown(), fchown(), lchown()             (setowner)
        utimes(), lutimes(), futimes()          (setutimes)
        truncate(), ftrunfcate()                (write)
        revoke()                                (revoke)
        fhopen()                                (open)
        truncate on fhopen()                    (write)
        extattr_set_fd, extattr_set_file()      (setextattr)
        extattr_get_fd, extattr_get_file()      (getextattr)
        extattr_delete_fd(), extattr_delete_file() (setextattr)

These entry points permit MAC policies to enforce a variety of
protections on vnodes.  More vnode checks to come, especially in
non-native ABIs.

Obtained from: TrustedBSD Project
Sponsored by: DARPA, NAI Labs

21 years agoNew release note: SA-02:34.
bmah [Thu, 1 Aug 2002 15:27:51 +0000 (15:27 +0000)]
New release note:  SA-02:34.

21 years agoIntroduce support for Mandatory Access Control and extensible
rwatson [Thu, 1 Aug 2002 14:31:58 +0000 (14:31 +0000)]
Introduce support for Mandatory Access Control and extensible
kernel access control.

Invoke an appropriate MAC entry point to authorize execution of
a file by a process.  The check is placed slightly differently
than it appears in the trustedbsd_mac tree so that it prevents
a little more information leakage about the target of the execve()
operation.

Obtained from: TrustedBSD Project
Sponsored by: DARPA, NAI Labs

21 years agoMove the MAC label init/destroy stuff to more appropriate places so that
bmilekic [Thu, 1 Aug 2002 14:24:41 +0000 (14:24 +0000)]
Move the MAC label init/destroy stuff to more appropriate places so that
the inits/destroys are done without the cache locks held even in the
persistent-lock calls.  I may be cheating a little by using the MAC
"already initialized" flag for now.

21 years agoRevert previous revision which accidentally snuck in with another commit.
jhb [Thu, 1 Aug 2002 13:44:33 +0000 (13:44 +0000)]
Revert previous revision which accidentally snuck in with another commit.
It just removed a comment that doesn't make sense to me personally.

21 years agoRevert previous revision which was accidentally committed and has not been
jhb [Thu, 1 Aug 2002 13:39:33 +0000 (13:39 +0000)]
Revert previous revision which was accidentally committed and has not been
tested yet.

21 years agoForced commit to note that the previous log was incorrect. The previous
jhb [Thu, 1 Aug 2002 13:37:22 +0000 (13:37 +0000)]
Forced commit to note that the previous log was incorrect.  The previous
commit added an assertion that a taskqueue being free'd wasn't being
drained at the same time.

21 years agoIf we fail to write to a vnode during a ktrace write, then we drop all
jhb [Thu, 1 Aug 2002 13:35:38 +0000 (13:35 +0000)]
If we fail to write to a vnode during a ktrace write, then we drop all
other references to that vnode as a trace vnode in other processes as well
as in any pending requests on the todo list.  Thus, it is possible for a
ktrace request structure to have a NULL ktr_vp when it is destroyed in
ktr_freerequest().  We shouldn't call vrele() on the vnode in that case.

Reported by: bde

21 years agoThe fix applied to the XDR decoder in revision 1.11 was incorrect.
nectar [Thu, 1 Aug 2002 12:23:04 +0000 (12:23 +0000)]
The fix applied to the XDR decoder in revision 1.11 was incorrect.

21 years agoFix an easy warning in a local addition.
markm [Thu, 1 Aug 2002 11:29:05 +0000 (11:29 +0000)]
Fix an easy warning in a local addition.

21 years agoImplement the -l and -c options, which I'd forgotten.
des [Thu, 1 Aug 2002 11:02:30 +0000 (11:02 +0000)]
Implement the -l and -c options, which I'd forgotten.

21 years agoFix links to the FAQ and the Handbook
blackend [Thu, 1 Aug 2002 10:20:59 +0000 (10:20 +0000)]
Fix links to the FAQ and the Handbook

Reviewed by: re@
MFC after: 1 week

21 years agoFix a bug about stack manipulation at ACPI wakeup.
iwasaki [Thu, 1 Aug 2002 09:48:01 +0000 (09:48 +0000)]
Fix a bug about stack manipulation at ACPI wakeup.
This should avoid kernel panic on kernel compiled w/o
NO_CPU_COPTFLAGS.

Suggested by: optimized code by -mcpu=pentiumpro

21 years agoDon't set the IFF_PROMISC bit when in hostap mode like the previous
imp [Thu, 1 Aug 2002 07:37:52 +0000 (07:37 +0000)]
Don't set the IFF_PROMISC bit when in hostap mode like the previous
commit bogusly did.  Instead, don't set PROMSIC in the hardware if
we're in hostap mode.  This matches more closely what openbsd did as
well.

21 years agoImplement the POSIX.1-2001 (XSI) header, <cpio.h>.
mike [Thu, 1 Aug 2002 07:18:38 +0000 (07:18 +0000)]
Implement the POSIX.1-2001 (XSI) header, <cpio.h>.

21 years agoDocument the undocumented assumption that at least one of the PCB
rwatson [Thu, 1 Aug 2002 03:54:43 +0000 (03:54 +0000)]
Document the undocumented assumption that at least one of the PCB
pointer and incoming mbuf pointer will be non-NULL in tcp_respond().
This is relied on by the MAC code for correctness, as well as
existing code.

Obtained from: TrustedBSD PRoject
Sponsored by: DARPA, NAI Labs

21 years agoIntroduce support for Mandatory Access Control and extensible
rwatson [Thu, 1 Aug 2002 03:53:04 +0000 (03:53 +0000)]
Introduce support for Mandatory Access Control and extensible
kernel access control.

Add support for labeling most out-going ICMP messages using an
appropriate MAC entry point.  Currently, we do not explicitly
label packet reflect (timestamp, echo request) ICMP events,
implicitly using the originating packet label since the mbuf is
reused.  This will be made explicit at some point.

Obtained from: TrustedBSD Project
Sponsored by: DARPA, NAI Labs

21 years agoIntroduce support for Mandatory Access Control and extensible
rwatson [Thu, 1 Aug 2002 03:50:08 +0000 (03:50 +0000)]
Introduce support for Mandatory Access Control and extensible
kernel access control.

Instrument chdir() and chroot()-related system calls to invoke
appropriate MAC entry points to authorize the two operations.

Obtained from: TrustedBSD Project
Sponsored by: DARPA, NAI Labs

21 years agoIntroduce support for Mandatory Access Control and extensible
rwatson [Thu, 1 Aug 2002 03:45:40 +0000 (03:45 +0000)]
Introduce support for Mandatory Access Control and extensible
kernel access control.

Implement two IOCTLs at the socket level to retrieve the primary
and peer labels from a socket.  Note that this user process interface
will be changing to improve multi-policy support.

Obtained from: TrustedBSD Project
Sponsored by: DARPA, NAI Labs

21 years agoRemove duplicate 'modules-tags' rule
peter [Thu, 1 Aug 2002 03:13:10 +0000 (03:13 +0000)]
Remove duplicate 'modules-tags' rule

21 years agoIntroduce support for Mandatory Access Control and extensible
rwatson [Thu, 1 Aug 2002 02:03:21 +0000 (02:03 +0000)]
Introduce support for Mandatory Access Control and extensible
kernel access control.

Modify procfs so that (when mounted multilabel) it exports process MAC
labels as the vnode labels of procfs vnodes associated with processes.

Approved by: des
Obtained from: TrustedBSD Project
Sponsored by: DARPA, NAI Labs

21 years agoAllow the ahc and ahd drivers to be built as modules. This also
scottl [Thu, 1 Aug 2002 01:36:39 +0000 (01:36 +0000)]
Allow the ahc and ahd drivers to be built as modules.  This also
breaks the ahc driver into a core back-end and pci and eisa
front-ends.

21 years agoIntroduce support for Mandatory Access Control and extensible
rwatson [Thu, 1 Aug 2002 01:33:12 +0000 (01:33 +0000)]
Introduce support for Mandatory Access Control and extensible
kernel access control.

Modify pseudofs so that it can support synthetic file systems with
the multilabel flag set.  In particular, implement vop_refreshlabel()
as pn_refreshlabel().  Implement pfs_refreshlabel() to invoke this,
and have it fall back to the mount label if the file system does
not implement pn_refreshlabel() for the node.  Otherwise, permit
the file system to determine how the service is provided.

Approved by: des
Obtained from: TrustedBSD Project
Sponsored by: DARPA, NAI Labs

21 years agoImprove formatting and variable use consistency in extattr system
rwatson [Thu, 1 Aug 2002 01:29:03 +0000 (01:29 +0000)]
Improve formatting and variable use consistency in extattr system
calls.

Submitted by: green
Obtained from: TrustedBSD Project
Sponsored by: DARPA, NAI Labs

21 years agoSimplify the logic to enter VFS_EXTATTRCTL().
rwatson [Thu, 1 Aug 2002 01:26:07 +0000 (01:26 +0000)]
Simplify the logic to enter VFS_EXTATTRCTL().

Obtained from: TrustedBSD Project
Sponsored by: DARPA, NAI Labs

21 years agoIntroduce support for Mandatory Access Control and extensible
rwatson [Thu, 1 Aug 2002 01:21:40 +0000 (01:21 +0000)]
Introduce support for Mandatory Access Control and extensible
kernel access control.

Authorize vop_readlink() and vop_lookup() activities during recursive
path lookup via namei() via calls to appropriate MAC entry points.

Obtained from: TrustedBSD Project
Sponsored by: DARPA, NAI Labs

21 years agoIntroduce support for Mandatory Access Control and extensible
rwatson [Thu, 1 Aug 2002 01:18:42 +0000 (01:18 +0000)]
Introduce support for Mandatory Access Control and extensible
kernel access control.

Authorize the creation of UNIX domain sockets in the file system
namespace via an appropriate invocation a MAC framework entry
point.

Obtained from: TrustedBSD Project
Sponsored by: DARPA, NAI Labs

21 years agoWhen invoking NDINIT() in preparation for CREATE, set SAVENAME since
rwatson [Thu, 1 Aug 2002 01:16:22 +0000 (01:16 +0000)]
When invoking NDINIT() in preparation for CREATE, set SAVENAME since
we'll use nd.ni_cnp later.

Submitted by: green
Obtained from: TrustedBSD Project
Sponsored by: DARPA, NAI Labs

21 years agoIntroduce support for Mandatory Access Control and extensible
rwatson [Thu, 1 Aug 2002 01:09:54 +0000 (01:09 +0000)]
Introduce support for Mandatory Access Control and extensible
kernel access control.

Instrument ctty driver invocations of various vnode operations on the
terminal controlling tty to perform appropriate MAC framework
authorization checks.

Note: VOP_IOCTL() on the ctty appears to be authorized using NOCRED in
the existing code rather than td->td_ucred.  Why?

Obtained from: TrustedBSD Project
Sponsored by: DARPA, NAI Labs

21 years agoIntroduce support for Mandatory Access Control and extensible
rwatson [Thu, 1 Aug 2002 01:07:03 +0000 (01:07 +0000)]
Introduce support for Mandatory Access Control and extensible
kernel access control.

Instrument the ktrace write operation so that it invokes the MAC
framework's vnode write authorization check.

Obtained from: TrustedBSD Project
Sponsored by: DARPA, NAI Labs

21 years agoIntroduce support for Mandatory Access Control and extensible
rwatson [Thu, 1 Aug 2002 01:04:16 +0000 (01:04 +0000)]
Introduce support for Mandatory Access Control and extensible
kernel access control.

Instrument the kernel ACL retrieval and modification system calls
to invoke MAC framework entry points to authorize these operations.

Obtained from: TrustedBSD Project
Sponsored by: DARPA, NAI Labs

21 years agoModify the cache handling code to assume 2 virtual colours, which is much
jake [Thu, 1 Aug 2002 00:16:22 +0000 (00:16 +0000)]
Modify the cache handling code to assume 2 virtual colours, which is much
simpler and easier to get right.  Add comments.  Add more statistic
gathering on cacheable and uncacheable mappings.

21 years agoAdd some statistic gathering for cache flushes.
jake [Wed, 31 Jul 2002 23:39:50 +0000 (23:39 +0000)]
Add some statistic gathering for cache flushes.

21 years agoForgot this one: properly initialize an address set when the set
luigi [Wed, 31 Jul 2002 22:42:08 +0000 (22:42 +0000)]
Forgot this one: properly initialize an address set when the set
size is less than 32 bits (/28 mask or more).
Also remove a debugging fprintf().

21 years agoTwo bugfixes:
luigi [Wed, 31 Jul 2002 22:31:47 +0000 (22:31 +0000)]
Two bugfixes:
  + the header file contains two different opcodes (O_IPOPTS and O_IPOPT)
    for what is the same thing, and sure enough i used one in the kernel
    and the other one in userland. Be consistent!

  + "keep-state" and "limit" must be the last match pattern in a rule,
    so no matter how you enter them move them to the end of the rule.

21 years agoThe ppp and tunnel modules now rely on opt_mac.h. Missed in a previous
rwatson [Wed, 31 Jul 2002 20:19:28 +0000 (20:19 +0000)]
The ppp and tunnel modules now rely on opt_mac.h.  Missed in a previous
commit.

Submitted by: Anders Andersson <anders@hack.org>

21 years agoStash various networking paramters in the environment for the kernel
jake [Wed, 31 Jul 2002 20:17:06 +0000 (20:17 +0000)]
Stash various networking paramters in the environment for the kernel
to pick up, ala pxe.

21 years agoNew release note: SA-02:33.
bmah [Wed, 31 Jul 2002 20:09:07 +0000 (20:09 +0000)]
New release note:  SA-02:33.

21 years agoAdd 16-bit before bus to keep the words card and bus apart.
imp [Wed, 31 Jul 2002 20:01:11 +0000 (20:01 +0000)]
Add 16-bit before bus to keep the words card and bus apart.

21 years agoMake sure to set both sets of registers which control the RX and TX buffer
silby [Wed, 31 Jul 2002 19:58:36 +0000 (19:58 +0000)]
Make sure to set both sets of registers which control the RX and TX buffer
sizes.  Previously, the end result was at the mercy of the card's default
setting.  This change will reduce the number of buffer underruns for
some users.

PR: kern/37929
Submitted by: Thomas Nystrom <thn@saeab.se>
MFC after: 7 days

21 years ago- Split the unaligned access check flags out of md_flags in struct mdthread
jhb [Wed, 31 Jul 2002 19:37:03 +0000 (19:37 +0000)]
- Split the unaligned access check flags out of md_flags in struct mdthread
  and move them into md_uac in struct mdproc.  mdproc is protected by the
  proc lock.  md_flags now is only ever modified by the current thread, so
  it doesn't need a lock.
- Rename the constants for all the per-thread MD flags to use MDTD_*
  instead of MDP_*.

21 years agoIntroduce support for Mandatory Access Control and extensible
rwatson [Wed, 31 Jul 2002 19:06:49 +0000 (19:06 +0000)]
Introduce support for Mandatory Access Control and extensible
kernel access control.

Instrument the TCP socket code for packet generation and delivery:
label outgoing mbufs with the label of the socket, and check socket and
mbuf labels before permitting delivery to a socket.  Assign labels
to newly accepted connections when the syncache/cookie code has done
its business.  Also set peer labels as convenient.  Currently,
MAC policies cannot influence the PCB matching algorithm, so cannot
implement polyinstantiation.  Note that there is at least one case
where a PCB is not available due to the TCP packet not being associated
with any socket, so we don't label in that case, but need to handle
it in a special manner.

Obtained from: TrustedBSD Project
Sponsored by: DARPA, NAI Labs

21 years ago o Setting PG_MAPPED and PG_WRITEABLE on pages that are mapped and unmapped
alc [Wed, 31 Jul 2002 18:46:47 +0000 (18:46 +0000)]
 o Setting PG_MAPPED and PG_WRITEABLE on pages that are mapped and unmapped
   by pmap_qenter() and pmap_qremove() is pointless.  In fact, it probably
   leads to unnecessary pmap_page_protect() calls if one of these pages is
   paged out after unwiring.

Note: setting PG_MAPPED asserts that the page's pv list may be
non-empty.  Since checking the status of the page's pv list isn't any
harder than checking this flag, the flag should probably be eliminated.
Alternatively, PG_MAPPED could be set by pmap_enter() exclusively
rather than various places throughout the kernel.

21 years agoAlso print the serial # on atacontrol cap ....
sos [Wed, 31 Jul 2002 18:30:38 +0000 (18:30 +0000)]
Also print the serial # on atacontrol cap ....

21 years agoIntroduce support for Mandatory Access Control and extensible
rwatson [Wed, 31 Jul 2002 18:30:34 +0000 (18:30 +0000)]
Introduce support for Mandatory Access Control and extensible
kernel access control.

Instrument the raw IP socket code for packet generation and delivery:
label outgoing mbufs with the label of the socket, and check the
socket and mbuf labels before permitting delivery to a socket,
permitting MAC policies to selectively allow delivery of raw IP mbufs
to various raw IP sockets that may be open.  Restructure the policy
checking code to compose IPsec and MAC results in a more readable
manner.

Obtained from: TrustedBSD Project
Sponsored by: DARPA, NAI Labs

21 years agoByteswap the serial #
sos [Wed, 31 Jul 2002 18:29:34 +0000 (18:29 +0000)]
Byteswap the serial #

21 years agoFinally first shot at a driver for the Promise SuperTrak SX6000 ATA RAID
sos [Wed, 31 Jul 2002 18:27:30 +0000 (18:27 +0000)]
Finally first shot at a driver for the Promise SuperTrak SX6000 ATA RAID
controller. Some testing has already been done, but its still greenish.
RAID's has to be setup via the BIOS on the SuperTrak, but all RAID
types are supported by the driver. The SuperTrak rebuilds failed arrays
on the fly and supports spare disks etc etc...

Add "device     pst" to your config file to use.

As usual bugsreports, suggestions etc are welcome...

Development sponsored by:       Advanis
Hardware donated by:            Promise Inc.

21 years agoFinally first shot at a driver for the Promise SuperTrak SX6000 ATA RAID
sos [Wed, 31 Jul 2002 18:26:30 +0000 (18:26 +0000)]
Finally first shot at a driver for the Promise SuperTrak SX6000 ATA RAID
controller. Some testing has already been done, but its still greenish.
RAID's has to be setup via the BIOS on the SuperTrak, but all RAID
types are supported by the driver. The SuperTrak rebuilds failed arrays
on the fly and supports spare disks etc etc...

Add "device pst" to your config file to use.

As usual bugsreports, suggestions etc are welcome...

Development sponsored by: Advanis
Hardware donated by: Promise Inc.

21 years agoIntroduce support for Mandatory Access Control and extensible
rwatson [Wed, 31 Jul 2002 18:07:45 +0000 (18:07 +0000)]
Introduce support for Mandatory Access Control and extensible
kernel access control.

Provide implementations of some sample operating system security
policy extensions.  These are not yet hooked up to the build as
other infrastructure is still being committed.  Most of these
work fairly well and are in daily use in our development and (limited)
production environments.  Some are not yet in their final form,
and a number of the labeled policies waste a lot of kernel memory
and will be fixed over the next month or so to be more conservative.
They do give good examples of the flexibility of the MAC framework
for implementing a variety of security policies.

mac_biba: Implementation of fixed-label Biba integrity policy,
similar to those found in a number of commercial
trusted operating systems.  All subjects and objects
are assigned integrity levels, and information flow
is controlled based on a read-up, write-down
policy.  Currently, purely hierarchal.

mac_bsdextended: Implementation of a "file system firewall",
which allows the administrator to specify a series
of rules limiting access by users and groups to
objects owned by other users and groups.  This
policy is unlabeled, relying on existing system
security labeling (file permissions/ownership,
process credentials).

mac_ifoff: Secure interface silencing.  Special-purpose module
to limit inappropriate out-going network traffic
for silent monitoring scenarios.  Prevents the
various network stacks from generating any output
despite an interface being live for reception.

mac_mls: Implementation of fixed-label Multi-Level Security
confidentiality policy, similar to those found in
a number of commercial trusted operating systems.
All subjects and objects are assigned confidentiality
levels, and information flow is controlled based on
a write-up, read-down policy.  Currently, purely
hiearchal, although non-hierarchal support is in the
works.

mac_none: Policy module implementing all MAC policy entry
points with empty stubs.  A good place to start if
you want all the prototypes types in for you, and
don't mind a bit of pruning.  Can be loaded, but
has no access control impact.  Useful also for
performance measurements.

mac_seeotheruids: Policy module implementing a security service
similar to security.bsd.seeotheruids, only a slightly
more detailed policy involving exceptions for members
of specific groups, etc.  This policy is unlabeled,
relying on existing system security labeling
(process credentials).

mac_test: Policy module implementing basic sanity tests for
label handling.  Attempts to ensure that labels are
not freed multiple times, etc, etc.

Obtained from: TrustedBSD Project
Sponsored by: DARPA, NAI Labs

21 years agoIntroduce support for Mandatory Access Control and extensible
rwatson [Wed, 31 Jul 2002 17:21:01 +0000 (17:21 +0000)]
Introduce support for Mandatory Access Control and extensible
kernel access control.

When fragmenting an IP datagram, invoke an appropriate MAC entry
point so that MAC labels may be copied (...) to the individual
IP fragment mbufs by MAC policies.

When IP options are inserted into an IP datagram when leaving a
host, preserve the label if we need to reallocate the mbuf for
alignment or size reasons.

Obtained from: TrustedBSD Project
Sponsored by: DARPA, NAI Labs

21 years agoIntroduce support for Mandatory Access Control and extensible
rwatson [Wed, 31 Jul 2002 17:17:51 +0000 (17:17 +0000)]
Introduce support for Mandatory Access Control and extensible
kernel access control.

Instrument the code managing IP fragment reassembly queues (struct ipq)
to invoke appropriate MAC entry points to maintain a MAC label on
each queue.  Permit MAC policies to associate information with a queue
based on the mbuf that caused it to be created, update that information
based on further mbufs accepted by the queue, influence the decision
making process by which mbufs are accepted to the queue, and set the
label of the mbuf holding the reassembled datagram following reassembly
completetion.

Obtained from: TrustedBSD Project
Sponsored by: DARPA, NAI Labs

21 years agoFix an easy WARNS.
markm [Wed, 31 Jul 2002 16:53:59 +0000 (16:53 +0000)]
Fix an easy WARNS.

21 years agoFix some easy WARNS.
markm [Wed, 31 Jul 2002 16:52:16 +0000 (16:52 +0000)]
Fix some easy WARNS.

21 years agoGive lint a small bit of help.
markm [Wed, 31 Jul 2002 16:50:21 +0000 (16:50 +0000)]
Give lint a small bit of help.

21 years agoIntroduce support for Mandatory Access Control and extensible
rwatson [Wed, 31 Jul 2002 16:46:56 +0000 (16:46 +0000)]
Introduce support for Mandatory Access Control and extensible
kernel access control.

When generating an IGMP message, invoke a MAC entry point to permit
the MAC framework to label its mbuf appropriately for the target
interface.

Obtained from: TrustedBSD Project
Sponsored by: DARPA, NAI Labs

21 years agoIntroduce support for Mandatory Access Control and extensible
rwatson [Wed, 31 Jul 2002 16:45:16 +0000 (16:45 +0000)]
Introduce support for Mandatory Access Control and extensible
kernel access control.

When generating an ARP query, invoke a MAC entry point to permit the
MAC framework to label its mbuf appropriately for the interface.

Obtained from: TrustedBSD Project
Sponsored by: DARPA, NAI Labs

21 years agosort(1) and uniq(1).
markm [Wed, 31 Jul 2002 16:44:01 +0000 (16:44 +0000)]
sort(1) and uniq(1).

21 years agoIntroduce support for Mandatory Access Control and extensible
rwatson [Wed, 31 Jul 2002 16:42:47 +0000 (16:42 +0000)]
Introduce support for Mandatory Access Control and extensible
kernel access control.

Invoke the MAC framework to label mbuf created using divert sockets.
These labels may later be used for access control on delivery to
another socket, or to an interface.

Obtained from: TrustedBSD Project
Sponsored by: DARPA, NAI LAbs

21 years agoIntroduce support for Mandatory Access Control and extensible
rwatson [Wed, 31 Jul 2002 16:39:49 +0000 (16:39 +0000)]
Introduce support for Mandatory Access Control and extensible
kernel access control.

Instrument connect(), listen(), and bind() system calls to invoke
MAC framework entry points to permit policies to authorize these
requests.  This can be useful for policies that want to limit
the activity of processes involving particular types of IPC and
network activity.

Obtained from: TrustedBSD Project
Sponsored by: DARPA, NAI Labs

21 years agoFreeBSD has setkey in different location from NetBSD.
ume [Wed, 31 Jul 2002 16:39:19 +0000 (16:39 +0000)]
FreeBSD has setkey in different location from NetBSD.

Submitted by: Mike Makonnen <makonnen@pacbell.net>

21 years agoIntroduce support for Mandatory Access Control and extensible
rwatson [Wed, 31 Jul 2002 16:23:42 +0000 (16:23 +0000)]
Introduce support for Mandatory Access Control and extensible
kernel access control.

Label mbufs received via kernel tunnel device interfaces by invoking
appropriate MAC framework entry points.

Perform access control checks on out-going mbufs delivered via tunnel
interfaces by invoking appropriate MAC entry points:

NOTE: Currently the label for a tunnel interface is not derived from
the label of the process that opened the tunnel interface.  It
probably should be.

Obtained from: TrustedBSD Project
Sponsored by: DARPA, NAI Labs

21 years agoThese file are no longer used (moved to userland and/or merged into
jake [Wed, 31 Jul 2002 16:23:27 +0000 (16:23 +0000)]
These file are no longer used (moved to userland and/or merged into
pmap.c).

21 years agoIntroduce support for Mandatory Access Control and extensible
rwatson [Wed, 31 Jul 2002 16:22:02 +0000 (16:22 +0000)]
Introduce support for Mandatory Access Control and extensible
kernel access control.

Label mbufs received via ethernet-based interfaces by invoking
appropriate MAC framework entry points.

Perform access control checks on out-going mbufs delivered via
ethernet-based interfaces by invoking appropriate MAC entry
points.

Obtained from: TrustedBSD Project
Sponsored by: DARPA, NAI Labs

21 years agoIntroduce support for Mandatory Access Control and extensible
rwatson [Wed, 31 Jul 2002 16:16:03 +0000 (16:16 +0000)]
Introduce support for Mandatory Access Control and extensible
kernel access control.

Instrument the interface management code so that MAC labels are
properly maintained on network interfaces (struct ifnet).  In
particular, invoke entry points when interfaces are created and
removed.  MAC policies may initialized the label interface based
on a variety of factors, including the interface name.

Obtained from: TrustedBSD Project
Sponsored by: DARPA, NAI Labs

21 years agoNew release note: SA-02:32.
bmah [Wed, 31 Jul 2002 16:13:59 +0000 (16:13 +0000)]
New release note:  SA-02:32.

21 years agoIntroduce support for Mandatory Access Control and extensible
rwatson [Wed, 31 Jul 2002 16:13:13 +0000 (16:13 +0000)]
Introduce support for Mandatory Access Control and extensible
kernel access control.

When decompressing data from one mbuf into another mbuf, preserve the
mbuf label by copying it to the new mbuf.

Obtained from: TrustedBSD Project
Sponsored by: DARPA, NAI Labs

21 years agoIntroduce support for Mandatory Access Control and extensible
rwatson [Wed, 31 Jul 2002 16:11:32 +0000 (16:11 +0000)]
Introduce support for Mandatory Access Control and extensible
kernel access control.

Invoke a MAC framework entry point to authorize reception of an
incoming mbuf by the BPF descriptor, permitting MAC policies to
limit the visibility of packets delivered to particular BPF
descriptors.

Obtained from: TrustedBSD Project
Sponsored by: DARPA, NAI Labs

21 years agoIntroduce support for Mandatory Access Control and extensible
rwatson [Wed, 31 Jul 2002 16:09:38 +0000 (16:09 +0000)]
Introduce support for Mandatory Access Control and extensible
kernel access control.

Instrument BPF so that MAC labels are properly maintained on BPF
descriptors.  MAC framework entry points are invoked at BPF
instantiation and allocation, permitting the MAC framework to
derive the BPF descriptor label from the credential authorizing
the device open.  Also enter the MAC framework to label mbufs
created using the BPF device.

Obtained from: TrustedBSD Project
Sponsored by: DARPA, NAI Labs

21 years agoIntroduce support for Mandatory Access Control and extensible
rwatson [Wed, 31 Jul 2002 16:05:30 +0000 (16:05 +0000)]
Introduce support for Mandatory Access Control and extensible
kernel access control.

Instrument UFS to support per-inode MAC labels.  In particular,
invoke MAC framework entry points for generically supporting the
backing of MAC labels into extended attributes.  This ends up
introducing new vnode operation vector entries point at the MAC
framework entry points, as well as some explicit entry point
invocations for file and directory creation events so that the
MAC framework can push labels to disk before the directory names
become persistent (this will work better once EAs in UFS2 are
hooked into soft updates).  The generic EA MAC entry points
support executing with the file system in either single label
or multilabel operation, and will fall back to the mount label
if multilabel is not specified at mount-time.

Obtained from: TrustedBSD Project
Sponsored by: DARPA, NAI Labs

21 years agoThese were repo-copied to have a .S extension.
jake [Wed, 31 Jul 2002 15:56:15 +0000 (15:56 +0000)]
These were repo-copied to have a .S extension.

21 years agoAdd pathconf/fpathconf entries from POSIX.1e indicating support for
rwatson [Wed, 31 Jul 2002 15:54:03 +0000 (15:54 +0000)]
Add pathconf/fpathconf entries from POSIX.1e indicating support for
ACLs, Capabilities, Information Labels, and MAC Labels on the
queried file system.

21 years ago*.s -> *.S.
jake [Wed, 31 Jul 2002 15:52:04 +0000 (15:52 +0000)]
*.s -> *.S.

21 years agoIntroduce support for Mandatory Access Control and extensible
rwatson [Wed, 31 Jul 2002 15:45:16 +0000 (15:45 +0000)]
Introduce support for Mandatory Access Control and extensible
kernel access control.

Instrument devfs to support per-dirent MAC labels.  In particular,
invoke MAC framework when devfs directory entries are instantiated
due to make_dev() and related calls, and invoke the MAC framework
when vnodes are instantiated from these directory entries.  Implement
vop_setlabel() for devfs, which pushes the label update into the
devfs directory entry for semi-persistant store.  This permits the MAC
framework to assign labels to devices and directories as they are
instantiated, and export access control information via devfs vnodes.

Obtained from: TrustedBSD Project
Sponsored by: DARPA, NAI Labs

21 years agoSort headers to reduce diffs between branches.
nectar [Wed, 31 Jul 2002 15:11:59 +0000 (15:11 +0000)]
Sort headers to reduce diffs between branches.