Commit Graph

128038 Commits

Author SHA1 Message Date
Robert Watson
800c940832 Add a new priv(9) kernel interface for checking the availability of
privilege for threads and credentials.  Unlike the existing suser(9)
interface, priv(9) exposes a named privilege identifier to the privilege
checking code, allowing more complex policies regarding the granting of
privilege to be expressed.  Two interfaces are provided, replacing the
existing suser(9) interface:

suser(td)                 ->   priv_check(td, priv)
suser_cred(cred, flags)   ->   priv_check_cred(cred, priv, flags)

A comprehensive list of currently available kernel privileges may be
found in priv.h.  New privileges are easily added as required, but the
comments on adding privileges found in priv.h and priv(9) should be read
before doing so.

The new privilege interface exposed sufficient information to the
privilege checking routine that it will now be possible for jail to
determine whether a particular privilege is granted in the check routine,
rather than relying on hints from the calling context via the
SUSER_ALLOWJAIL flag.  For now, the flag is maintained, but a new jail
check function, prison_priv_check(), is exposed from kern_jail.c and used
by the privilege check routine to determine if the privilege is permitted
in jail.  As a result, a centralized list of privileges permitted in jail
is now present in kern_jail.c.

The MAC Framework is now also able to instrument privilege checks, both
to deny privileges otherwise granted (mac_priv_check()), and to grant
privileges otherwise denied (mac_priv_grant()), permitting MAC Policy
modules to implement privilege models, as well as control a much broader
range of system behavior in order to constrain processes running with
root privilege.

The suser() and suser_cred() functions remain implemented, now in terms
of priv_check() and the PRIV_ROOT privilege, for use during the transition
and possibly continuing use by third party kernel modules that have not
been updated.  The PRIV_DRIVER privilege exists to allow device drivers to
check privilege without adopting a more specific privilege identifier.

This change does not modify the actual security policy, rather, it
modifies the interface for privilege checks so changes to the security
policy become more feasible.

Sponsored by:		nCircle Network Security, Inc.
Obtained from:		TrustedBSD Project
Discussed on:		arch@
Reviewed (at least in part) by:	mlaier, jmg, pjd, bde, ceri,
			Alex Lyashkov <umka at sevcity dot net>,
			Skip Ford <skip dot ford at verizon dot net>,
			Antoine Brodin <antoine dot brodin at laposte dot net>
2006-11-06 13:37:19 +00:00
Rink Springer
42a4336a90 Added PCI ID's for:
- 0x1065: Intel 82562ET/EZ/GT/GZ PRO/100 VE Ethernet [1], as found on
  Tyan GS14 barebones.
- 0x1094: Intel Pro/100 946GZ (ICH7) Network Connection [2], as found on
  Intel 946GZis motherboards.

[1] Submitted by:	myself
[2] Submitted by:	Mike Tancsa <mike@sentex.net>
Reviewed by:		imp (mentor), jfv
Approved by:		imp (mentor)
MFC after:		3 days
2006-11-06 12:19:43 +00:00
Takanori Watanabe
7687221959 Prevent freeing wild pointer when bailing out. 2006-11-06 12:14:27 +00:00
Konstantin Belousov
a0396f2797 Set up the context for the dbbe_trace callback in the ddb. Otherwise,
trap caused by backtracing would lead to panic.

Noted and reviewed by:	bde
2006-11-06 11:10:57 +00:00
Diomidis Spinellis
fee14f30e9 Avoid negative array indices: an empty string can also be used
to specify a default value.
2006-11-06 11:03:43 +00:00
Diomidis Spinellis
1ab8c5be60 See also arc4random
PR:		docs/54879
MFC after:	2 weeks
2006-11-06 10:39:49 +00:00
Diomidis Spinellis
a26a66124e Restore jot's ability to use a seed for producing a deterministic
sequence of random numbers.
This functionality was lost in revision 1.9 when the random number
generator was switched to arc4random.

