Commit Graph

35416 Commits

Author SHA1 Message Date
Warner Losh
c6a6193f79 Better comment for the product ID thing. 2002-10-07 06:35:04 +00:00
Warner Losh
da7b83f9ea Don't need to NUL terminate after snprintf 2002-10-07 06:26:17 +00:00
Poul-Henning Kamp
adfa3213c7 Copyin and copyout are only possible from a process-native thread,
and therefore we need a way for ioctl handlers to run in that thread
in GEOM.  Rather than invent a complicated registration system to
recognize which ioctl handler to use for a given ioctl, we still
schedule all ioctls down the tree as bio transactions but add a
special return code that means "call me directly" and have the
geom_dev layer do that.

Use this for all ioctls that make it as far as a diskdriver to
avoid any backwards compatibility problems.

Requested by:   scottl
Sponsored by:   DARPA & NAI Labs
2002-10-07 06:25:26 +00:00
Warner Losh
db8c52408d Update comments to remind me about power bugs in oldcard. 2002-10-07 06:18:50 +00:00
Warner Losh
7efff076f4 Ooops. Need to free dc_srom on detach to not leak memory.
Pointy Hat to: The Mad Redhead of Niwot
2002-10-07 05:29:13 +00:00
Warner Losh
3097aa70be Dynamically configure the width of the srom. This code comes from
OpenBSD who got the code (or the idea) from the NetBSD tlp driver.

This gets some cardbus dc cards working (either completely or nearly
so).  It also appears to get additional pci cards working, without
breaking working ones.

# Maybe some additional work is needed here.  Also, the cardbus attachment
# might need to match on the CIS rather than on the vendor/device so we have
# a finer level of detail as to what the card is.  Technically, the
# vendor/device fields are undefined for CardBus (even though most cards are
# using common silicon with pci models).
2002-10-07 05:26:35 +00:00
Warner Losh
ea5420299c o go ahead and route the interupt, even if it is supposedly unique.
there are some strange machines that seem to need this.
o delete bogus comment.
o don't use the the bios for read/writing config space.  They interact badly
  with SMP and being called from ISR.  This brings -current in line with
  -stable.

# make the latter #ifdef on USE_PCI_BIOS_FOR_READ_WRITE in case we
# need to go back in a hurry.
2002-10-07 05:15:05 +00:00
Warner Losh
3d9841b4eb Add two interfaces to allow for busses to report the pnpinfo for
devices as well as their location on the bus.
2002-10-07 05:06:38 +00:00
Alfred Perlstein
c814aa3fdb disable debug output by default. 2002-10-07 04:13:21 +00:00
Alfred Perlstein
8cbf4973a9 warn about p1003_1b_semaphores 2002-10-07 04:09:16 +00:00
Alfred Perlstein
34c3b2ca51 Disconnect "sem" module from the build. 2002-10-07 04:08:07 +00:00
Mike Barcroft
0aa282c0b3 Fix a spelling error in a comment.
Submitted by:	Craig Rodrigues <rodrigc@attbi.com>
2002-10-07 02:50:44 +00:00
Mike Barcroft
ddb056b7d4 Add conditionals to allow va_list to be defined in other headers. 2002-10-06 22:02:06 +00:00
Mike Barcroft
0b058e3cbd o Add conditionals to allow va_list to be defined in other headers.
o Standardize on _MACHINE_STDARG_H_ to allow multiple header includes.
o Restrict the definition of va_copy() to C99 environments.
2002-10-06 22:01:07 +00:00
Robert Watson
b371c939ce Integrate mac_check_socket_send() and mac_check_socket_receive()
checks from the MAC tree: allow policies to perform access control
for the ability of a process to send and receive data via a socket.
At some point, we might also pass in additional address information
if an explicit address is requested on send.

