]> CyberLeo.Net >> Repos - FreeBSD/stable/10.git/log
FreeBSD/stable/10.git
8 years agoMFC r290480
bapt [Tue, 10 Nov 2015 07:17:38 +0000 (07:17 +0000)]
MFC r290480

Protecting against rm -rf / is now POSIXLY_CORRECT per posix 1003.1
edition 2013. No need anymore to disable the protection if one set
the POXILY_CORRECT environment variable.

Reviewed by: imp
Differential Revision: https://reviews.freebsd.org/D4092

git-svn-id: svn://svn.freebsd.org/base/stable/10@290634 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r290441:
hselasky [Mon, 9 Nov 2015 11:24:59 +0000 (11:24 +0000)]
MFC r290441:
Fix for unaligned IP-header.

The mbuf length fields must be set before m_adj() is called else
m_adj() will not always adjust the mbuf and an unaligned read
exception can trigger inside the network stack. This can happen on
platforms where unaligned reads are not supported. Adjust a length
check to include the 2-byte ethernet alignment while at it.

git-svn-id: svn://svn.freebsd.org/base/stable/10@290607 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r266930,r289225:
ngie [Mon, 9 Nov 2015 09:28:34 +0000 (09:28 +0000)]
MFC r266930,r289225:

r266930 (by jmg):

convert to using the _daddr_t types like newfs was...

Put the superblock in the correct possition for UFS2... There is a bug
in FFS that if we don't put it here (for UFS2), it will forcefully
relocate the superblock, and I believe cause data loss..

I have a fix for that, but w/ how many releases are broken, we won't be
able to switch to the better _FLOPPY (block 0) for this for a while..

r289225 (by sbruno):

makefs(8) leaves sblock.fs_providersize uninitialized (zero) that can be easily
checked with dumpfs(8). This may lead to other problems, f.e. geom_label kernel
module sanity checks do not like zero fs_old_size value and skips such UFS1
file system while tasting (fs_old_size derives from sblock.fs_providersize).

PR: 203704
Submitted by: eugen@grosbein.net
Reviewed by: marcel

git-svn-id: svn://svn.freebsd.org/base/stable/10@290599 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r290268:
ngie [Mon, 9 Nov 2015 09:23:35 +0000 (09:23 +0000)]
MFC r290268:

Sync minor whitespace / type changes in ffs_csum_swap and ffs_sb_swap with
src/sys/ufs/ffs/ffs_bswap.c@1.39

Obtained from: NetBSD
Sponsored by: EMC / Isilon Storage Division

git-svn-id: svn://svn.freebsd.org/base/stable/10@290597 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r290264:
ngie [Mon, 9 Nov 2015 09:22:11 +0000 (09:22 +0000)]
MFC r290264:

Limit isoLevel to 1 and 2 to avoid segfaulting when isoLevel is set to 3 by
dereferencing a NULL function pointer

Add some asserts to ensure that isolevel is always either 1 or 2.

PR: 203645
Reported by: Thomas Schmitt <scdbackup@gmx.net>
Sponsored by: EMC / Isilon Storage Division

git-svn-id: svn://svn.freebsd.org/base/stable/10@290595 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r290265,r290267,r290270:
ngie [Mon, 9 Nov 2015 09:20:01 +0000 (09:20 +0000)]
MFC r290265,r290267,r290270:

r290265:

Add testcases for -t cd9660 -o isolevel=[1-3]

-- -o isolevel=1 currently fails because of path comparison issues,
   so mark it as an expected failure.
-- -o isolevel=3 is not implemented, so expect it to fail as an out
   of bounds value [*].

PR: 203645
Sponsored by: EMC / Isilon Storage Division

r290267:

Clean up mtree keyword support a slight bit and add a few more default keywords

- Parameterize the mtree keywords as $DEFAULT_MTREE_KEYWORDS
- Test with the extra mtree keywords, `mode,gid,uid`.
- Add a note about mtrees with time support not working with makefs right now

Sponsored by: EMC / Isilon Storage Division

r290270:

Add testcases for -t ffs -o version=[12]

Verify the filesystem type using dumpfs. Add preliminary support
for NetBSD (needs to be validated)

Sponsored by: EMC / Isilon Storage Division

git-svn-id: svn://svn.freebsd.org/base/stable/10@290594 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r289902:
ngie [Mon, 9 Nov 2015 09:04:11 +0000 (09:04 +0000)]
MFC r289902:

Add a regression test for r289899 to validate rockridge encoding
of device types

Sponsored by: EMC / Isilon Storage Division

git-svn-id: svn://svn.freebsd.org/base/stable/10@290592 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r289899:
ngie [Mon, 9 Nov 2015 09:03:24 +0000 (09:03 +0000)]
MFC r289899:

Import the fix from NetBSD kern/48852 (sic) to fix rockridge encoding of
device nodes

In particular, use st_rdev (the device type), not st_dev (the device inode),
and fix the comparison to be correct with the st_rdev field

Bug 203648
Submitted by: Thomas Schmitt <scdbackup@gmx.net>
Coverity CID: 1008927
Sponsored by: EMC / Isilon Storage Division

git-svn-id: svn://svn.freebsd.org/base/stable/10@290591 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r289203,r290180:
ngie [Mon, 9 Nov 2015 08:59:55 +0000 (08:59 +0000)]
MFC r289203,r290180:

r289203 (by adrian):

makefs: introduce a new option to specify what to round the resulting
image up to.

From ticket:

While trying to run FreeBSD/mips on some device having very small flash media,
one is forced to compress file system with mkulzma(8) utility. It is desirable
to specify small UFS block/fragment sizes like 4096/512 bytes for makefs(8)
and big compression block size like 65535 bytes to mkulzma at the same time.
Then one obtains very good comression ratios (like 75% and more) but faces
the following problem.

geom_uncompress kernel module reports GEOM provider size rounded up to its
compression block size. Generally, this changes original media size and now
it fails to match the size of embedded UFS file system that leads to other
problems, f.e. geom_label kernel module does not like this and skips the
file system while tasting the GEOM and looking for UFS label.

This makes it impossible to refer to the file system using known UFS label
instead of something like /dev/map/rootfs.uncompress.

The following patch introduces new command line option "-r roundup" for makefs
that makes it round up the image to specified block size. Hence, geom_uncompress
does not change GEOM media size for images rounded that way and geom_label
accepts such GEOMs just fine.

With the patch applied, one can use following commands:

$ makefs -t ffs -r 65536 -o bsize=4096,fsize=512,label=flash optimization=space fs.img fs
$ mkulzma -s 65536 -o fs.img.ulzma fs.img

PR: bin/203707
Submitted by: <eugen@grosbein.net>

r290180:

Follow up to roundup feature addition in r289203

- Rename -r to -R to avoid the clash with makefs -r in NetBSD
- Note that -R is an FFS-specific option because it's not implemented
  in cd9660 today
- Rename the roundup variable to "roundup-size" in the manpage and help
  text for consistency with other variables.
- Bump .Dd (missed in r289203)

PR: 203707
Differential Revision: https://reviews.freebsd.org/D3959
Reviewed by: adrian (earlier patch), emaste
Sponsored by: EMC / Isilon Storage Division