PR:		docs/54879
MFC after:	2 weeks
2006-11-06 10:30:29 +00:00
Diomidis Spinellis
55f965ae6a Replace obscure aliases through pointers with plain variables.
MFC after:	2 weeks
2006-11-06 09:15:21 +00:00
Diomidis Spinellis
44d251df7a Regress.out is now regress.x.out. 2006-11-06 08:49:43 +00:00
Diomidis Spinellis
d737ec1ad4 Merge code in common cases.
Verified by:	New regression tests in tools/regression/usr.bin/jot
MFC after:	2 weeks
2006-11-06 08:47:41 +00:00
Diomidis Spinellis
2c75d9c7ba Test the handling of supplied and default parameters. 2006-11-06 08:39:52 +00:00
Diomidis Spinellis
afe53a4950 Replace opaque numeric bit flag values with #defined identifiers.
While there, add some missing FALLTHROUGH comments.

Verified with:	cmp(1) on the executable
MFC after:	2 weeks
2006-11-06 07:26:16 +00:00
David E. O'Brien
55738a1aa4 Remove gratuitous white space change. 2006-11-06 02:49:19 +00:00
David E. O'Brien
ffe2c5e5a5 Allow one to force with issue with 'TARGET_BIG_ENDIAN'. 2006-11-06 02:32:29 +00:00
David E. O'Brien
821cd5328a Switch default proto to TCP. 2006-11-06 01:42:11 +00:00
Tim Kientzle
8a4b2112a2 Eliminate documentation references to a non-existent function. 2006-11-06 00:28:46 +00:00
Tim Kientzle
a2b1e869b7 Computing SHLIB_MAJOR is not a good idea. It's really a FreeBSD
system value that has no real relation to the libarchive version.
(Except, of course, that any ABI breakage will force both to be
incremented.)
2006-11-06 00:24:57 +00:00
Tim Kientzle
a5261c3117 Remove an unused declaration. 2006-11-06 00:16:40 +00:00
Christian S.J. Peron
130b146814 Change the type of ar_arg_sockaddr from struct sockaddr to struct
sockaddr_storage.  This structure is defined in RFC 2553 and is a more
semantically correct structure for holding IP and IP6 sockaddr information.
struct sockaddr is not big enough to hold all the required information for
IP6, resulting in truncated addresses et al when auditing IP6 sockaddr
information.

We also need to assume that the sa->sa_len has been validated before the call to
audit_arg_sockaddr() is made, otherwise it could result in a buffer overflow.
This is being done to accommodate auditing of network related arguments (like
connect, bind et al) that will be added soon.

Discussed with:	rwatson
Obtained from:	TrustedBSD Project
MFC after:	2 weeks
2006-11-06 00:15:44 +00:00
Marcel Moolenaar
0463b4a2fb Major rework of the ia64 loaders. The two primary objectives are:
1. Make libefi portable by removing ia64 specific code and build
   it on i386 and amd64 by default to prevent regressions. These
   changes include fixes and improvements over previous code to
   establish or improve APIs where none existed or when the amount
   of kluging was unacceptably high.
2. Increase the amount of sharing between the efi and ski loaders
   to improve maintainability of the loaders and simplify making
   changes to the loader-kernel handshaking in the future.

The version of the efi and ski loaders are now both changed to 1.2
as user visible improvements and changes have been made.
2006-11-05 22:03:04 +00:00
Marcel Moolenaar
ab4dbc4f7f Forced commit to document that the following repo copy has been
performed:

	from:	src/sys/boot/efi/libefi/bootinfo.c
	to:	src/sys/boot/ia64/common/bootinfo.c

	from:	src/sys/boot/efi/libefi/copy.c
	to:	src/sys/boot/ia64/common/copy.c

	from:	src/sys/boot/efi/libefi/devicename.c
	to:	src/sys/boot/ia64/common/devicename.c

	from:	src/sys/boot/efi/libefi/elf_freebsd.c
	to:	src/sys/boot/ia64/common/exec.c

ncvs meister: simon (thanks!)
2006-11-05 21:27:43 +00:00
Daniel Gerzo
ef63af0fd2 - I forgot to bump a date.
Approved by: keramida (mentor), trhodes (mentor) (implicit)
2006-11-05 20:12:32 +00:00
Daniel Gerzo
2792c5504c - capitalize the first letter of the first word in the sentence
Approved by: trhodes (mentor), keramida (mentor)
2006-11-05 20:08:58 +00:00
Daniel Gerzo
2242569921 - add some files to FILES section and provide their description
- reference devfs.conf and devfs.rules in SEE ALSO section