Obtained from:	TrustedBSD Project
Sponsored by:	DARPA, Network Associates Laboratories
2002-10-06 14:39:15 +00:00
Maxime Henrion
1f6973c5b4 When reusing a pointer as a number, at least cast it
to uintptr_t rather than u_int to avoid warnings on
64 bits architectures.
2002-10-06 14:02:35 +00:00
Robert Watson
82c6ef299e Trim accidentally introduced trailing whitespace. 2002-10-06 13:11:01 +00:00
Maxime Henrion
5ff9562781 Fix a bunch of s/int */size_t */. 2002-10-06 12:20:09 +00:00
Peter Grehan
726a1868a6 Roll back to previous version, no need for NO_GEOM when GEOM is
standard.
2002-10-06 12:13:12 +00:00
Maxime Henrion
20c544dbdf Yet another 64 bits warning fix: s/u_int/size_t/. 2002-10-06 12:07:58 +00:00
Maxime Henrion
0b3bf442a1 Fix a warning on 64 bits platforms: copyinstr() takes
a size_t *, not an u_int *.
2002-10-06 11:45:22 +00:00
Maxime Henrion
a8f15ed745 Fix a warning on 64 bits platforms: copystr() takes a size_t *,
not an int *.
2002-10-06 11:42:14 +00:00
Mark Murray
f1433817e4 Be consistent WRT function argument names. Other arguments only have
types, so remove these names. This also helps by not polluting
namespace.
2002-10-06 09:56:52 +00:00
Maxime Henrion
86597d47cb Oops. Actually connect back msdosfs to the build for every platform.
Spotted by:	bde
2002-10-06 08:07:40 +00:00
David E. O'Brien
39b9b6a43f It appears CPU_MAXID should be 1 more than the number of CPU_* defines. 2002-10-06 05:25:10 +00:00
David E. O'Brien
8185498ac2 CPU_MAXID should 2002-10-06 05:24:13 +00:00
Bruce Evans
c32049aa33 INclude <sys/mutex.h>'s prerequisite <sys/lock.h> instead of depending on
namespace pollution 2 layers deep in <sys/eventhandler.h>.
2002-10-06 03:18:14 +00:00
Robert Watson
e183f80e54 Sync from MAC tree: break out the single mmap entry point into
seperate entry points for each occasion:

mac_check_vnode_mmap()		Check at initial mapping
mac_check_vnode_mprotect()	Check at mapping protection change
mac_check_vnode_mmap_downgrade()	Determine if a mapping downgrade
					should take place following
					subject relabel.

Implement mmap() and mprotect() entry points for labeled vnode
policies.  These entry points are currently not hooked up to the
VM system in the base tree.  These changes improve the consistency
of the access control interface and offer more flexibility regarding
limiting access to vnode mmaping.

Obtained from:	TrustedBSD Project
Sponsored by:	DARPA, Network Associates Laboratories
2002-10-06 02:46:26 +00:00
Matthew N. Dodd
e6e85c5b17 Make this work under GEOM. 2002-10-06 00:19:38 +00:00
Poul-Henning Kamp
1fc1a1ef2a This patch got lost in my trees: Pass setattr down to device drivers
as well.

Detected by:	scottl
Sponsored by:	DARPA & NAI Labs.
2002-10-05 21:55:31 +00:00
Robert Watson
83985c267e Modify label allocation semantics for sockets: pass in soalloc's malloc
flags so that we can call malloc with M_NOWAIT if necessary, avoiding
potential sleeps while holding mutexes in the TCP syncache code.
Similar to the existing support for mbuf label allocation: if we can't
allocate all the necessary label store in each policy, we back out
the label allocation and fail the socket creation.  Sync from MAC tree.

Obtained from:	TrustedBSD Project
Sponsored by:	DARPA, Network Associates Laboratories
2002-10-05 21:23:47 +00:00
Maxime Henrion
ba7fd983ae The msdosfs module now builds on sparc64. No idea if it works
though.
2002-10-05 20:18:34 +00:00
Maxime Henrion
00a3bdc19a Add two extern's for adjkerntz and wall_cmos_clock, all other
archs have them there, alghough the variable are declared in
subr_clock.c.  These should probably be moved into some MI
place.

Approved by:	jake
2002-10-05 20:14:49 +00:00
Robert Watson
b497ca81d6 Make sure that the accounting credential is saved along with the vp
when accounting is suspended--otherwise when accounting is restored,
we may incorrectly assume the credential is valid.

Panics experienced by:	juli
2002-10-05 20:05:23 +00:00
Robert Watson
eea8ea3108 Implement mac_create_devfs_symlink() for policies that interact with
vnode labels.  Sync from MAC tree.