git-svn-id: svn://svn.freebsd.org/base/stable/10@290589 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r289687,r289693:
ngie [Mon, 9 Nov 2015 08:03:15 +0000 (08:03 +0000)]
MFC r289687,r289693:

r289687:

Free buffer before returning from cd9660_write_path_table to avoid
leaking it after returning from the function

PR: 203647
Submitted by: Thomas Schmitt <scdbackup@gmx.net>
Coverity CID: 978431
Sponsored by: EMC / Isilon Storage Division

r289693:

Unbreak makefs -t cd9660 after r289687

buffer_head needs to be freed -- not buffer

Detected by jemalloc, i.e. running makefs failed the arena assert
because my copy of malloc on CURRENT is compiled with the default
!MALLOC_PRODUCTION asserts on

Pointyhat to: ngie
PR: 203647
Sponsored by: EMC / Isilon Storage Division

git-svn-id: svn://svn.freebsd.org/base/stable/10@290587 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r289739,r289743,r289897,r289901:
ngie [Mon, 9 Nov 2015 07:56:06 +0000 (07:56 +0000)]
MFC r289739,r289743,r289897,r289901:

r289739:

Correctly reintroduce the rudimentary smoke tests I botched up
in r289684

Sponsored by: EMC / Isilon Storage Division

r289743:

Revise "create_test_inputs" to simplify the file structure as
these testcases don't need to be nested as much as bin/ls/ls_tests.sh
do when verifying ls -a, ls -A, etc. This allows the tests to make
all paths relative to the top of the temporary directory instead of
always tacking on $ATF_TMPDIR, thus complicating things unnecessarily

Create non-empty files in create_test_inputs as well now, similar to
create_test_inputs2 in bin/ls/ls_tests.sh

Compare the input files to the output file contents using diff where
possible:
- Skip over the fifo comparison for now because it always fails
- Skip over the symlink comparison on cd9660 because it always fails
  today

Sponsored by: EMC / Isilon Storage Division

r289897:

Add more cd9660/FFS makefs testcases

General changes:
- Parameterize out the mount command.
- Use mtree to verify the contents of an image (check_image_contents) instead
  of using diff (diff verifies content, but not file metadata).
- Move common logic out to functions (common_cleanup, mount_image,
  check_image_contents)