Approved by: keramida (mentor), trhodes (mentor)
PR: docs/103347
MFC-after: 3 days
2006-11-05 19:37:27 +00:00
Tom Rhodes
d3dc0c9de4 Fix a typo: "the give login class" to "the given login class."
PR:		75577
Submitted by:	Nobuyuki Koganemaru
2006-11-05 19:00:08 +00:00
Stefan Farfeleder
44c892dac2 Add regression tests for PR 105078. 2006-11-05 18:41:23 +00:00
Stefan Farfeleder
62addaefc9 When parsing an invalid parameter expansion (eg. ${} or ${foo@bar}) do not
issue a syntax error immediately but save the information that it is erroneous
for later when the parameter expansion is actually done.  This means eg. "false
&& ${}" will not generate an error which seems to be required by POSIX.
Include the invalid parameter expansion in the error message (sometimes
abbreviated with ... because recovering it would require a lot of code).

PR:		105078
Submitted by:	emaste
2006-11-05 18:36:05 +00:00
Christian S.J. Peron
67be76c039 Fix possible leak when bridge is in monitor mode. Use m_freem() which will
free the entire chain, instead of using m_free() which will free just the
mbuf that was passed.

Discussed with:	thompsa
MFC after:	3 days
2006-11-05 17:56:25 +00:00
Maxim Konovalov
5e263e6078 o Add NetBSD 3.0.2 and NetBSD 3.1. 2006-11-05 15:56:45 +00:00
Olivier Houchard
507a594e15 Change one more ARM_BIG_ENDIAN to TARGET_BIG_ENDIAN. 2006-11-05 15:33:26 +00:00
Tom Rhodes
a4fff644c3 Sync up with rhyolite routed 2.31 which fixes the handling of varargs.
Remove -p from usage, it's gone completely now.

PR:		83387
Submited by:	arved
2006-11-05 14:49:47 +00:00
Ruslan Ermilov
9274ba8a1f Revert previous commit, and instead make the expression in rev. 1.2
match the style of this file.

OK'ed by:	rrs
2006-11-05 14:36:59 +00:00
Randall Stewart
50cec91936 Tons of fixes to get all the 64bit issues removed.
This also moves two 16 bit int's to become 32 bit
values so we do not have to use atomic_add_16.
Most of the changes are %p, casts and other various
nasty's that were in the orignal code base. With this
commit my machine will now do a build universe.. however
I as yet have not tested on a 64bit machine .. it may not work :-(
2006-11-05 13:25:18 +00:00
Maxim Konovalov
b16b2bd274 o Document ServeRAID 7x support.
Submitted by:	Andrey V. Elsukov
MFC after:	3 days
2006-11-05 08:55:21 +00:00
Boris Popov
fb8e9ead37 Create a bidirectional mapping of the DOS 'read only' attribute
to the 'w' flag.

PR:		kern/77958
Submitted by:	ghozzy gmail com
MFC after:	1 month
2006-11-05 06:38:42 +00:00
Boris Popov
834340ae9a It seems to be safe to ignore 'file not locked' error
from server.  This effectively suppresses 'Unmapped error 1:158'.

MFC after:	1 month
2006-11-05 06:31:08 +00:00
Tom Rhodes
c8e2104c9a The rune interface was removed by tjr over two years ago. 2006-11-05 00:39:56 +00:00
Pawel Jakub Dawidek
162ce1a75f When the source and destination objects for VOP_RENAME() are the same,
POSIX advice to just ignore the operation and return 0.
We already handle this case in kern_rename(), but don't give bad example -
the source is not removed.
2006-11-04 23:59:51 +00:00
Pawel Jakub Dawidek
479a8f8dd7 VOP_REMOVE() doesn't unlock vnodes nor decrease reference counts. 2006-11-04 23:58:15 +00:00
Pawel Jakub Dawidek
a2ca03b3ad Typo, 'from' vnode is locked here, not 'to' vnode. 2006-11-04 23:57:02 +00:00
John Birrell
8391a99bf7 Remove the KDTRACE option again because of the complaints about having
it as a default.

For the record, the KDTRACE option caused _no_ additional source files
to be compiled in; certainly no CDDL source files. All it did was to
allow existing BSD licensed kernel files to include one or more CDDL
header files.

By removing this from DEFAULTS, the onus is on a kernel builder to add
the option to the kernel config, possibly by including GENERIC and
customising from there. It means that DTrace won't be a feature
available in FreeBSD by default, which is the way I intended it to be.

Without this option, you can't load the dtrace module (which contains
the dtrace device and the DTrace framework). This is equivalent to
requiring an option in a kernel config before you can load the linux
emulation module, for example.

