200419 Commits

Author SHA1 Message Date
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
kp
d621159ed6 MFC r289316:
pf: Fix TSO issues

In certain configurations (mostly but not exclusively as a VM on Xen) pf
produced packets with an invalid TCP checksum.

The problem was that pf could only handle packets with a full checksum. The
FreeBSD IP stack produces TCP packets with a pseudo-header checksum (only
addresses, length and protocol).
Certain network interfaces expect to see the pseudo-header checksum, so they
end up producing packets with invalid checksums.

To fix this stop calculating the full checksum and teach pf to only update TCP
checksums if TSO is disabled or the change affects the pseudo-header checksum.

PR:             154428, 193579, 198868
Relnotes:       yes
Sponsored by:   RootBSD
2015-10-21 15:32:21 +00:00
bdrewery
a7e84cb353 MFC r288994:
Remove redundant RFFPWAIT/vfork(2) handling in Linux fork(2) and clone(2)
  wrappers.
2015-10-21 01:41:22 +00:00
ian
011586e8ad MFC r281828, r289083, r289084, r289091, r289093, r289095, r289097, r289098,
r289104, r289105, r289118:  various i2c fixes...

  Fix numerous issues in iic(4) and iicbus(4):
  --Allow multiple open iic fds by storing addressing state in cdevpriv
  --Fix, as much as possible, the baked-in race conditions in the iic
  ioctl interface by requesting bus ownership on I2CSTART, releasing it on
  I2CSTOP/I2CRSTCARD, and requiring bus ownership by the current cdevpriv
  to use the I/O ioctls
  --Reduce internal iic buffer size and remove 1K read/write limit by
  iteratively calling iicbus_read/iicbus_write
  --Eliminate dynamic allocation in I2CWRITE/I2CREAD
  --Move handling of I2CRDWR to separate function and improve error handling
  --Add new I2CSADDR ioctl to store address in current cdevpriv so that
  I2CSTART is not needed for read(2)/write(2) to work
  --Redesign iicbus_request_bus() and iicbus_release_bus():
      --iicbus_request_bus() no longer falls through if the bus is already
  owned by the requesting device.  Multiple threads on the same device may
  want exclusive access.  Also, iicbus_release_bus() was never
  device-recursive anyway.
      --Previously, if IICBUS_CALLBACK failed in iicbus_release_bus(), but
  the following iicbus_poll() call succeeded, IICBUS_CALLBACK would not be
  issued again
      --Do not hold iicbus mtx during IICBUS_CALLBACK call.  There are
  several drivers that may sleep in IICBUS_CALLBACK, if IIC_WAIT is passed.
      --Do not loop in iicbus_request_bus if IICBUS_CALLBACK returns
  EWOULDBLOCK; instead pass that to the caller so that it can retry if so
  desired.

  Bugfix: Exit the transfer loop if any read or write operation fails.  Also,
  perform a stop operation on the bus if there was an error, otherwise the
  bus will remain hung forever.  Consistantly use 'if (error != 0)' style in
  the function.

  Mostly rewrite the imx i2c driver.  This started out as an attempt to fix
  one specific problem: the driver didn't check for ACK/NAK after writing a
  slave address byte to the bus, and some slaves signal that they are busy
  (such as when completing an internal write to flash memory) by sending a
  NAK in response to being addressed.

  Use IIC_EBUSBSY and IIC_BUSERR status values consistantly across all drivers.
  Make it clearer what each one means in the comments that define them.

  Add iic2errno(), a helper function to translate IIC_Exxxxx status values to
  errno values that are at least vaguely equivelent.  Also add a new status
  value, IIC_ERESOURCE, to indicate a failure to acquire memory or other
  required resources to complete a transaction.

  Return only IIC_Exxxx status values from iicbus-layer functions.  Most of
  these functions are thin wrappers around calling the hardware-layer driver,
  but some of them do sanity checks and return an error.

  Add a short name, IIC_INTRWAIT, for the common case (IIC_INTR | IIC_WAIT).

  Replace a local sx lock that allowed only one client at a time to access
  an eeprom device with iicbus_request/release_bus(), which achieves the
  same effect and also keeps other i2c slave drivers from clashing on the bus.
2015-10-20 21:20:34 +00:00
bdrewery
8db7e0379c MFC r288903:
Fix crash if a process sends itself a SIGTRAP.  Just forward it as expected.

  This does not match head as the code was rewritten significantly there.

Relnotes:	yes
2015-10-20 18:35:52 +00:00
bdrewery
8124ba9df4 MFC r288477:
META_MODE: For some reason meta mode cannot generate the intermediate tab.c
  files.  Split up all of the targets to be more clear on how they are
  generated to fix the problem.
2015-10-20 18:23:14 +00:00
bdrewery
7280991d08 MFC r288429:
Replace most of the beforeinstall: hack with FILES mechanism.
2015-10-20 18:20:38 +00:00
cy
153d364641 MFC r289480. Really fix ipfilter bug 3600459.
Obtained from:	ipfilter cvs repo r1.48.2.25, r1.72 and NetBSD repo r1.4
2015-10-20 13:20:29 +00:00
gjb
1933ba006a MFC r289337:
Deprecate MD5 checksum generation in favor of SHA512.

  This was discussed during the 10.2-RELEASE cycle, however
  since we were nearing the end of the cycle, we decided to
  defer this change until after 10.2-RELEASE.

Sponsored by:	The FreeBSD Foundation
2015-10-19 00:36:54 +00:00
trasz
a8182c4d10 MFC r287785:
Make it clear that 'swapuse' is swap reservation and not actual swap usage.

Sponsored by:	The FreeBSD Foundation
2015-10-18 15:03:47 +00:00
trasz
d6b9751caa MFC r287827:
Add a way to specify stripesize and stripeoffset to gnop(8). This makes
it possible to "simulate" 4K media, to eg test alignment handling.

Sponsored by:	The FreeBSD Foundation
2015-10-18 15:02:07 +00:00