Commit Graph

186343 Commits

Author SHA1 Message Date
Pawel Jakub Dawidek
49a6d80306 Start-up script for casperd daemon.
Sponsored by:	The FreeBSD Foundation
2013-12-16 11:03:59 +00:00
Hans Petter Selasky
6f0468df7a Fix regression issue after r259248:
Some Intel XHCI controlles timeout processing so-called "TRBs" when
the final LINK TRB of a so-called "TD" has the CHAIN-BIT set.

MFC after:	1 week
Tested by:	glebius @
2013-12-16 10:50:13 +00:00
Benjamin Kaduk
1871769f1f tzfile.5: catch up to r204333
The stdtime sources were moved from lib/libc to contrib/tzcode, and tzfile.h
is not an installed header, so the man page refers to its location in the
source tree.

The documentation could be more clear about the internal nature of the
header, but those changes should go through upstream tzcode.

PR:	docs/176864
Approved by:	hrs (mentor)
2013-12-16 01:58:12 +00:00
Marcel Moolenaar
15773775f7 Properly drain the TTY when both revoke(2) and close(2) end up closing
the TTY. In such a case, ttydev_close() is called multiple times and
each time, t_revokecnt is incremented and cv_broadcast() is called for
both the t_outwait and t_inwait condition variables.
Let's say revoke(2) comes in first and gets to call tty_drain() from
ttydev_leave(). Let's say that the revoke comes from init(8) as the
result of running "shutdown -r now". Since shutdown prints various
messages to the console before announing that the machine will reboot
immediately, let's also say that the output queue is not empty and
that tty_drain() has something to do. Let's assume this all happens
on a 9600 baud serial console, so it takes a time to drain.
The shutdown command will exit(2) and as such will end up closing
stdout. Let's say this close will come in second, bump t_revokecnt
and call tty_wakeup(). This has tty_wait() return prematurely and
the next thing that will happen is that the thread doing revoke(2)
will flush the TTY. Since the drain wasn't complete, the flush will
effectively drop whatever is left in t_outq.

This change takes into account that tty_drain() will return ERESTART
due to the fact that t_revokecnt was bumped and in that case simply
call tty_drain() again. The thread in question is already performing
the close so it can safely finish draining the TTY before destroying
the TTY structure.

Now all messages from shutdown will be printed on the serial console.

Obtained from:	Juniper Networks, Inc.
2013-12-16 00:50:14 +00:00
Pawel Jakub Dawidek
68cfe72642 Include bsd.own.mk for MK_CASPER to work.
Reported by:	nwhitehorn
2013-12-15 23:49:42 +00:00
Pawel Jakub Dawidek
007e4f41a7 Regenerate after r259438. 2013-12-15 23:20:26 +00:00
Pawel Jakub Dawidek
82845da3fa Fix syscalls that can be loaded as kernel modules - they were not given
the flag allowing to call them from capability mode sandbox.

Noticed by:	David Drysdale <drysdale@google.com>
2013-12-15 23:19:42 +00:00
Pawel Jakub Dawidek
61a9fc8fe2 Regenerate after r259436. 2013-12-15 23:15:12 +00:00
Pawel Jakub Dawidek
e1e16d2419 Allow for pselect(2) in capability mode.
Noticed by:	David Drysdale <drysdale@google.com>
2013-12-15 23:14:27 +00:00
Pawel Jakub Dawidek
73a4fbbb39 Forgot to regenerate after r257736. 2013-12-15 23:12:42 +00:00
Pawel Jakub Dawidek
4622f0e183 Make use of Casper's system.pwd and system.grp services when the -r option
is given to convert uids and gids to user names and group names even when
running in capability mode sandbox.

While here log on stderr when we successfully enter the sandbox.

Sponsored by:	The FreeBSD Foundation
2013-12-15 23:09:05 +00:00
Pawel Jakub Dawidek
252e504548 Add Casper support.
Sponsored by:	The FreeBSD Foundation
2013-12-15 23:05:19 +00:00
Pawel Jakub Dawidek
197731f68f Make use of casperd's system.dns service when running without the -n option.
Now tcpdump(8) is sandboxed even if DNS resolution is required.

Sponsored by:	The FreeBSD Foundation
2013-12-15 23:02:36 +00:00
Pawel Jakub Dawidek
36492dd3f5 MFp4 @1189141:
Change casperd's zygote process title.