I think it is a mistake to have DTrace ported to FreeBSD, but not
to have it available to everyone, all the time. The only exception
to this is the companies which distribute systems with FreeBSD embedded.
Those companies will customise their systems anyway. The KDTRACE
option was intended for them, and only them.
2006-11-04 23:50:12 +00:00
Christian S.J. Peron
82f4b374d5 Currently, we initialize "error" to zero when it's declared, then
we never initialize it to anything else. However, in the case that
m_uiotombuf fails, we return error (effectively reporting success).

This appears to be a relic of an older revision of this file, where
"error" used to be doing something useful. (See revision 1.1, where
error is used in a loop with uiomove() instead of using m_uiotomubf).

So instead on unconditionally reporting success in the case there is
a failure in m_uiotombuf, explicitly return ENOBUFS. While we are
here, garbage collect the error variable since it's no longer required.

MFC after:	2 weeks
2006-11-04 20:54:37 +00:00
Andrew Thompson
59ee2183e2 When the packet is for the bridge then note which interface to send the reply
to, previously it was always broadcast to all interfaces (a bug). This is
useful when the bridge is the default gateway and vlans are used to isolate
each client, the reply is now kept private to the vlan which the client
resides.

Reported by:	Jon Otterholm
Tested by:	Jon Otterholm
MFC after:	3 days
2006-11-04 10:40:59 +00:00
Tom Rhodes
6a8a30dcd3 Xref pthread_condattr.3, pthread_attr.3, and pthread_mutexattr.3.
PR:		60679
Submitted by:	roam (with minor modifications)
2006-11-04 10:08:16 +00:00
Sam Lawrance
6b0a380f6d Document return values for res_query and res_search.
h_errno is not an extern int, just a macro providing an integer lvalue.

PR:		doc/50573
Submitted by:	Ronald F.Guilmette <rfg@monkeys.com>
Reviewed by:	trhodes
MFC after:	3 days
2006-11-04 09:42:22 +00:00
Daniel Gerzo
137e54d3db - clock_gettime is in time.h instead of sys/time.h
Approved by: trhodes (mentor), keramida (mentor)
PR: docs/104707
MFC-after: 3 days
2006-11-04 09:35:36 +00:00
Ruslan Ermilov
11acae799a Fix pointer arithmetic to be 64-bit friendly. 2006-11-04 08:45:50 +00:00
Ruslan Ermilov
e349e6b8a0 Remove bogus casts that Randall for some reason didn't borrow
from my supplied patch.
2006-11-04 08:19:01 +00:00
Doug Barton
ace7f68b50 This commit was generated by cvs2svn to compensate for changes in r163976,
which included commits to RCS files with non-trunk default branches.
2006-11-04 07:53:25 +00:00
Doug Barton
a02f92e875 Update to version 9.3.2-P2, which addresses the vulnerability
announced by ISC dated 31 October (delivered via e-mail to the
bind-announce@isc.org list on 2 November):

Description:
        Because of OpenSSL's recently announced vulnerabilities
        (CAN-2006-4339, CVE-2006-2937 and CVE-2006-2940) which affect named,
        we are announcing this workaround and releasing patches.  A proof of
        concept attack on OpenSSL has been demonstrated for CAN-2006-4339.

        OpenSSL is required to use DNSSEC with BIND.

Fix for version 9.3.2-P1 and lower:
        Upgrade to BIND 9.3.2-P2, then generate new RSASHA1 and
        RSAMD5 keys for all old keys using the old default exponent
        and perform a key rollover to these new keys.

        These versions also change the default RSA exponent to be
        65537 which is not vulnerable to the attacks described in
        CAN-2006-4339.
2006-11-04 07:53:25 +00:00