- Add stub testcases for makefs -D (crashes with SIGBUS, similar to bug # 192839)
- Add a note about the ISO-9660 and rockridge specs
- Add testcases that exercise:
-- Creating disk images from an mtree and multiple directories.
-- -F flag use (not really an extensive testcase right now)

cd9660-specific test changes:

- Remove an XXX comment about symlinks; I forgot that non-rockridge images turn
  symlinks into hardlinks.
- Add testcases that exercise:
-- -o allow-deep-trees
-- -o allow-max-name stub testcase (doesn't seem to be implemented in makefs)
-- -o preparer (existence in image; not conformance to spec)
-- -o publisher (existence in image; not conformance to spec)
-- -o rockridge (basic)

Sponsored by: EMC / Isilon Storage Division

r289901:

Remove an ls -l I was using for debugging

Sponsored by: EMC / Isilon Storage Division

git-svn-id: svn://svn.freebsd.org/base/stable/10@290586 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r289441:
ngie [Mon, 9 Nov 2015 07:49:39 +0000 (07:49 +0000)]
MFC r289441:

Integrate tools/test/posixshm and tools/regression/posixshm into the FreeBSD
test suite as tests/sys/posixshm

Some other highlights:
- Convert the testcases over to ATF
- Don't use hardcoded paths to /tmp (which violate the ATF/kyua samdbox); use
  mkstemp to generate temporary paths for non-SHM_ANON shm objects.

Sponsored by: EMC / Isilon Storage Division

git-svn-id: svn://svn.freebsd.org/base/stable/10@290585 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r290177:
ngie [Mon, 9 Nov 2015 07:41:28 +0000 (07:41 +0000)]
MFC r290177:

Integrate contrib/netbsd-tests/lib/libc/rpc into the FreeBSD test suite
as lib/libc/rpc

This testcase requires rpcbind be up in running; otherwise the testcases
will time out and be skipped

Sponsored by: EMC / Isilon Storage Division

git-svn-id: svn://svn.freebsd.org/base/stable/10@290584 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r290179:
ngie [Mon, 9 Nov 2015 07:34:30 +0000 (07:34 +0000)]
MFC r290179:

Remove a set but unused variable in __getgroupmembership to fix a gcc 4.9+ warning

Sponsored by: EMC / Isilon Storage Division

git-svn-id: svn://svn.freebsd.org/base/stable/10@290582 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r290190,r290251:
ngie [Mon, 9 Nov 2015 07:26:34 +0000 (07:26 +0000)]
MFC r290190,r290251:

r290190:

Fix compiler warnings with open_to_operation.c

Other sidenotes:
- Remove unused variables with main(..)
- Convert errx/exit with -1 to errx/exit with 1
- Fix a bogus test in try_directory_open
  (expected_errno == expected_errno -> errno == expected_errno) [*]
- Fix some warnings related to discarded qualifiers
- Remove a bogus else-statement at the end of check_mmap_exec(..) in the
  successful case. mmap(2), POSIX, Linux, etc all don't state what the
  behavior is when mixing O_WRONLY + PROT_EXEC, so assume success for now to
  get the test program to pass again.

PR: 201286 [*]
Submitted by: David Binderman <dcb314@hotmail.com>
Sponsored by: EMC / Isilon Storage Division

r290251:

Use nitems(x) instead of sizeof(x)/sizeof(x[0])

Sponsored by: EMC / Isilon Storage Division

git-svn-id: svn://svn.freebsd.org/base/stable/10@290580 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r289903:
ngie [Mon, 9 Nov 2015 07:18:09 +0000 (07:18 +0000)]
MFC r289903:

Add libvmmapi to OptionalObsoleteFiles.inc when MK_BHYVE == no

Sponsored by: EMC / Isilon Storage Division

git-svn-id: svn://svn.freebsd.org/base/stable/10@290579 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r290184:
ngie [Mon, 9 Nov 2015 07:16:17 +0000 (07:16 +0000)]
MFC r290184:

Fix a set but not used variable warning flagged by gcc 4.9 with
lib/libc/ssp/h_readlink

Sponsored by: EMC / Isilon Storage Division

git-svn-id: svn://svn.freebsd.org/base/stable/10@290578 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r290182:
ngie [Mon, 9 Nov 2015 07:07:25 +0000 (07:07 +0000)]
MFC r290182:

Fix rtsold's usage message

- Remove -a from the usage message example dealing with specific
  interfaces. -a only makes sense when not specifying an interface,
  such that it's to be run on all interfaces
- Fix the pidfile option (it's -p, not -P)
- Change `interfaces` to `interface` to match the manpage

PR: 173744
Sponsored by: EMC / Isilon Storage Division

git-svn-id: svn://svn.freebsd.org/base/stable/10@290576 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r290178:
ngie [Mon, 9 Nov 2015 06:55:04 +0000 (06:55 +0000)]
MFC r290178:

Fix GOST engine cipher linkage by adding e_gost_err.c to SRCS so it
picks up undefined symbols, like "ERR_load_GOST_strings"

PR: 184805
Submitted by: Ivan IvanZhdanov <ivan.zhdanov@gmail.com>
Sponsored by: EMC / Isilon Storage Division

git-svn-id: svn://svn.freebsd.org/base/stable/10@290575 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r289487:
ngie [Mon, 9 Nov 2015 06:50:42 +0000 (06:50 +0000)]
MFC r289487:

Integrate contrib/netbsd-tests/bin/dd into the FreeBSD test suite as
bin/dd/tests

Ensure fdescfs is mounted on /dev/fd/ for the length testcase as it's used
in validating the characters read from /dev/zero

Sponsored by: EMC / Isilon Storage Division

git-svn-id: svn://svn.freebsd.org/base/stable/10@290574 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r290024,290073:
delphij [Mon, 9 Nov 2015 01:53:54 +0000 (01:53 +0000)]
MFC r290024,290073:

In gunzip(1), treat trailing garbage as a warning and not an error.  This
allows scripts to distinguish it between real fatal errors, for instance a
CRC mismatch.

Update manual page for the behavior change.

PR: bin/203873
Submitted by: Eugene Grosbein <eugen grosbein net>

git-svn-id: svn://svn.freebsd.org/base/stable/10@290569 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC: r290329,r290336
ache [Sun, 8 Nov 2015 14:22:57 +0000 (14:22 +0000)]
MFC: r290329,r290336
PR: 204230

r290329:

Use meaningful errno for ssize_t overflow in read().
Catch size_t overflow in malloc().

r290336:

Check for (old|new)size + 1 overflows off_t.

git-svn-id: svn://svn.freebsd.org/base/stable/10@290546 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC: r289863,r289931,r290110,r290230,r290231,r290232
ache [Sun, 8 Nov 2015 13:37:16 +0000 (13:37 +0000)]
MFC:  r289863,r289931,r290110,r290230,r290231,r290232

r290232:

Microoptimize.

r290231:

Addition to prev. commit.
In some edge cases fp->_p can be changed in _sseek(), recalculate.

r290230:

Don't seek to the end if write buffer is empty (in append modes).
PR:     204156

r290110:

Add _flags2 per jhb@ suggestion since no room left in _flags.
Rewrite O_APPEND flag checking using new __S2OAP flag.

r289931:

According to POSIX, a write operation shall start at the current size of
the stream (if mode had 'a' as the first character).

r289863:

Since no room left in the _flags, reuse __SALC for O_APPEND.
It helps to remove _fcntl() call from _ftello() and optimize seek position
calculation in _swrite().

git-svn-id: svn://svn.freebsd.org/base/stable/10@290544 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC 289636:
jhb [Fri, 6 Nov 2015 20:10:54 +0000 (20:10 +0000)]
MFC 289636:
Switch pl_child_pid from int to pid_t.

git-svn-id: svn://svn.freebsd.org/base/stable/10@290464 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC 288902:
jhb [Fri, 6 Nov 2015 16:57:23 +0000 (16:57 +0000)]
MFC 288902:
Include additional info in ptrace(2) KTR traces:
- The new PC value and signal passed to PT_CONTINUE, PT_DETACH, PT_SYSCALL,
  and PT_TO_SC[EX].
- The system call code returned via PT_LWPINFO.

git-svn-id: svn://svn.freebsd.org/base/stable/10@290456 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC 288452,289719:
jhb [Fri, 6 Nov 2015 16:48:33 +0000 (16:48 +0000)]
MFC 288452,289719:

288452:
Most error cases in i915_gem_do_execbuffer() jump to one of two labels to
release resources (such as unholding pages) when errors occur.  Some
recently added error checks return immediately instead of jumping to a
label resulting in leaks.  Fix these to jump to a label to do cleanup
instead.

Note that stable/9 does not have the "recently added" error checks, but
it does have some older error checks (that were are no longer present
in stable/10 and head) that have the same bug and this fixes those
instead.

289719:
i915_gem_do_execbuffer() holds the pages backing each relocation region for
various reasons while executing user commands.  After these commands are
completed, the pages backing the relocation regions are unheld.

Since relocation regions do not have to be page aligned, the code in
validate_exec_list() allocates 2 extra page pointers in the array of
held pages populated by vm_fault_quick_hold_pages().  However, the cleanup
code that unheld the pages always assumed that only the buffer size /
PAGE_SIZE pages were used.  This meant that non-page aligned buffers would
not unheld the last 1 or 2 pages in the list.  Fix this by saving the
number of held pages returned by vm_fault_quick_hold_pages() for each
relocation region and using this count during cleanup.

git-svn-id: svn://svn.freebsd.org/base/stable/10@290454 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r290195:
hselasky [Fri, 6 Nov 2015 13:34:55 +0000 (13:34 +0000)]
MFC r290195:
Reduce the DWC OTG interrupt load by not reading all the host channel
status registers for every interrupt. Check a common host channel
status interrupt register first, then conditionally read the
individual host channel status registers.

git-svn-id: svn://svn.freebsd.org/base/stable/10@290443 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC 288371:
jhb [Thu, 5 Nov 2015 21:22:23 +0000 (21:22 +0000)]
MFC 288371:
When XSAVE support was added on amd64, the FPU save area was moved
out of 'struct pcb' and into a variable-sized region after the
structure.  The kgdb code currently only reads the pcb.  It does not
read in the FPU save area but instead passes stack garbage as the
FPU's saved context.  Fixing this would mean determining the proper
size of the area and fetching it.  However, this state is not saved
for running CPUs in stoppcbs[], so the callback would also have to
know to ignore those pcbs.  Instead, just remove the call since it is
of limited usefulness.  It results in kgdb reporting the state of the
FPU/SIMD registers in userland, not their current values in the kernel.
In particular, it does not report the correct state for any code in
the kernel which does use the FPU and would report incorrect values
in that case.

git-svn-id: svn://svn.freebsd.org/base/stable/10@290413 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC 288372:
jhb [Thu, 5 Nov 2015 20:21:43 +0000 (20:21 +0000)]
MFC 288372:
Use EFI page size constants instead of hardcoding 4096.

git-svn-id: svn://svn.freebsd.org/base/stable/10@290411 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC 287934:
jhb [Thu, 5 Nov 2015 19:55:45 +0000 (19:55 +0000)]
MFC 287934:
The EFI boot loader allocates a single chunk of contiguous memory to
hold the kernel, modules, and any other loaded data.  This memory block
is relocated to the kernel's expected location during the transfer of
control from the loader to the kernel.

The GENERIC kernel on amd64 has recently grown such that a kernel + zfs.ko
no longer fits in the default staging size.  Bump the default size from
32MB to 48MB to provide more breathing room.

PR: 201679

git-svn-id: svn://svn.freebsd.org/base/stable/10@290410 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r276450
smh [Thu, 5 Nov 2015 17:19:08 +0000 (17:19 +0000)]
MFC r276450

Correct zpool list displaying invalid EXPANDSZ for unavailable pool vdevs

Sponsored by: Multiplay

git-svn-id: svn://svn.freebsd.org/base/stable/10@290402 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r273118 (by mjg)
smh [Thu, 5 Nov 2015 16:50:09 +0000 (16:50 +0000)]
MFC r273118 (by mjg)

Don't take devmtx unnecessarily in vn_isdisk.

Sponsored by: Multiplay

git-svn-id: svn://svn.freebsd.org/base/stable/10@290396 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r289637
emax [Thu, 5 Nov 2015 16:08:38 +0000 (16:08 +0000)]
MFC r289637

check boundaries while parsing SDP responses

Reported by: hps
Reviewed by: hps

git-svn-id: svn://svn.freebsd.org/base/stable/10@290395 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r289746:
ngie [Thu, 5 Nov 2015 08:27:45 +0000 (08:27 +0000)]
MFC r289746:

Exit with a user-friendly message instead of tripping an assert
if vm_activate_cpu(..) fails when called from fbsdrun_addcpu(..)

PR: 203884
Reviewed by: grehan
Submitted by: William Orr <will@worrbase.com>

git-svn-id: svn://svn.freebsd.org/base/stable/10@290386 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r289913,r289916:
ngie [Thu, 5 Nov 2015 07:48:48 +0000 (07:48 +0000)]
MFC r289913,r289916:

r289913:

Use 't' (bits) not 'i' (bytes) for describing MRIE (aka
"Method of Reporting Informational Exceptions") in the SCSI mode database as
the field described in X3T10/94-190 (revision 4; page 2, table 1) [1.] is
4 bits wide, not 4 bytes wide

1. http://ftp.t10.org/ftp/t10/document.94/94-190r4.pdf

Bug 200619
Reported by: Michael Baptist <mbaptist@isilon.com>
Submitted by: Lars Skodje <lskodje@isilon.com>
Sponsored by: EMC / Isilon Storage Division

r289916:

Limit RESOLUTION_MAX to INT_MAX, not UINT_MAX (all spelled out) so the
mode value isn't always clipped to -1 when (resolution * size) == 32, which
would have been the case with values => {4i,32b,32t}.

This seems to have been broken in r64382.

PR: 200619
Reported by: Michael Baptist
Submitted by: Lars Skodje
Sponsored by: EMC / Isilon Storage Division

git-svn-id: svn://svn.freebsd.org/base/stable/10@290385 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r290116:
ae [Wed, 4 Nov 2015 10:42:51 +0000 (10:42 +0000)]
MFC r290116:
  Check the size of data available in mbuf before using it.

  PR: 202667

git-svn-id: svn://svn.freebsd.org/base/stable/10@290360 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r288600:
hrs [Wed, 4 Nov 2015 01:00:42 +0000 (01:00 +0000)]
MFC r288600:

  - Schedule DAD for IN6_IFF_TENTATIVE addresses in nd6_timer().  This
    catches cases that DAD probes cannot be sent because of
    IFF_UP && !IFF_DRV_RUNNING.

  - nd6_dad_starttimer() now calls nd6_dad_ns_output(), instead of
    calling it before nd6_dad_starttimer().

  - Do not release an entry in dadq when a duplicate entry is being
    added.

git-svn-id: svn://svn.freebsd.org/base/stable/10@290348 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r288575:
hrs [Wed, 4 Nov 2015 00:21:02 +0000 (00:21 +0000)]
MFC r288575:

 Add IFCAP_LINKSTATE support.

git-svn-id: svn://svn.freebsd.org/base/stable/10@290347 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r285914, r289029 and r289560:
hselasky [Tue, 3 Nov 2015 10:24:54 +0000 (10:24 +0000)]
MFC r285914, r289029 and r289560:
- Move the remainder of host controller capability registers reading from
  xhci_start_controller() to xhci_init(). These values don't change at run-
  time so there's no point of acquiring them on every USB_HW_POWER_RESUME
  instead of only once during initialization. In r276717, reading the first
  couple of registers in question already had been moved as a prerequisite
  for the changes in that revision.
- Identify ASMedia ASM1042A controllers.
- Use NULL instead of 0 for pointers.
- Add quirks for USB 3.0 PCI devices.

PR: 203650

git-svn-id: svn://svn.freebsd.org/base/stable/10@290331 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r289661:
kib [Tue, 3 Nov 2015 08:33:24 +0000 (08:33 +0000)]
MFC r289661:
Mark struct thread zone as type-stable, to prevent dereference of the
freed memory in the locks spin loops.

git-svn-id: svn://svn.freebsd.org/base/stable/10@290325 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r289660,r289664:
kib [Tue, 3 Nov 2015 08:31:01 +0000 (08:31 +0000)]
MFC r289660,r289664:
Do not allow to execute ptrace(PT_TRACE_ME) when the process is
already traced or when there is no parent which can trace the process.

git-svn-id: svn://svn.freebsd.org/base/stable/10@290324 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r289658:
kib [Tue, 3 Nov 2015 08:28:47 +0000 (08:28 +0000)]
MFC r289658:
No need to dereference struct proc to pids when comparing processes
for equality.

git-svn-id: svn://svn.freebsd.org/base/stable/10@290323 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r287413: Minor code cleanups (no functional changes).
dteske [Mon, 2 Nov 2015 22:56:10 +0000 (22:56 +0000)]
MFC r287413: Minor code cleanups (no functional changes).

git-svn-id: svn://svn.freebsd.org/base/stable/10@290312 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r287390: Bump version for altered long-opts processing
dteske [Mon, 2 Nov 2015 22:55:25 +0000 (22:55 +0000)]
MFC r287390: Bump version for altered long-opts processing

git-svn-id: svn://svn.freebsd.org/base/stable/10@290311 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r287389: Simplify long-option processing
dteske [Mon, 2 Nov 2015 22:54:45 +0000 (22:54 +0000)]
MFC r287389: Simplify long-option processing

git-svn-id: svn://svn.freebsd.org/base/stable/10@290310 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r287385: Bump version for prior fix (SVN r287381)
dteske [Mon, 2 Nov 2015 22:42:07 +0000 (22:42 +0000)]
MFC r287385: Bump version for prior fix (SVN r287381)

git-svn-id: svn://svn.freebsd.org/base/stable/10@290308 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r287384:
dteske [Mon, 2 Nov 2015 22:37:56 +0000 (22:37 +0000)]
MFC r287384:
 Style: Remove whitespace around brackets from function syntax options

git-svn-id: svn://svn.freebsd.org/base/stable/10@290307 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r287383: Comment for escape() function.
dteske [Mon, 2 Nov 2015 22:35:48 +0000 (22:35 +0000)]
MFC r287383: Comment for escape() function.

git-svn-id: svn://svn.freebsd.org/base/stable/10@290306 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r287382: Comment
dteske [Mon, 2 Nov 2015 22:33:34 +0000 (22:33 +0000)]
MFC r287382: Comment

git-svn-id: svn://svn.freebsd.org/base/stable/10@290305 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r287381: Properly escape arguments when moving into jail or chroot
dteske [Mon, 2 Nov 2015 22:32:59 +0000 (22:32 +0000)]
MFC r287381: Properly escape arguments when moving into jail or chroot

git-svn-id: svn://svn.freebsd.org/base/stable/10@290304 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r287380: Style: comments
dteske [Mon, 2 Nov 2015 22:32:13 +0000 (22:32 +0000)]
MFC r287380: Style: comments

git-svn-id: svn://svn.freebsd.org/base/stable/10@290303 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r287379: Style consistency: add single space before each `;;' case entry
dteske [Mon, 2 Nov 2015 22:31:32 +0000 (22:31 +0000)]
MFC r287379: Style consistency: add single space before each `;;' case entry

git-svn-id: svn://svn.freebsd.org/base/stable/10@290302 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r287378:
dteske [Mon, 2 Nov 2015 22:30:55 +0000 (22:30 +0000)]
MFC r287378:
 Remove `SYSRC_' prefix from $SYSRC_VERBOSE (prefix unnecessary since
 this is a non-inheritable attribute; was previously).

git-svn-id: svn://svn.freebsd.org/base/stable/10@290301 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r287421: Fix mandoc(1) "WARNING: end of line whitespace"
dteske [Mon, 2 Nov 2015 22:24:57 +0000 (22:24 +0000)]
MFC r287421: Fix mandoc(1) "WARNING: end of line whitespace"

git-svn-id: svn://svn.freebsd.org/base/stable/10@290300 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoSnap to breuffer's r286660 (incorrectly merged)
dteske [Mon, 2 Nov 2015 22:22:48 +0000 (22:22 +0000)]
Snap to breuffer's r286660 (incorrectly merged)

git-svn-id: svn://svn.freebsd.org/base/stable/10@290299 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r287420: Remove non-functional examples.
dteske [Mon, 2 Nov 2015 22:12:51 +0000 (22:12 +0000)]
MFC r287420: Remove non-functional examples.

git-svn-id: svn://svn.freebsd.org/base/stable/10@290297 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r287683: Ignore error results from newaliases(1)
dteske [Mon, 2 Nov 2015 22:11:19 +0000 (22:11 +0000)]
MFC r287683: Ignore error results from newaliases(1)

git-svn-id: svn://svn.freebsd.org/base/stable/10@290296 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r287685: Remove use of return outside of function
dteske [Mon, 2 Nov 2015 22:10:39 +0000 (22:10 +0000)]
MFC r287685: Remove use of return outside of function

git-svn-id: svn://svn.freebsd.org/base/stable/10@290295 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r287686: Produce meaningful exit code
dteske [Mon, 2 Nov 2015 22:09:43 +0000 (22:09 +0000)]
MFC r287686: Produce meaningful exit code

git-svn-id: svn://svn.freebsd.org/base/stable/10@290294 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r287687: Update copyrights
dteske [Mon, 2 Nov 2015 22:08:59 +0000 (22:08 +0000)]
MFC r287687: Update copyrights

git-svn-id: svn://svn.freebsd.org/base/stable/10@290293 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r287688: Explicitly exit with success
dteske [Mon, 2 Nov 2015 22:08:11 +0000 (22:08 +0000)]
MFC r287688: Explicitly exit with success

git-svn-id: svn://svn.freebsd.org/base/stable/10@290292 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r287689: Explicitly exit with success
dteske [Mon, 2 Nov 2015 22:07:25 +0000 (22:07 +0000)]
MFC r287689: Explicitly exit with success

git-svn-id: svn://svn.freebsd.org/base/stable/10@290291 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r287690: Produce meaningful exit code
dteske [Mon, 2 Nov 2015 22:06:44 +0000 (22:06 +0000)]
MFC r287690: Produce meaningful exit code

git-svn-id: svn://svn.freebsd.org/base/stable/10@290290 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r287691: Remove trailing newline at EOF
dteske [Mon, 2 Nov 2015 22:05:41 +0000 (22:05 +0000)]
MFC r287691: Remove trailing newline at EOF

git-svn-id: svn://svn.freebsd.org/base/stable/10@290289 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r287694: Use a variable for readability
dteske [Mon, 2 Nov 2015 22:05:04 +0000 (22:05 +0000)]
MFC r287694: Use a variable for readability

git-svn-id: svn://svn.freebsd.org/base/stable/10@290288 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r287695: Replace `return' outside of function with exit
dteske [Mon, 2 Nov 2015 22:04:22 +0000 (22:04 +0000)]
MFC r287695: Replace `return' outside of function with exit

Pointy hat to: me

git-svn-id: svn://svn.freebsd.org/base/stable/10@290287 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r287692: Better to reset trap and explicitly exit success
dteske [Mon, 2 Nov 2015 22:03:24 +0000 (22:03 +0000)]
MFC r287692: Better to reset trap and explicitly exit success

git-svn-id: svn://svn.freebsd.org/base/stable/10@290286 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r287693: Update copyright
dteske [Mon, 2 Nov 2015 22:02:35 +0000 (22:02 +0000)]
MFC r287693: Update copyright

git-svn-id: svn://svn.freebsd.org/base/stable/10@290285 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r287803: Fix code typo (no functional change)
dteske [Mon, 2 Nov 2015 22:01:19 +0000 (22:01 +0000)]
MFC r287803: Fix code typo (no functional change)

git-svn-id: svn://svn.freebsd.org/base/stable/10@290284 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r287635: Fix argument quoting and remove unnecessary braces
dteske [Mon, 2 Nov 2015 21:58:19 +0000 (21:58 +0000)]
MFC r287635: Fix argument quoting and remove unnecessary braces

git-svn-id: svn://svn.freebsd.org/base/stable/10@290283 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r287696:
dteske [Mon, 2 Nov 2015 21:46:58 +0000 (21:46 +0000)]
MFC r287696:
 The <arch>/mkisoimages.sh script in release knows how to add
 extra bits from an "xtra-bits-dir". This feature is unusable
 from release/Makefile. Add an XTRADIR setting to use it.
MFC r287697: Whitespace alignment

Differential Revision: https://reviews.freebsd.org/D3633
Reviewed by: kmacy
Relnotes: yes

git-svn-id: svn://svn.freebsd.org/base/stable/10@290282 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r289790: dpv(3) merged to stable/10 before release/10.2.0
dteske [Mon, 2 Nov 2015 21:39:46 +0000 (21:39 +0000)]
MFC r289790: dpv(3) merged to stable/10 before release/10.2.0

git-svn-id: svn://svn.freebsd.org/base/stable/10@290281 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r289793: Bump date/copyright after correcting HISTORY
dteske [Mon, 2 Nov 2015 21:34:39 +0000 (21:34 +0000)]
MFC r289793: Bump date/copyright after correcting HISTORY

git-svn-id: svn://svn.freebsd.org/base/stable/10@290280 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r289794: figpar(3) merged to stable/10 before release/10.2.0
dteske [Mon, 2 Nov 2015 21:33:36 +0000 (21:33 +0000)]
MFC r289794: figpar(3) merged to stable/10 before release/10.2.0

git-svn-id: svn://svn.freebsd.org/base/stable/10@290279 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r290163: Ignore per-mdN settings in mdconfig[2] startup
dteske [Mon, 2 Nov 2015 21:26:10 +0000 (21:26 +0000)]
MFC r290163: Ignore per-mdN settings in mdconfig[2] startup

PR: base/189696
Submitted by: ganael.laplanche@martymac.org

git-svn-id: svn://svn.freebsd.org/base/stable/10@290277 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC: r290121
jkim [Mon, 2 Nov 2015 17:41:15 +0000 (17:41 +0000)]
MFC: r290121

Define endianness for non-x86 platforms.

git-svn-id: svn://svn.freebsd.org/base/stable/10@290274 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r289496:
kib [Mon, 2 Nov 2015 13:14:27 +0000 (13:14 +0000)]
MFC r289496:
Modify the 'unchanged' calculation bu dereferencing the marker tailq
pointers, which is known to belong to the queue.

git-svn-id: svn://svn.freebsd.org/base/stable/10@290271 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r289229:
ngie [Sun, 1 Nov 2015 22:27:40 +0000 (22:27 +0000)]
MFC r289229:

Replace references to /dev/acd0 with /dev/cd0

atapicd(4) was replaced by cd(4) with the atacam work done by
mav@ and then removed in r249083

X-MFC to: stable/10

git-svn-id: svn://svn.freebsd.org/base/stable/10@290246 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC: 289879
bapt [Sat, 31 Oct 2015 09:32:39 +0000 (09:32 +0000)]
MFC: 289879

newsyslog.conf: allow to configure the signal using the signal name.

Submitted by: Alexandre Perrin <alex@kaworu.ch>
Relnotes: yes
Differential Revision: https://reviews.freebsd.org/D3961

git-svn-id: svn://svn.freebsd.org/base/stable/10@290225 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoLong-overdue MFC of r280930:
wollman [Fri, 30 Oct 2015 19:26:55 +0000 (19:26 +0000)]
Long-overdue MFC of r280930:

  Fix overflow bugs in and remove obsolete limit from kernel RPC
  implementation.

  The kernel RPC code, which is responsible for the low-level scheduling
  of incoming NFS requests, contains a throttling mechanism that
  prevents too much kernel memory from being tied up by NFS requests
  that are being serviced.  When the throttle is engaged, the RPC layer
  stops servicing incoming NFS sockets, resulting ultimately in
  backpressure on the clients (if they're using TCP).  However, this is
  a very heavy-handed mechanism as it prevents all clients from making
  any requests, regardless of how heavy or light they are.  (Thus, when
  engaged, the throttle often prevents clients from even mounting the
  filesystem.)  The throttle mechanism applies specifically to requests
  that have been received by the RPC layer (from a TCP or UDP socket)
  and are queued waiting to be serviced by one of the nfsd threads; it
  does not limit the amount of backlog in the socket buffers.

  The original implementation limited the total bytes of queued requests
  to the minimum of a quarter of (nmbclusters * MCLBYTES) and 45 MiB.
  The former limit seems reasonable, since requests queued in the socket
  buffers and replies being constructed to the requests in progress will
  all require some amount of network memory, but the 45 MiB limit is
  plainly ridiculous for modern memory sizes: when running 256 service
  threads on a busy server, 45 MiB would result in just a single
  maximum-sized NFS3PROC_WRITE queued per thread before throttling.

  Removing this limit exposed integer-overflow bugs in the original
  computation, and related bugs in the routines that actually account
  for the amount of traffic enqueued for service threads.  The old
  implementation also attempted to reduce accounting overhead by
  batching updates until each queue is fully drained, but this is prone
  to livelock, resulting in repeated accumulate-throttle-drain cycles on
  a busy server.  Various data types are changed to long or unsigned
  long; explicit 64-bit types are not used due to the unavailability of
  64-bit atomics on many 32-bit platforms, but those platforms also
  cannot support nmbclusters large enough to cause overflow.

  This code (in a 10.1 kernel) is presently running on production NFS
  servers at CSAIL.

  Summary of this revision:
  * Removes 45 MiB limit on requests queued for nfsd service threads
  * Fixes integer-overflow and signedness bugs
  * Avoids unnecessary throttling by not deferring accounting for
    completed requests

Differential Revision: https://reviews.freebsd.org/D2165
Reviewed by: rmacklem, mav
Relnotes: yes
Sponsored by: MIT Computer Science & Artificial Intelligence Laboratory

git-svn-id: svn://svn.freebsd.org/base/stable/10@290203 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r289824:
kib [Fri, 30 Oct 2015 10:02:57 +0000 (10:02 +0000)]
MFC r289824:
Add CLFLUSHOPT instruction wrappers.

MFC r290188:
Fix prefix on i386.

git-svn-id: svn://svn.freebsd.org/base/stable/10@290189 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r289823:
kib [Fri, 30 Oct 2015 09:24:16 +0000 (09:24 +0000)]
MFC r289823:
Decode new values for CPUID leaf 2 cache and TLB descriptors, from the
Intel SDM revision 56.

git-svn-id: svn://svn.freebsd.org/base/stable/10@290187 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r289819: Fix LUN disable in CAM broken at r285155.
mav [Fri, 30 Oct 2015 00:30:00 +0000 (00:30 +0000)]
MFC r289819: Fix LUN disable in CAM broken at r285155.

git-svn-id: svn://svn.freebsd.org/base/stable/10@290172 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r287453,287454,288143:
delphij [Thu, 29 Oct 2015 17:51:48 +0000 (17:51 +0000)]
MFC r287453,287454,288143:

file 5.25.

Relnotes: yes

git-svn-id: svn://svn.freebsd.org/base/stable/10@290152 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r289038,r289041:
delphij [Thu, 29 Oct 2015 17:00:51 +0000 (17:00 +0000)]
MFC r289038,r289041:

Add encoding for mime-types.

Fix short month names and replace %b with %_m in date_fmt for Chinese
locales.

When using a Chinese locale, such as zh_TW.UTF-8 or zh_CN.UTF-8,
nl_langinfo(ABMON_*) only returned numbers.  For instance,
nl_langinfo(ABMON_1) returns 1, nl_langinfo(ABMON_2) returns 2, and
so on.

This causes problems in applications that put the short month name
and the day of the month together.  For example, 'Apr 14' in English
becomes '414日' in Chinese on the top bar of GNOME Shell.

This problem may be resolved by appending '月' to all short month
names and replacing %b with %_m in date_fmt. ja_JP.UTF-8 already
does this, and this matches the en_US.ISO8859-1 behavior, which
returns 'Oct'.  The GNU C Library also returns values with '月'
appended.

PR: 199441
Submitted by: Ting-Wei Lan <lantw44 gmail com>

git-svn-id: svn://svn.freebsd.org/base/stable/10@290150 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r288963:
delphij [Thu, 29 Oct 2015 16:53:34 +0000 (16:53 +0000)]
MFC r288963:

Now that we own the code, use arc4random(3) unconditionally
and remove the corresponding HAVE_ARC4RANDOM conditions.

git-svn-id: svn://svn.freebsd.org/base/stable/10@290149 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r288960:
delphij [Thu, 29 Oct 2015 16:45:06 +0000 (16:45 +0000)]
MFC r288960:

Use strlcpy() when the string is expected to be nul-terminated.

git-svn-id: svn://svn.freebsd.org/base/stable/10@290146 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r288959:
delphij [Thu, 29 Oct 2015 16:34:55 +0000 (16:34 +0000)]
MFC r288959:

Remove a few unused headers.

git-svn-id: svn://svn.freebsd.org/base/stable/10@290145 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r290004: Don't try to replicate mode pages not present on this device.
mav [Thu, 29 Oct 2015 09:08:04 +0000 (09:08 +0000)]
MFC r290004: Don't try to replicate mode pages not present on this device.

git-svn-id: svn://svn.freebsd.org/base/stable/10@290137 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r289293
hiren [Thu, 29 Oct 2015 00:36:10 +0000 (00:36 +0000)]
MFC r289293

Fix an unnecessarily aggressive behavior where mtu clamping begins on first
retransmission timeout (rto) when blackhole detection is enabled.  Make
sure it only happens when the second attempt to send the same segment also fails
with rto.

Also make sure that each mtu probing stage (usually 1448 -> 1188 -> 524) follows
the same pattern and gets 2 chances (rto) before further clamping down.

Note: RFC4821 doesn't specify implementation details on how this situation
should be handled.

git-svn-id: svn://svn.freebsd.org/base/stable/10@290125 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC 278582:
jhb [Thu, 29 Oct 2015 00:18:03 +0000 (00:18 +0000)]
MFC 278582:
MFi386:
When building some of the boot loaders with clang, and DEBUG_FLAGS or
CFLAGS having '-g' in it, clang outputs several assembly directives that
are too new for our version of binutils.

Therefore, assemble the resulting .s files with clang instead.  A more
general solution can be implemented when a GNU as-compatible driver for
clang's integrated assembler appears.

git-svn-id: svn://svn.freebsd.org/base/stable/10@290124 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r262957, r267591, r289634:
gjb [Wed, 28 Oct 2015 13:30:14 +0000 (13:30 +0000)]
MFC r262957, r267591, r289634:

 r262957 (marcel):
  Change the terminal type/class for enabled serial lines to 3wire. This
  allows us to change the uart(4) driver to not hardcode specific line
  settings for the serial console.

  A terminal type of 3wire makes sure the console still works when no DCD
  signal is present, which preserves behviour. When it is known that the
  terminal server (or DCE in general) provides DCD, a terminal type/class
  of std can be used. This has the effect of being logged out when one
  disconnects from the console -- improving security overall.

 r267591 (grehan):
  Convert the potential console port over to using 3wire, for i386/amd64.

 r289634:
  Enable all callin ttys if the tty is an available console.

Sponsored by: The FreeBSD Foundation

git-svn-id: svn://svn.freebsd.org/base/stable/10@290107 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r289324:
kib [Wed, 28 Oct 2015 11:32:39 +0000 (11:32 +0000)]
MFC r289324:
Allow PT_NOTES segments to be located anywhere in the executable
image.

git-svn-id: svn://svn.freebsd.org/base/stable/10@290099 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r289322:
kib [Wed, 28 Oct 2015 11:29:54 +0000 (11:29 +0000)]
MFC r289322:
Allow PT_INTERP and PT_NOTES segments to be located anywhere in the
executable image.

git-svn-id: svn://svn.freebsd.org/base/stable/10@290097 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r284157 (by emaste):
kib [Wed, 28 Oct 2015 11:22:30 +0000 (11:22 +0000)]
MFC r284157 (by emaste):
Add user facing errors for exceeding process memory limits.

git-svn-id: svn://svn.freebsd.org/base/stable/10@290094 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC 283645:
jhb [Tue, 27 Oct 2015 22:57:58 +0000 (22:57 +0000)]
MFC 283645:
Similarly to other architecture, add the include for cpufunc.h which is
needed for pte.h by vmstat to resolve MIPS_CCA_UNCACHED.

git-svn-id: svn://svn.freebsd.org/base/stable/10@290080 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC r286163: rc.subr: Allow rc.conf.d with multi-directory local_startup.
jilles [Tue, 27 Oct 2015 20:58:14 +0000 (20:58 +0000)]
MFC r286163: rc.subr: Allow rc.conf.d with multi-directory local_startup.

I also changed ${...%*/rc.d} to ${...%/rc.d} since the shortest match always
has an empty string for the asterisk.

PR: 201641
Submitted by: Jamie Landeg-Jones (original version)

git-svn-id: svn://svn.freebsd.org/base/stable/10@290062 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC 271389,286330,286331,286358,286378,286380,286381,286383,286388,286848,
jhb [Tue, 27 Oct 2015 17:00:04 +0000 (17:00 +0000)]
MFC 271389,286330,286331,286358,286378,286380,286381,286383,286388,286848,
286849,286857,286860,286913,286914,286937-286940,286962,286963,288405,
288406,288424,288454-288456,288625,288626,288832,288834,288950,288997,
289080:
Merge most of the recent changes to truss in HEAD.  The largest effects
are that fork following now uses a single truss process (and thus truss -c
reports counts for the entire tree of processes instead of separate dumps
for each process).  truss -c also reports counts for all system calls
instead of only a subset.  More system call arguments are also decoded.
System calls should now report the correct number of arguments (instead
of 6), and some platforms that did not properly decode arguments might
now do so (e.g. mips64).

Changes relative to the equivalent commits to HEAD include:
- The ia64 backend was refactored similar to the other backends.
- _umtx_lock/_umtx_unlock entries were updated similar to other system
  call entries.
- 10 does not have futimens(), utimensat(), EVFILT_PROCDESC, EVFILT_SENDFILE,
  RLIMIT_KQUEUES, O_VERIFY, NOTE_FILE_POLL, or EV_FORCEONESHOT.

271389:
Stop accessing the saved stack pointer by looking past the end of the
array of registers.

286330:
Whitespace fix: remove some spurious spaces before commas.

286331:
Rework get_string() to make it more robust when fetching strings of unknown
length.  In particular, instead of blinding fetching 1k blocks, do an initial
fetch up to the end of the current page followed by page-sized fetches up to
the maximum size.  Previously if the 1k buffer crossed a page boundary and
the second page was not valid, the entire operation would fail.

286358:
Add recently added values of various flags and enumerations including
kevent filters, kevent flags, flags to mmap, seek locations, fcntl
operations, file flags, socket domains, open flags, resource limits, and
pathconf values.

286378:
Don't mark the fcntl flag argument as an output parameter so that it is
always decoded.  Previously the argument was not decoded if fcntl() failed.

286380:
Decode the arguments to mkfifo() and fix an off-by-one error in the arguments
to mknod().

286381:
Decode the arguments passed to the *at() family of system calls.  This is
especially useful now that libc's open() always calls openat().  While here,
fix a few other things:
- Decode the mode argument passed to access(), eaccess(), and faccessat().
- Decode the atfd paramete to pretty-print AT_FDCWD.
- Decode the special AT_* flags used with some of the *at() system calls.
- Decode arguments for fchmod(), lchmod(), fchown(), lchown(), eaccess(),
  and futimens().
- Decode both of the timeval structures passed to futimes() instead of just
  the first one.

286383:
Whitespace fixes to consistently use spaces before }'s and
wrap long lines.

286388:
Consistently use both leading and trailing spaces inside of the {}'s
when pretty-printing structures.  Most structures used both spaces,
but some only used a trailing space and some used neither.

286848:
- Decode the arguments for several signal-related system calls: sigpending,
  sigqueue, sigreturn, sigsuspend, sigtimedwait, sigwait, sigwaitinfo, and
  thr_kill.
- Print signal sets as a structure (with {}'s) and in particular use this to
  differentiate empty sets from a NULL pointer.
- Decode arguments for some other system calls: issetugid, pipe2, sysarch
  (operations are only decoded for amd64 and i386), and thr_self.

286849:
Decode the optional SOCK_NONBLOCK and SOCK_CLOEXEC flags passed in a
socket type.

286857:
Tidy the linux_socketcall decoding:
- Don't exit if get_struct() fails, instead print the raw pointer value to
  match all other argument decoding cases.
- Use an xlat table instead of a home-rolled switch for the operation name.
- Display the nested socketcall args structure as a structure instead of as
  two inline arguments.

286860:
Use an xlat table and xlookup() instead of a home-rolled version for the
sigprocmask operation type.

286913:
Change the argument formatting function to use a stdio FILE object opened
with open_memstream() to build the string for each argument.  This allows
for more complicated argument building without resorting to intermediate
malloc's, etc.

Related, the strsig*() functions no longer return allocated strings but
use a static global buffer instead.

286914:
Expand the decoding of kevent structures.
- Print the ident value as decimal instead of hexadecimal for filter types
  that use "small" values such as file descriptors and PIDs.
- Decode NOTE_* flags in the fflags field of kevents for several system
  filter types.

286937:
Use nitems().

286938:
Various style and whitespace fixes.

287939:
Always use %j with an intmax_t cast to print time_t values.  time_t is
longer than long on 32-bit platforms with a 64-bit time_t.

286940:
ino_t is unsigned, so use uintmax_t instead of intmax_t when printing it.

286962:
Rework the argv and env string fetching for execve to be more robust.
Before truss would fetch 100 string pointers and happily walk off the end
of the array if it never found a NULL.  This also means for a short argv
list it could fail entirely if the 100 string pointers spanned into an
unmapped page.

Instead, fetch page-aligned blocks of string pointers in a loop fetching
each string until a NULL is found.

While here, make use of the open memstream file descriptor instead of
allocating a temporary array.  This allows us to fetch each string once
instead of twice.

286963:
Handle the conditional decoding of execve() argument and environment
arrays generically rather than duplicating a hack in all of the backends.
- Add two new system call argument types and use them instead of StringArray
  for the argument and environment arguments execve and linux_execve.
- Honor the -a/-e flags in the handling of these new types.
- Instead of printing "<missing argument>" when the decoding is disabled,
  print the raw pointer value.

288405:
Decode recently added procctl(2) operations.

288406:
Trim trailing whitespace.

288424:
Several changes to truss.
- Refactor the interface between the ABI-independent code and the
  ABI-specific backends.  The backends now provide smaller hooks to
  fetch system call arguments and return values.  The rest of the
  system call entry and exit handling that was previously duplicated
  among all the backends has been moved to one place.
- Merge the loop when waiting for an event with the loop for handling stops.
  This also means not emulating a procfs-like interface on top of ptrace().
  Instead, use a single event loop that fetches process events via waitid().
  Among other things this allows us to report the full 32-bit exit value.
- Use PT_FOLLOW_FORK to follow new child processes instead of forking a new
  truss process for each new child.  This allows one truss process to monitor
  a tree of processes and truss -c should now display one total for the
  entire tree instead of separate summaries per process.
- Use the recently added fields to ptrace_lwpinfo to determine the current
  system call number and argument count.  The latter is especially useful
  and fixes a regression since the conversion from procfs.  truss now
  generally prints the correct number of arguments for most system calls
  rather than printing extra arguments for any call not listed in the
  table in syscalls.c.
- Actually check the new ABI when processes call exec.  The comments claimed
  that this happened but it was not being done (perhaps this was another
  regression in the conversion to ptrace()).  If the new ABI after exec
  is not supported, truss detaches from the process.  If truss does not
  support the ABI for a newly executed process the process is killed
  before it returns from exec.
- Along with the refactor, teach the various ABI-specific backends to
  fetch both return values, not just the first.  Use this to properly
  report the full 64-bit return value from lseek().  In addition, the
  handler for "pipe" now pulls the pair of descriptors out of the
  return values (which is the true kernel system call interface) but
  displays them as an argument (which matches the interface exported by
  libc).
- Each ABI handler adds entries to a linker set rather than requiring
  a statically defined table of handlers in main.c.
- The arm and mips system call fetching code was changed to follow the
  same pattern as amd64 (and the in-kernel handler) of fetching register
  arguments first and then reading any remaining arguments from the
  stack.  This should fix indirect system call arguments on at least
  arm.
- The mipsn32 and n64 ABIs will now look for arguments in A4 through A7.
- Use register %ebp for the 6th system call argument for Linux/i386 ABIs
  to match the in-kernel argument fetch code.
- For powerpc binaries on a powerpc64 system, fetch the extra arguments
  on the stack as 32-bit values that are then copied into the 64-bit
  argument array instead of reading the 32-bit values directly into the
  64-bit array.

288454:
- Remove extra integer argument from truncate() and ftruncate().  This is
  probably fallout from the removal of the extra padding argument before
  off_t in 7.  However, that padding still exists for 32-bit powerpc, so
  use QUAD_ALIGN.
- Fix QUAD_ALIGN to be zero for powerpc64.  It should only be set to 1
  for 32-bit platforms that add padding to align 64-bit arguments.

288455:
The id_t type used to pass IDs to wait6(2) and procctl(6) is a 64-bit
integer.  Fix the argument decoding to treat this as a quad instead of an
int.  This includes using QUAD_ALIGN and QUAD_SLOTS as necessary.  To
continue printing IDs in decimal, add a new QuadHex argument type that
prints a 64-bit integer in hex, use QuadHex for the existing off_t arguments,
repurpose Quad to print a 64-bit integer in decimal, and use Quad for id_t
arguments.

This fixes the decoding of wait6(2) and procctl(2) on 32-bit platforms.

288456:
Rather than groveling around in a socket address structure for a socket
address's length (and then overriding it if it "looks wrong"), use the
next argument to the system call to determine the length.  This is more
reliable since this is what the kernel depends on anyway and is also
simpler.

288625:
Add decoding for struct statfs.

288626:
Style fix.

288832:
Fix tracking of unknown syscalls for 'truss -c'.

This is done by changing get_syscall() to either lookup the known syscall
or add it into the list with the default handlers for printing.

This also simplifies some code to not have to check if the syscall variable
is set or NULL.

288834:
Add decoding for modfind(2)

288950:
Group the decoded system calls by ABI and sort the calls within each ABI.

288997:
Correct a comment.

289080:
Let -c imply -S (hide signal output).

Without this, the signals are shown seemingly randomly in the output before
the final summary is shown.  This is especially noticeable when there is
not much output from the application being traced.

git-svn-id: svn://svn.freebsd.org/base/stable/10@290052 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoMFC: r289878
bapt [Tue, 27 Oct 2015 07:08:47 +0000 (07:08 +0000)]
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>

git-svn-id: svn://svn.freebsd.org/base/stable/10@290040 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

8 years agoFix indentation in etc/rc.d/fsck.
vangyzen [Tue, 27 Oct 2015 02:52:05 +0000 (02:52 +0000)]
Fix indentation in etc/rc.d/fsck.

git-svn-id: svn://svn.freebsd.org/base/stable/10@290036 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f