MFC after:	1 week
2013-12-15 22:59:34 +00:00
Pawel Jakub Dawidek
518eeaeeca MFp4 @1189139:
Get rid of the msg_peek() function, which has a problem.  If there was less
data in the socket buffer than requested by the caller, the function would busy
loop, as select(2) will always return immediately.

We can just receive nvlhdr now, because some time ago we splitted receive of
data from the receive of descriptors.

MFC after:	1 week
2013-12-15 22:58:09 +00:00
Pawel Jakub Dawidek
396b29c74e Clear some more places with potentially sensitive data.
MFC after:	1 week
2013-12-15 22:52:18 +00:00
Pawel Jakub Dawidek
2a3237c84f Clear content of keyfiles loaded by the loader after processing them.
Pointed out by:	rwatson
MFC after:	1 week
2013-12-15 22:51:26 +00:00
Glen Barber
547c099adb Export 'REPOS_DIR' when the selected source medium for package
installation is cdrom.  This enables bsdconfig(8) to make use
of the on-disc pkg(8) repository configuration, which fixes
package selection and installation from the dvd installer.

MFC after:	3 days
M-MFC-With:	r259426
X-MFC-Before:	-RC3
Sponsored by:	The FreeBSD Foundation
2013-12-15 20:47:27 +00:00
Glen Barber
0d0e89b794 Add a pkg(8) repository configuration file for cdrom-based package
installation.

As part of the 'pkg-stage' target, copy the configuration file
to the 'packages/repos/' directory on the DVD filesystem.

MFC after:	3 days
X-MFC-Before:	-RC3
Sponsored by:	The FreeBSD Foundation
2013-12-15 20:38:07 +00:00
Benjamin Kaduk
2773bfa99a Add an UPDATING entry for the gss_pseudo_random behavior change
Approved by:	hrs (mentor, src committer)
2013-12-15 19:18:18 +00:00
Benjamin Kaduk
dcd1a208e5 Increment __FreeBSD_version for the behavior change of gss_pseudo_random
introduced in r259286.

Approved by:	hrs (mentor, src committer)
2013-12-15 18:26:31 +00:00
Konstantin Belousov
337a0242ce Revert r259045.
It seems that clang miscompiles code related to UDP with -fno-strict-overflow.
2013-12-15 18:13:42 +00:00
Justin Hibbits
ac01bc33c9 Save r3 before using it for the trap check, else we end up saving the new r3,
containing the trap instruction encoding (0x7c810808), and restoring it back
with the frame on return.  This caused it to panic on my ppc32 machine, but
somehow my ppc64 machine overlooked it, because I was using such a simple
dtrace probe.

X-MFC-with:	r259245
MFC after:	2 weeks
2013-12-15 18:07:25 +00:00
Nathan Whitehorn
d2a94a7764 Set max_lun to zero. This field is ignored unless we are manually probing
LUNs anyway, and we certainly don't want to probe 2^32 values by hand in
that case.

MFC after:	2 weeks
2013-12-15 16:58:23 +00:00
Hiroki Sato
6a67774f17 Replace Sun RPC license for TI-RPC library with a 3-clause BSD license,
with the explicit permission of Sun Microsystems in 2009.
The code in question in this file was copied from lib/libc/rpc/pmap_getport.c.
2013-12-15 16:17:00 +00:00
Nathan Whitehorn
021c5b6dd0 Bump libcam shared library version forgotten in r259397.
Submitted by:	kib
2013-12-15 15:51:05 +00:00
Joel Dahl
05f7cd8bce mdoc: sort SEE ALSO. 2013-12-15 08:52:16 +00:00
Luigi Rizzo
f9790aeb88 split netmap code according to functions:
- netmap.c		base code
- netmap_freebsd.c	FreeBSD-specific code
- netmap_generic.c	emulate netmap over standard drivers
- netmap_mbq.c		simple mbuf tailq
- netmap_mem2.c		memory management
- netmap_vale.c		VALE switch

simplify devce-specific code
2013-12-15 08:37:24 +00:00
Alfred Perlstein
c3e51c9ce1 Defer start/stop port to workqueues.
We need to do this because the Linux compat layer uses sx(9) for
mutex, however the lagg code uses rmlocks and calls into the mellanox
driver.  This causes deadlock due to sleeping while holding a rmlock.

