200429 Commits

Author SHA1 Message Date
bapt
6a0c65530b MFC: r289878
timeout(1): fix the acceptable range values for parse_signal()

Before both 0 and sys_nsig would be successfully returned by parse_signal()
although being invalid signal numbers.

Submitted by:	Alexandre Perrin <alex@kaworu.ch>
2015-10-27 07:08:47 +00:00
vangyzen
6215f7ee31 Fix indentation in etc/rc.d/fsck. 2015-10-27 02:52:05 +00:00
delphij
da81d37a1e Revert the merge of r289269 for now as it may break non-root installs. 2015-10-27 01:28:11 +00:00
delphij
06466cc0fc MFC r289269:
Use chroot(2) instead of using prefixes for files.

Previously, the code prefixes the chroot path to actual file paths to
simulate the effect.  This, however, will not work for tzset(3) which
expects the current system have a working set of timezone data files,
and that is not always the case.

This changeset simplifies the handling of paths and use an actual
chroot(2) call to implement the effect.

PR:		bin/197313
2015-10-27 00:37:19 +00:00
bdrewery
c471bb0905 MFC r289407:
Fix delete-old and check-old-files not removing old debug symbols.
2015-10-26 17:49:13 +00:00
brueffer
58db4e065b MFC: r288419
Join excessive split lines.
2015-10-26 17:45:37 +00:00
vangyzen
e22b776118 Disable SSE in libthr
Clang emits SSE instructions on amd64 in the common path of
pthread_mutex_unlock.  If the thread does not otherwise use SSE,
this usage incurs a context-switch of the FPU/SSE state, which
reduces the performance of multiple real-world applications by a
non-trivial amount (3-5% in one application).

Instead of this change, I experimented with eagerly switching the
FPU state at context-switch time.  This did not help.  Most of the
cost seems to be in the read/write of memory--as kib@ stated--and
not in the #NM handling.  I tested on machines with and without
XSAVEOPT.

One counter-argument to this change is that most applications already
use SIMD, and the number of applications and amount of SIMD usage
are only increasing.  This is absolutely true.  I agree that--in
general and in principle--this change is in the wrong direction.
However, there are applications that do not use enough SSE to offset
the extra context-switch cost.  SSE does not provide a clear benefit
in the current libthr code with the current compiler, but it does
provide a clear loss in some cases.  Therefore, disabling SSE in
libthr is a non-loss for most, and a gain for some.

I refrained from disabling SSE in libc--as was suggested--because
I can't make the above argument for libc.  It provides a wide variety
of code; each case should be analyzed separately.

https://lists.freebsd.org/pipermail/freebsd-current/2015-March/055193.html

Suggestions from:   dim, jmg, rpaulo
Sponsored by:   Dell Inc.
2015-10-26 16:21:56 +00:00
des
582d35681a MFH (r275359, r290007): make load_rc_config's name argument optional 2015-10-26 15:20:45 +00:00
glebius
c628128773 Upgrade NTP to 4.2.8p4.
Security:	FreeBSD-SA-15:25.ntp
Security:	CVE-2015-7871
Security:	CVE-2015-7855
Security:	CVE-2015-7854
Security:	CVE-2015-7853
Security:	CVE-2015-7852
Security:	CVE-2015-7851
Security:	CVE-2015-7850
Security:	CVE-2015-7849
Security:	CVE-2015-7848
Security:	CVE-2015-7701
Security:	CVE-2015-7703
Security:	CVE-2015-7704, CVE-2015-7705
Security:	CVE-2015-7691, CVE-2015-7692, CVE-2015-7702
2015-10-26 11:35:40 +00:00
ngie
9e809ce638 MFC r289601:
Don't check if `val` is NULL before calling free; free(3) already
handles this

PR: 203649
Submitted by: Thomas Schmitt <scdbackup@gmx.net>
Coverity CID: 1305659
Sponsored by: EMC / Isilon Storage Division
2015-10-26 03:53:48 +00:00
ngie
c85e427d4b MFC r288305:
Replace N #defines with nitems to simplify ifconfig code slightly
2015-10-26 03:43:28 +00:00
ngie
bcb9cc88ea MFC r289300:
Integrate tools/regression/vfs into the FreeBSD test suite as tests/sys/vfs

Sponsored by: EMC / Isilon Storage Division
2015-10-26 03:37:01 +00:00
ngie
0df2ba1b69 MFC r264965:
r264965 (by des):

Note that the bug was fixed, and when.
2015-10-26 03:33:40 +00:00
ngie
471d0645dc MFC r282339,r282341:
r282339 (by bapt):