Obtained from:	TrustedBSD Project
Sponsored by:	DARPA, Network Associates Laboratories
2002-10-05 18:56:25 +00:00
Poul-Henning Kamp
5f79a2e33a Fix argument order mistake when decoding disklabels from on-disk format.
Detected by:	jhay
Sponsored by:	DARPA & NAI Labs.
2002-10-05 18:52:06 +00:00
Robert Watson
74e62b1b75 Integrate a devfs/MAC fix from the MAC tree: avoid a race condition during
devfs VOP symlink creation by introducing a new entry point to determine
the label of the devfs_dirent prior to allocation of a vnode for the
symlink.

Obtained from:	TrustedBSD Project
Sponsored by:	DARPA, Network Associates Laboratories
2002-10-05 18:40:10 +00:00
Robert Watson
c27b50f5b4 Merge implementation of mpo_check_vnode_link() for various appropriate
file-system aware MAC policies.  Sync to MAC tree.

Obtained from:	TrustedBSD Project
Sponsored by:	DARPA, Network Associates Laboratories
2002-10-05 18:25:48 +00:00
Robert Watson
0a69419678 Merge support for mac_check_vnode_link(), a MAC framework/policy entry
point that instruments the creation of hard links.  Policy implementations
to follow.

Obtained from:	TrustedBSD Project
Sponsored by:	DARPA, Network Associates Laboratories
2002-10-05 18:11:36 +00:00
Robert Watson
56c1541237 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.

Obtained from:	TrustedBSD Project
Sponsored by:	DARPA, Network Associates Laboratories
2002-10-05 17:44:49 +00:00
Robert Watson
87807196f8 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.

Obtained from:	TrustedBSD Project
Sponsored by:	DARPA, Network Associates Laboratories
2002-10-05 17:38:45 +00:00
Robert Watson
a931e345a9 Sync to MAC tree: use 'flag' instead of 'how' for mac_init_mbuf();
remove a slightly less than useful comment.
2002-10-05 17:18:43 +00:00
Brian Feldman
dab3d85fd7 Don't allow dev_stdclone(9) to accept minors larger than the system is
able to handle (0xffffff).
2002-10-05 17:10:28 +00:00
Robert Watson
69bbb5b1c7 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.

Obtained from:	TrustedBSD Project
Sponsored by:	DARPA, Network Associates Laboratories
2002-10-05 16:57:16 +00:00
Robert Watson
08bcdc586e 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.

Obtained from:	TrustedBSD Project
Sponsored by:	DARPA, Network Associates Laboratories
2002-10-05 16:54:59 +00:00
Robert Watson
ea599aa018 Synch from TrustedBSD MAC tree:
- If a policy isn't registered when a policy module unloads, silently
  succeed.

- Hold the policy list lock across more of the validity tests to avoid
  races.

Obtained from:	TrustedBSD Project
Sponsored by:	DARPA, Network Associates Laboratories
2002-10-05 16:46:03 +00:00
Poul-Henning Kamp
3bd6561289 NB: This commit does *NOT* make GEOM the default in FreeBSD
NB: But it will enable it in all kernels not having options "NO_GEOM"

Put the GEOM related options into the intended order.

Add "options NO_GEOM" to all kernel configs apart from NOTES.

In some order of controlled fashion, the NO_GEOM options will be
removed, architecture by architecture in the coming days.

There are currently three known issues which may force people to
need the NO_GEOM option:

boot0cfg/fdisk:
        Tries to update the MBR while it is being used to control
        slices.  GEOM does not allow this as a direct operation.

SCSI floppy drives:
        Appearantly the scsi-da driver return "EBUSY" if no media
        is inserted.  This is wrong, it should return ENXIO.

PC98:
        It is unclear if GEOM correctly recognizes all variants of
        PC98 disklabels.  (Help Wanted!  I have neither docs nor HW)

These issues are all being worked.

Sponsored by:	DARPA & NAI Labs.
2002-10-05 16:35:33 +00:00
Robert Watson
226b96fb6d Cosmetic line wrap synchronization. 2002-10-05 16:33:46 +00:00
Robert Watson
b2f0927ad6 Push the debugging obect label counters into security.mac.debug.counters
rather than directly under security.mac.debug.

Obtained from:	TrustedBSD Project
Sponsored by:	DARPA, Network Associates Laboratories
2002-10-05 16:30:53 +00:00
Poul-Henning Kamp
d98ce6902e Don't use dkunit() to find our softc when we can hang it off the dev_t.
This removes yet a dependency on the old disklabel stuff.

Sponsored by:	DARPA & NAI Labs.
2002-10-05 15:49:39 +00:00