Submitted by: Shahar Klein (shahark mellanox.com)
MFC After: 3 days.
2013-12-15 07:07:13 +00:00
Luigi Rizzo
76210de388 revise the helper functions to lookup binaries and their
shared libraries.
2013-12-15 07:04:59 +00:00
Mateusz Guzik
374ce66b66 proc exit: don't take PROC_LOCK while freeing rlimits
Code wishing to check rlimits of some process should check whether it
is exiting first, which current consumers do.

MFC after:	2 weeks
2013-12-15 04:11:43 +00:00
Glen Barber
b1e3e96568 Reduce disc1.iso size by 74MB by removing lib32 libraries, sendmail,
and atf.

MFC after:	3 days
X-MFC-To-10:	immediate (-RC2 requirement)
Sponsored by:	The FreeBSD Foundation
2013-12-14 22:41:17 +00:00
Nathan Whitehorn
e14376e4dd Avoid warning about insecure format with clang. 2013-12-14 22:28:32 +00:00
Nathan Whitehorn
92be6c51f0 Widen lun_id_t to 64 bits. This is a follow-on to r257345 to let the kernel
support all valid SAM-5 LUN IDs. CAM_VERSION is bumped, as the CAM ABI
(though not API) is changed. No behavior is changed relative to r257345
except that LUNs with non-zero high 32 bits will no longer be ignored
during device enumeration for SIMs that have set PIM_EXTLUNS.

Reviewed by:	scottl
2013-12-14 22:07:40 +00:00
Justin Hibbits
0587a07215 Add userland PMC backtracing, and use the PMC trapframe macros for kernel
backtraces.

MFC after:	1 week
2013-12-14 20:12:28 +00:00
Justin Hibbits
46cf9b63fd Rebase the PMC indices at 1, since PMC_SOFT is at 0.
MFC after:	1 week
2013-12-14 19:01:24 +00:00
Gavin Atkinson
4c631db3cc Fix several panics when initialization of an ISA or PC-CARD device fails:
o  Assign sc->an_dev in an_probe() (which isn't really a probe function in
   the standard newbus sense) as we may need it for printing errors.
o  Use device_printf() rather than if_printf() in an_reset() - this is
   called from an_probe() long before the ifp structure is initialised
   in an_attach().
o  Initialize the ifp structure early in an_attach() as we use if_printf()
   in cases where allocation of descriptors etc fails.