Add regression test about reverse line feed to col(1)

r282341 (by bapt):

Actually push the right tests
2015-10-26 03:15:06 +00:00
ngie
6be0ee955f MFC r289600:
Initialize `quiet` to false so `pw groupnext` again prints out the next gid
by default

Reported by: Florian Degner <f.degner@gmx.de>
PR: 203876
Sponsored by: EMC / Isilon Storage Division
2015-10-26 00:28:05 +00:00
ngie
5ab2a189ae MFC r288304:
Enable parallel subdirectory building with sys/modules/netgraph
2015-10-26 00:13:49 +00:00
ngie
f3970aa698 MFC r289451:
Install share/zoneinfo in a deterministic way by sorting the results from find

This helps produce deterministic METALOG output

PR: 200674
Submitted by: Fabian Keil <fk@fabiankeil.de>
Reviewed by: emaste
Obtained from: ElectroBSD
2015-10-26 00:11:07 +00:00
ngie
2d4f06f66b MFC r289450:
Set dev->fd to -1 when calling cam_close_spec_device with a valid dev->fd
descriptor to avoid trashing valid file descriptors that access dev->fd at a
later point in time

PR: 192671
Submitted by: Scott Ferris <scott.ferris@isilon.com>
Sponsored by: EMC / Isilon Storage Division
2015-10-26 00:08:40 +00:00
ngie
240202305e MFC r289332:
Fix test-fenv:test_dfl_env when run on some amd64 CPUs

Compare the fields that the AMD [1] and Intel [2] specs say will be
set once fnstenv returns.

Not all amd64 capable processors zero out the env.__x87.__other field
(example: AMD Opteron 6308). The AMD64/x64 specs aren't explicit on what the
env.__x87.__other field will contain after fnstenv is executed, so the values
in env.__x87.__other could be filled with arbitrary data depending on how the
CPU-specific implementation of fnstenv.

1. http://support.amd.com/TechDocs/26569_APM_v5.pdf
2. http://www.intel.com/Assets/en_US/PDF/manual/253666.pdf

Discussed with: kib, Anton Rang <anton.rang@isilon.com>
Reviewed by: Daniel O'Connor <darius@dons.net.au> (earlier patch; pre-generalization)
Sponsored by: EMC / Isilon Storage Division
Reported by: Bill Morchin <wmorchin@isilon.com>
2015-10-26 00:06:04 +00:00
ngie
74ca3bfeb1 MFC r289488:
Clean up trailing whitespace
2015-10-26 00:05:02 +00:00
ngie
692c6b0c3a MFC r288330,r288423,r288678,r288905,r288906,r288907,r289102:
r288330:

Add initial testcases for bin/ls

Sponsored by: EMC / Isilon Storage Division

r288423:

Skip the B_flag testcase to stop blowing up freebsd-current@ with
"test failure emails" because kyua report-jenkins doesn't properly
escape non-printable chars

r288678:

Merge additional testcases and improvements to bin/ls/ls_tests from
^/user/ngie/more-tests.

- Additional testcases added:
-- ls -D
-- ls -F
-- ls -H
-- ls -L
-- ls -R
-- ls -S
-- ls -T
-- ls -b
-- ls -d
-- ls -f
-- ls -g
-- ls -h
-- ls -i
-- ls -k
-- ls -l
-- ls -m
-- ls -n
-- ls -o
-- ls -p
-- ls -q/ls -w
-- ls -r
-- ls -s
-- ls -t
-- ls -u
-- ls -y
- Socket file creation is limited to the ls -F testcase, greatly speeding up
  the test process
- The ls -C testcase was made more robust by limiting the number of columns
  via COLUMNS and by dynamically formulating the columns/lines.
- Add `atf_test_case` before all testcase `head` functions.

Sponsored by: EMC / Isilon Storage Division

r288905:

Add some more syncs to quiesce the filesystem after creating the
files to see if this fixes deterministic Jenkin failures

r288906:

Explicitly set BLOCKSIZE to 512 in the environment

r288907:

Call sync consistently using atf_check

Remove superfluous sync's

r289102:

Remove all of the syncs

They're unnecessary as shown by further testing on my VM

Requested by: jhb
2015-10-25 23:03:04 +00:00
ngie
8d1a82393f MFC r288295,r288298:
r288295:

Posthumously remove all references to MFREE(9)

The macro was removed in r90227

Sponsored by: EMC / Isilon Storage Division

r288298:

Remove MLINKS to more non-existent mbuf(9) macros