MFC after:	3 days
2013-12-14 18:49:59 +00:00
Navdeep Parhar
93e9cae3fa Read card capabilities after firmware initialization, instead of setting
them up as part of firmware initialization (which the driver gets to do
only if it's the master driver).

Read the range of tids available for the ETHOFLD functionality if it's
enabled.

New is_ftid() and is_etid() functions to test whether a tid falls within
the range of filter tids or ETHOFLD tids respectively.

MFC after:	2 weeks
2013-12-14 03:08:03 +00:00
Alan Somers
f0038a8e98 sbin/devd/devd.cc
Promoting the SIGINFO handler's log message from LOG_INFO to
	LOG_NOTICE, and promoting the "Processing event ..." message from
	LOG_DEBUG to LOG_INFO.  Setting the logfile to LOG_NOTICE with this
	change will have the same result as setting it to LOG_INFO without
	this change.  Setting it to LOG_INFO with this change will include
	the useful "Processing event ..." messages that were previously at
	LOG_DEBUG, without including useless messages like "Pushing table".

	The intent of this change is that one can log "Processing event ..."
	without logging "Pushing table" and related messages that are sent
	for every event.  The number of lines actually logged is reduced by
	about 75% by making this change and setting syslog to LOG_INFO vs
	setting syslog to LOG_DEBUG.

etc/syslog.conf
	Changing the recommended loglevel to notice instead of info.

Sponsored by:	Spectra Logic Corp
MFC after:	4 weeks
2013-12-13 22:58:57 +00:00
Eitan Adler
0603b75a7a getopt_long.3: wording quibbles
- Make wording more clear: "is expect" vs "is expected" [1]
- Remove extraneous trailing period..

Reported by:	dim [1]
2013-12-13 21:50:03 +00:00
Alan Somers
b026eddfea sbin/devd/devd.cc
Increase the size of devd's client socket's send buffer from the
	default (8k) to 128k.  This prevents clients from getting
	POLLHUPped during event storms.  For example, during zpool creation,
	the kernel emits a resource.fs.zfs.statechange event for every vdev
	in the pool.  A 128k buffer is large enough to hold the statechange
	events for a pool with nearly 800 drives.

Reviewed by:	ian, imp
Approved by:	ken (mentor)
Sponsored by:	Spectra Logic Corp
MFC after:	4 weeks
2013-12-13 21:49:41 +00:00
Mateusz Guzik
c2a48c0d1b rlimit: avoid unnecessary copying of rlimits
If refcount is 1 just modify rlimits in place.

MFC after:	2 weeks
2013-12-13 20:54:45 +00:00
Mateusz Guzik
3318a9c895 rlimit: add and utilize lim_shared
MFC after:	2 weeks
2013-12-13 20:53:31 +00:00
Peter Grehan
b13e60da56 bhyve(8) man page.
mdoc formatting and much input and review from Warren Block (wblock@).

Reviewed by:	many
MFC after:	3 days
2013-12-13 08:31:13 +00:00
Justin Hibbits
10b31d0b54 Some style(9) fixes
MFC after:	1 month
X-MFC with: r259284
2013-12-13 05:54:25 +00:00
Benjamin Kaduk
0782240958 Apply patch from upstream Heimdal for encoding fix
RFC 4402 specifies the implementation of the gss_pseudo_random()
function for the krb5 mechanism (and the C bindings therein).
The implementation uses a PRF+ function that concatenates the output
of individual krb5 pseudo-random operations produced with a counter
and seed.  The original implementation of this function in Heimdal
incorrectly encoded the counter as a little-endian integer, but the
RFC specifies the counter encoding as big-endian.  The implementation
initializes the counter to zero, so the first block of output (16 octets,
for the modern AES enctypes 17 and 18) is unchanged.  (RFC 4402 specifies
that the counter should begin at 1, but both existing implementations
begin with zero and it looks like the standard will be re-issued, with
test vectors, to begin at zero.)

This is upstream's commit f85652af868e64811f2b32b815d4198e7f9017f6,
from 13 October, 2013:
% Fix krb5's gss_pseudo_random() (n is big-endian)
%
% The first enctype RFC3961 prf output length's bytes are correct because
% the little- and big-endian representations of unsigned zero are the
% same.  The second block of output was wrong because the counter was not
% being encoded as big-endian.
%
% This change could break applications.  But those applications would not
% have been interoperating with other implementations anyways (in
% particular: MIT's).

Approved by:	hrs (mentor, src committer)
MFC after:	3 days
2013-12-13 03:09:29 +00:00
Justin Hibbits
4702d987cd Add PMU-based CPU frequency scaling. This method is used on most Titanium
PowerBooks.

MFC after:	1 month
2013-12-13 02:37:35 +00:00
Gleb Smirnoff
fbb49182f0 Somehow stable/10 branch contains correct version, but head doesn't. 2013-12-12 22:33:32 +00:00
Devin Teske
9ea4ca8595 I caught the following snippet at the end of my /var/log/bsdinstall_log:
===
DEBUG: Running installation step: services
local: Not in a function
/usr/libexec/bsdinstall/services: cannot create  : Read-only file system
/usr/libexec/bsdinstall/services: /tmp/bsdinstall/etc/rc.conf.services: \
 Permission denied
===
The `local: Not in a function' is obvious, and was introduced by myself in
SVN revision 256348.

The latter two are caused by the attempt to use "\" to continue the line
after using the ">>" redirect. This appears to attempt to write a file with
the name " " in the current directory and subsequently attempts to execute
the file that was originally intended for writing (which is not executable;
hence the `Permission denied'). That was introduced in SVN r228192 about
2 years ago, apparently unnoticed until I started going over the debug
outputs very carefully.

MFC after:	3 days
2013-12-12 20:47:18 +00:00
John Baldwin
eba633a62f Add a command to inject an NMI on a specific vcpu. It is a simple
wrapper around the existing vm_inject_nmi().

Reviewed by:	grehan, neel
2013-12-12 20:34:04 +00:00