Sponsored by: EMC / Isilon Storage Division
2015-10-25 22:55:19 +00:00
ngie
9d8d32a23a MFC r288057:
Delete /etc/autofs/special_noauto when MK_AUTOFS == no
2015-10-25 22:50:33 +00:00
ngie
2e7cb6b855 MFC r287520:
Parallelize the usr.sbin/ntp subdirectory build

Articulate all needed dependencies for the subdirectories
2015-10-25 22:44:37 +00:00
ngie
f390a5442d Regen src.conf(5) after r289959 2015-10-25 22:43:10 +00:00
ngie
73ec89f18b MFC r286822:
Reap MK_SYSINSTALL

It's no longer in use in the tree (most likely missed when sade/sysinstall
were removed)
2015-10-25 22:41:26 +00:00
ngie
ce6ce6f599 MFC r286512:
Make some debug printf's into DPRINTF's to reduce noise on attach/detahh

Similar reasoning to what was done in r286367 with geom_uzip(4)

Differential Revision: D3320
Sponsored by: EMC / Isilon Storage Division
2015-10-25 22:38:17 +00:00
ngie
73c3857204 MFC r283144:
Articulate dependencies for cddl/lib/libdtrace and cddl/lib/libzfs

Parallelize the build in this subdirectory

Sponsored by: EMC / Isilon Storage Division
2015-10-25 22:34:49 +00:00
ngie
ae16fe9482 MFC r282072,r283018:
r282072:

- Fix compilation (MAP_INHERIT's dead)
- Fix warnings
- Use mkstemp instead of tmpnam

r283018:

Fix more warnings related to missing headers
2015-10-25 22:30:45 +00:00
ngie
f54373f9f8 MFC r284405:
Remove ALLOW_DEPRECATED_ATF_TOOLS/ATFFILE support from atf.test.mk

The legacy atf tools were removed in atf 0.20
2015-10-25 22:23:04 +00:00
ngie
150ec7a9ce MFC r286367:
Make some debug printf's into DPRINTF's to reduce noise on attach/detach

Differential Revision: https://reviews.freebsd.org/D3306
Reviewed by: loos
Sponsored by: EMC / Isilon Storage Division
2015-10-25 22:21:19 +00:00
ngie
27789be2f5 MFC r286304:
Set f_file to -1/F_UNUSED when after closing when possible

This will help ensure we don't trash file descriptors that get used later on
in the daemon

Found via internal Coverity scan

Discussed with: cem, ed, markj
Differential Revision: https://reviews.freebsd.org/D3081
Submitted by: Miles Ohlrich <miles.ohlrich@isilon.com>
Sponsored by: EMC / Isilon Storage Division
2015-10-25 22:17:43 +00:00
jilles
f733542c6c MFC r288309: fnmatch(): Remove exponential behaviour as in sh r229201.
The old code was exponential in the number of asterisks in the pattern.
However, once a match has been found upto the next asterisk, the previous
asterisks are no longer relevant.
2015-10-25 21:39:23 +00:00
jilles
aff97c8f1f MFC r288430: wordexp: Rewrite to make WRDE_NOCMD reliable.
Shell syntax is too complicated to detect command substitution and unquoted
operators reliably without implementing much of sh's parser. Therefore, have
sh do this detection.

While changing sh's support anyway, also read input from a pipe instead of
arguments to avoid {ARG_MAX} limits and improve privacy, and output count
and length using 16 instead of 8 digits.

The basic concept is:
execl("/bin/sh", "sh", "-c", "freebsd_wordexp ${1:+\"$1\"} -f "$2",
    "", flags & WRDE_NOCMD ? "-p" : "", <pipe with words>);

The WRDE_BADCHAR error is still implemented in libc. POSIX requires us to
fail strings containing unquoted braces with code WRDE_BADCHAR. Since this
is normally not a syntax error in sh, there is still a need for checking
code in libc, we_check().

The new we_check() is an optimistic check that all the characters
  <newline> | & ; < > ( ) { }
are quoted. To avoid duplicating too much sh logic, such characters are
permitted when quoting characters are seen, even if the quoting characters
may themselves be quoted. This code reports all WRDE_BADCHAR errors; bad
characters that get past it and are a syntax error in sh return WRDE_SYNTAX.

Although many implementations of WRDE_NOCMD erroneously allow some command
substitutions (and ours even documented this), there appears to be code that
relies on its security (codesearch.debian.net shows quite a few uses).
Passing untrusted data to wordexp() still exposes a denial of service
possibility and a fairly large attack surface.

This is also a MFC of r286830 to reduce conflicts. I changed the code
somewhat to avoid changes from r286941; in particular, WRDE_BADVAL can still
only be returned if WRDE_UNDEF was passed.

Relnotes:	yes
Security:	fixes command execution with wordexp(untrusted, WRDE_NOCMD)
2015-10-25 17:17:50 +00:00
mav
8bb27e0d32 MFC r289146:
Make delete method set via kern.cam.da.X.delete_method persistent.

This allows to set delete method via tunable, before device capabilities
are known.  Also allow ZERO method for devices not reporting LBP, if user
explicitly requests it -- it may be useful if storage supports compression
and WRITE SAME, but does not support UNMAP.
2015-10-25 07:26:12 +00:00
avg
bef317767a MFC r261891: provide fast versions of ffsl and flsl for i386; ffsll and
flsll for amd64
2015-10-23 10:05:43 +00:00
avg
6087342130 MFC r288339: remove unused sgsmsg utility (originally imported from opensolaris) 2015-10-23 08:35:17 +00:00
avg
f04b1cd7e1 MFC r288363: std: it is important that func name is never an empty string 2015-10-23 08:15:53 +00:00
avg
b51c19847a MFC r284409: Fix circular dependency between libzfs and libzfs_core
By bapt.
2015-10-23 08:12:00 +00:00
avg
fbbd0de7f1 MFC r288340: define aok in libnvpair which is linked to all zfs
libraries that need aok
2015-10-23 08:01:46 +00:00
avg
e98221a3c3 MFC r288362: sdt: start checking version field when parsing probe definitions 2015-10-23 07:57:21 +00:00
avg
faf581f88b MFC r288337: remove an extra copy of avl.c from illumos contrib code 2015-10-23 07:48:28 +00:00
avg
40514f42db MFC r288336: save some bytes by using more concise SDT_PROBE<n> 2015-10-23 07:40:43 +00:00
avg
94c1aa3bfb MFC r288366: sdt.h: no need for argtype_list_head 2015-10-23 07:37:44 +00:00
avg
43b153c04f MFC r288365: sdt: static-ize couple of variables 2015-10-23 07:35:39 +00:00
avg
d857a9d7cc MFC r288364: sdt module does not seem to actually use any symbol from
opensolaris module
2015-10-23 07:33:43 +00:00
avg
c5b22d7565 MFC r288361: dtrace_getarg: remove stray return statement on amd64, powerpc 2015-10-23 07:31:04 +00:00
avg
2666a308ea MFC r287673: radeon_suspend_kms: don't mess with pci state 2015-10-23 07:25:14 +00:00
jhb
e25ab6846b MFC 287386,288949,288993:
Export current system call code and argument count for system call entry
and exit events.  To preserve the ABI, the new fields are moved to the
end of struct thread in these branches (unlike HEAD) and explicitly copied
when new threads are created.  In addition, the new tests are only added
in 10.

r287386:
Export current system call code and argument count for system call entry
and exit events. procfs stop events for system call tracing report these
values (argument count for system call entry and code for system call exit),
but ptrace() does not provide this information. (Note that while the system
call code can be determined in an ABI-specific manner during system call
entry, it is not generally available during system call exit.)

The values are exported via new fields at the end of struct ptrace_lwpinfo
available via PT_LWPINFO.

r288949:
Fix various edge cases related to system call tracing.
- Always set td_dbg_sc_* when P_TRACED is set on system call entry
  even if the debugger is not tracing system call entries.  This
  ensures the fields are valid when reporting other stops that
  occur at system call boundaries such as for PT_FOLLOW_FORKS or
  when only tracing system call exits.
- Set TDB_SCX when reporting the stop for a new child process in
  fork_return().  This causes the event to be reported as a system
  call exit.
- Report a system call exit event in fork_return() for new threads in
  a traced process.
- Copy td_dbg_sc_* to new threads instead of zeroing.  This ensures
  that td_dbg_sc_code in particular will report the system call that
  created the new thread or process when it reports a system call
  exit event in fork_return().
- Add new ptrace tests to verify that new child processes and threads
  report system call exit events with a valid pl_syscall_code via
  PT_LWPINFO.

r288993:
Document the recently added pl_syscall_* fields in struct ptrace_lwpinfo.
2015-10-23 01:27:44 +00:00
bapt
a372d7e311 getconf(1): Fix typo. _POSIX_V6_LP64_OFFBIG -> _POSIX_V6_LPBIG_OFFBIG.
Submitted by:	Sascha Wildner <saw@online.de>
Obtained from:	DragonflyBSD
2015-10-22 06:32:33 +00:00