]> CyberLeo.Net >> Repos - FreeBSD/stable/10.git/log
FreeBSD/stable/10.git
7 years agoMFC r305819:
mm [Sun, 25 Sep 2016 22:04:02 +0000 (22:04 +0000)]
MFC r305819:
Sync libarchive with vendor including important security fixes.

Issues fixed (FreeBSD):
PR #778: ACL error handling
Issue #745: Symlink check prefix optimization is too aggressive
Issue #746: Hard links with data can evade sandboxing restrictions

This update fixes the vulnerability #3 and vulnerability #4 as reported in
"non-cryptanalytic attacks against FreeBSD update components".
https://gist.github.com/anonymous/e48209b03f1dd9625a992717e7b89c4f

Fix for vulnerability #2 has already been merged in r305192.

Security: http://gist.github.com/anonymous/e48209b03f1dd9625a992717e7b89c4f

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

7 years agoMFC r305956: Add manpage for rctl_* system calls
badger [Sat, 24 Sep 2016 16:46:37 +0000 (16:46 +0000)]
MFC r305956: Add manpage for rctl_* system calls

Approved by: kib (mentor)
Sponsored by: Dell Technologies

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

7 years agoMFC r305896:
dchagin [Sat, 24 Sep 2016 10:34:35 +0000 (10:34 +0000)]
MFC r305896:

Implement BLKSSZGET ioctl for the Linuxulator.

PR: 212700

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

7 years agoMFC r305877:
hselasky [Fri, 23 Sep 2016 08:35:56 +0000 (08:35 +0000)]
MFC r305877:
mlx5en: Fix duplicate mbuf free-by-code.

When mlx5e_sq_xmit() returns an error code and the mbuf pointer is set,
we should not free the mbuf, because the caller will keep the mbuf in
the drbr. Make sure the mbuf pointer is correctly set upon function
exit.

Sponsored by: Mellanox Technologies

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

7 years agoMFC r305876:
hselasky [Fri, 23 Sep 2016 08:35:11 +0000 (08:35 +0000)]
MFC r305876:
mlx5en: Remove unused pdev pointer.

Sponsored by: Mellanox Technologies

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

7 years agoMFC r305875:
hselasky [Fri, 23 Sep 2016 08:34:28 +0000 (08:34 +0000)]
MFC r305875:
mlx5en: Verify port type is ethernet before creating network device

Else the mlx5en driver might attach to infiniband ports.

Sponsored by: Mellanox Technologies

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

7 years agoMFC r305874:
hselasky [Fri, 23 Sep 2016 08:33:47 +0000 (08:33 +0000)]
MFC r305874:
mlx5en: Allow setting the software MTU size below 1500 bytes

The hardware MTU size can't be set to a value less than 1500 bytes due
to side-band management support. Allow setting the software MTU size
below 1500 bytes, thus creating a mismatch between hardware and
software MTU sizes.

Sponsored by: Mellanox Technologies

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

7 years agoMFC r305873:
hselasky [Fri, 23 Sep 2016 08:33:03 +0000 (08:33 +0000)]
MFC r305873:
mlx5en: Factor out common sendqueue code for use with rate limiting SQs.

Try to reuse code to setup sendqueues when possible by making some static
functions global. Further split the mlx5e_close_sq_wait() function to
separate out reusable parts.

Sponsored by: Mellanox Technologies

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

7 years agoMFC r305872:
hselasky [Fri, 23 Sep 2016 08:32:18 +0000 (08:32 +0000)]
MFC r305872:
mlx5en: Properly declare doorbell lock for 32-bit CPUs.

Sponsored by: Mellanox Technologies

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

7 years agoMFC r305871:
hselasky [Fri, 23 Sep 2016 08:31:38 +0000 (08:31 +0000)]
MFC r305871:
mlx5en: Optimise away duplicate UAR pointers.

This change also reduces the size of the mlx5e_sq structure so that the last
queue_state element will fit into the previous cacheline and then the mlx5e_sq
structure becomes one cacheline less for amd64.

Sponsored by: Mellanox Technologies

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

7 years agoMFC r305870:
hselasky [Fri, 23 Sep 2016 08:30:53 +0000 (08:30 +0000)]
MFC r305870:
mlx5en: Make the mlx5e_open_cq() and mlx5e_close_cq() functions global.

Make some functions and structures global to allow for code reuse
when creating rate limiting sendqueues.

Sponsored by: Mellanox Technologies

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

7 years agoMFC r305869:
hselasky [Fri, 23 Sep 2016 08:30:09 +0000 (08:30 +0000)]
MFC r305869:
mlx5en: Minor completion queue control path code refactor.

Move setting of CQ moderation mode together with the other
CQ moderation parameters. Pass completion event vector as
a separate argument to mlx5e_open_cq(), because its value is
different for each call. Pass mlx5e_priv pointer instead of
mlx5e_channel pointer so that code can be used by rate
limiting sendqueues.

Sponsored by: Mellanox Technologies

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

7 years agoMFC r305868:
hselasky [Fri, 23 Sep 2016 08:29:27 +0000 (08:29 +0000)]
MFC r305868:
mlx5en: Separate the sendqueue from using the mlx5e_channel structure.

This change allows for reusing the transmit path for so called
rate limited senqueues. While at it optimise some pointer lookups
in the fast path.

Sponsored by: Mellanox Technologies

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

7 years agoMFC r305867:
hselasky [Fri, 23 Sep 2016 08:28:44 +0000 (08:28 +0000)]
MFC r305867:
Update the MLX5 core module:
- Add new firmware commands and update existing ones.
- Add more firmware related structures and update existing ones.
- Some minor fixes, like adding missing \n to some prints.

Sponsored by: Mellanox Technologies

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

7 years agoMFC 306015
sephe [Fri, 23 Sep 2016 04:53:47 +0000 (04:53 +0000)]
MFC 306015
    hyperv/storvsc: Fix SRB length setting.

    This fixes disk discovery issue on WS2008R2 Hyper-V, which plagued
    us since 10.2-release.

    Reported by:    many
    Sponsored by:   Microsoft

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

7 years agoMFC bspatch Capsicumization and improvements
emaste [Thu, 22 Sep 2016 21:16:54 +0000 (21:16 +0000)]
MFC bspatch Capsicumization and improvements

r304691: bspatch: apply style(9)

Make style changes (and trivial refactoring of open calls) now in order
to reduce noise in diffs for future capsicum changes.

r304807 (allanjude): Capsicumize bspatch

Move all of the fopen() and open() calls to the top of main()

Restrict each FD to least privilege (read/seek only, write only, etc)

cap_enter(), and make all except the output FD read/seek only.

r304821: bspatch: remove output file in the case of error

r305486: bspatch: add sanity checks on sizes to avoid integer overflow

Note that this introduces an explicit 2GB limit, but this was already
implicit in variable and function argument types.

This is based on the "non-cryptanalytic attacks against freebsd
update components" anonymous gist. Further refinement is planned.

r305737: bspatch: remove superfluous newlines from errx strings

r305822: bspatch: use #define for header size instead of magic number

r306026: bspatch: Remove backwards-compatibility sys/capability.h support

bspatch previously included sys/capability.h or sys/capsicum.h based
on __FreeBSD_version, as FreeBSD is the upstream for bsdiff and we may
see this file incorporated into other third-party software.

The Capsicum header is now installed as sys/capsicum.h in stable/10 and
FreeBSD 10.3, so we can just use sys/capsicum.h and simplify the logic.

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

7 years agoMFC r264823 (ed): Make usage printing more consistent with other tools.
emaste [Thu, 22 Sep 2016 21:14:00 +0000 (21:14 +0000)]
MFC r264823 (ed): Make usage printing more consistent with other tools.

- Introduce a separate usage() function.
- Don't use argv[0]. Directly name the application, as we do elsewhere.
- Don't prepend the application name.
- Don't print two newlines.

Also apply the unnecessary semicolon cleanup from r298089

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

7 years agoMFC r305841
ache [Thu, 22 Sep 2016 16:46:59 +0000 (16:46 +0000)]
MFC r305841

Implement multibyte encoding support for -v with fallback

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

7 years agoMerge OpenSSL 1.0.1u.
jkim [Thu, 22 Sep 2016 15:05:38 +0000 (15:05 +0000)]
Merge OpenSSL 1.0.1u.

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

7 years agoMFC r305601:
kib [Thu, 22 Sep 2016 10:54:30 +0000 (10:54 +0000)]
MFC r305601:
On rename, do not perform truncation of dirhash if the vnode truncation failed.

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

7 years agoMFC r305599:
kib [Thu, 22 Sep 2016 10:53:13 +0000 (10:53 +0000)]
MFC r305599:
Do not leak transient ENOLCK error from flush_newblk_dep() loop.

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

7 years agoMFC r305598:
kib [Thu, 22 Sep 2016 10:51:47 +0000 (10:51 +0000)]
MFC r305598:
When logging unlikely UFS_TRUNCATE() failure in ufs_direnter(),
include error code.

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

7 years agoMFC r305597:
kib [Thu, 22 Sep 2016 10:49:42 +0000 (10:49 +0000)]
MFC r305597:
When extending directory inode in ufs_direnter(), adjust i_endoff.

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

7 years agoMFC r305595:
kib [Thu, 22 Sep 2016 10:47:56 +0000 (10:47 +0000)]
MFC r305595:
In dqsync(), when called from quotactl(), um_quotas entry might appear
cleared since nothing prevents completion of the parallel quotaoff.
There is nothing to sync in this case, and no reason to panic.

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

7 years agoMFC r305594:
kib [Thu, 22 Sep 2016 10:46:08 +0000 (10:46 +0000)]
MFC r305594:
In softdep_prealloc(), return early not only for snapshots, but for
the quota files as well.

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

7 years agoMFC r305593:
kib [Thu, 22 Sep 2016 10:44:56 +0000 (10:44 +0000)]
MFC r305593:
There is no need to upgrade the last dvp lock on lookups for modifying
operations.  Instead of upgrading, assert that the lock is exclusive.
Explain the cause in comments.

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

7 years agoMFC r305592:
kib [Thu, 22 Sep 2016 10:42:40 +0000 (10:42 +0000)]
MFC r305592:
Partially lift suspension when ffs_reload() finished with cgs and
going to re-read inodes.

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

7 years agoMFC r305610: Don't report to devd statuses that CAM doesn't consider errors.
mav [Thu, 22 Sep 2016 03:35:02 +0000 (03:35 +0000)]
MFC r305610: Don't report to devd statuses that CAM doesn't consider errors.

Some statuses, such as "ATA pass through information available", are part
part of absolutely normal operation and do not worth reporting.

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

7 years agoMFC r305609: "Extended copy information available" is not an error either.
mav [Thu, 22 Sep 2016 03:34:26 +0000 (03:34 +0000)]
MFC r305609: "Extended copy information available" is not an error either.

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

7 years agoMFC r305608: "ATA pass through information available" is not an error.
mav [Thu, 22 Sep 2016 03:33:46 +0000 (03:33 +0000)]
MFC r305608: "ATA pass through information available" is not an error.

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

7 years agoMFC r305602: intpm: fix attachment to supported AMD FCHs
avg [Wed, 21 Sep 2016 19:53:51 +0000 (19:53 +0000)]
MFC r305602: intpm: fix attachment to supported AMD FCHs

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

7 years agoMFC r275240 (bapt): Implement --no-fatal-warnings
emaste [Wed, 21 Sep 2016 19:11:37 +0000 (19:11 +0000)]
MFC r275240 (bapt): Implement --no-fatal-warnings

Implement --no-fatal-warning for compatibility with newer ld
what ever order the options are passed to ld(1) the --no-fatal-warning always
disable --fatal-warning

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

7 years agoMFC r305606: intpm: make sure to register smbus driver before intpm driver
avg [Wed, 21 Sep 2016 16:29:15 +0000 (16:29 +0000)]
MFC r305606: intpm: make sure to register smbus driver before intpm driver

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

7 years agoMFC r305604: intpm: better clean up resources after a failed attachment
avg [Wed, 21 Sep 2016 16:27:09 +0000 (16:27 +0000)]
MFC r305604: intpm: better clean up resources after a failed attachment

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

7 years agoMFC r305603: intpm: do not try attaching to unsupported controller revisions
avg [Wed, 21 Sep 2016 16:23:31 +0000 (16:23 +0000)]
MFC r305603: intpm: do not try attaching to unsupported controller revisions

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

7 years agoMFC r305600: amdsbwd.4: update supported hardware list
avg [Wed, 21 Sep 2016 16:17:22 +0000 (16:17 +0000)]
MFC r305600: amdsbwd.4: update supported hardware list

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

7 years agoMFC r305596: intpm.4 update supported hardware list
avg [Wed, 21 Sep 2016 16:15:35 +0000 (16:15 +0000)]
MFC r305596: intpm.4 update supported hardware list

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

7 years agoMFC r303113: Cross-link some SMBus controller drivers man pages.
avg [Wed, 21 Sep 2016 16:14:02 +0000 (16:14 +0000)]
MFC r303113: Cross-link some SMBus controller drivers man pages.

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

7 years agoMFC r303111: Document list of supported chipsets.
avg [Wed, 21 Sep 2016 16:12:34 +0000 (16:12 +0000)]
MFC r303111: Document list of supported chipsets.

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

7 years agoMFC r305535: amdsbwd: add support for FCH in family 16h models 30h-3Fh processors
avg [Wed, 21 Sep 2016 16:06:00 +0000 (16:06 +0000)]
MFC r305535: amdsbwd: add support for FCH in family 16h models 30h-3Fh processors

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

7 years agoMFC r305939:
kib [Wed, 21 Sep 2016 08:14:55 +0000 (08:14 +0000)]
MFC r305939:
Remove trailing space.

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

7 years agoMFstable/11 r305914:
ngie [Sun, 18 Sep 2016 04:34:32 +0000 (04:34 +0000)]
MFstable/11 r305914:

MFC r305357:

Skip testcases 9/10 if jail(8) isn't installed

These testcases require jail support

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

7 years agoMFstable/11 r305912:
ngie [Sun, 18 Sep 2016 03:00:46 +0000 (03:00 +0000)]
MFstable/11 r305912:

MFC r305356:

Add a missing "Bail out!" if zpool create fails

This will make the exit info more meaningful if/when zpool create fails,
and establishes parity with the other 2 zfs acl testcases (01, 03).

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

7 years agoMFstable/11 r305910:
ngie [Sun, 18 Sep 2016 02:51:18 +0000 (02:51 +0000)]
MFstable/11 r305910:

MFC r305033,r305041,r305170:

r305033:

Minor Makefile simplifications for lib/atf/...

- Replace uses of `${.CURDIR:H:H:H}` with ${SRCTOP}
- Use built-in :H operator instead of ".." when enumerating paths.

r305041:

Filter certain compile-time options into -DATF_BUILD_*

Items filtered through are:

- Constant defines (-D)
- Include flags (-I)
- Linker flags (-L)
- Optimization level (-O)
- Warnings / linker flags (-W)
- Preprocessor options (-f)

This fixes the scenario hit by the Jenkins job where it's infecting
the build with --sysroot, etc options from the Jenkins build in the
tests.

Prefix all intermediate variables (_CFLAGS, etc) with "ATF_BUILD" [*].

Requested by: jmmv

r305170:

Don't bake all of CC/CPP/CXX into CFLAGS

Capture executable names for CC, CPP, CXX (assumed to be the
first non-CCACHE_BIN word).

This change strips out all of the cross-compiler arguments, (-target,
-B, etc), added to ${CC}, etc via ${CROSSENV} in Makefile.inc1, so it
doesn't infect the build and subsequently the test.

Add comments noting why this logic is being added, and why the logic in
r305041 was necessary/what it was trying to achieve.

This is required after recent changes made to the toolchain to always
specify --sysroot, -target, -B, etc with clang in buildworld (presumably
r304681).

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

7 years agoMFC r301522 (by bz)
hiren [Fri, 16 Sep 2016 00:14:26 +0000 (00:14 +0000)]
MFC r301522 (by bz)

Implement a `show panic` command to DDB which will helpfully print the
panic string again if set, in case it scrolled out of the active
window.  This avoids having to remember the symbol name.

Also add a show callout <addr> command to DDB in order to inspect
some struct callout fields in case of panics in the callout code.
This may help to see if there was memory corruption or to further
ease debugging problems.

No objection by:    bz

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

7 years agoMFC r305590:
hselasky [Thu, 15 Sep 2016 08:35:46 +0000 (08:35 +0000)]
MFC r305590:
Correctly map the USB mouse tilt delta values into buttons 5 and 6
instead of 3 and 4 which is used for the scroll wheel, according to
X.org.

PR: 170358

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

7 years agoMFC r305744:
kib [Thu, 15 Sep 2016 08:26:59 +0000 (08:26 +0000)]
MFC r305744:
Fix typo in comment.

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

7 years agoMFC r305129:
kib [Wed, 14 Sep 2016 10:51:06 +0000 (10:51 +0000)]
MFC r305129:
Make swapoff reliable.

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

7 years agoMFC r305123: Fix kernel panic when inheriting properties without default.
mav [Wed, 14 Sep 2016 09:13:17 +0000 (09:13 +0000)]
MFC r305123: Fix kernel panic when inheriting properties without default.

There are two writable hidden properties "iscsioptions" and "stmf_sbd_lu",
that have no default string value.  Attempt to unset them or replicate
caused kernel panic.  This simple bandaid seems fixes the problem nicely.

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

7 years agoMFC r305536: Fix channel initialization in FBS mode.
mav [Wed, 14 Sep 2016 09:11:03 +0000 (09:11 +0000)]
MFC r305536: Fix channel initialization in FBS mode.

Due to reading initialized variable, FIS receive area was always allocated
as 256 bytes, suitable for command-based switching, instead of 4096 bytes,
required for FIS-based switching.  This caused memory corruption in case of
MFC r305536: Fix channel initialization in FBS mode.

Due to reading initialized variable, FIS receive area was always allocated
as 256 bytes, suitable for command-based switching, instead of 4096 bytes,
required for FIS-based switching.  This caused memory corruption in case of
port multipliers used on FBS-capable HBAs (Marvell).

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

7 years agoMFC r305679: Switch random_get_pseudo_bytes() shim to arc4rand().
mav [Tue, 13 Sep 2016 09:25:38 +0000 (09:25 +0000)]
MFC r305679: Switch random_get_pseudo_bytes() shim to arc4rand().

Our shim for Solaris random_get_bytes() uses read_random(), that looks
reasonable, since it guaranties reliably seeded random data.  On the other
side Solaris random_get_pseudo_bytes() does not provide this guarantie,
and its original Solaris implementation is equivalent to our arc4rand(),
using software crypto without stressing slower hardware RNG.

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

7 years agoMFC r303935
lwhsu [Tue, 13 Sep 2016 05:22:08 +0000 (05:22 +0000)]
MFC r303935

Only remove empty directories before packaging.

This preserves files are intentionally empty, most of them are in tests.txz

Reviewed by: bdrewery

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

7 years agoMFC r305422:
mm [Mon, 12 Sep 2016 22:07:35 +0000 (22:07 +0000)]
MFC r305422:
Sync libarchive with vendor

Vendor issues fixed:
PR #777: Multiple bugfixes for setup_acls()

This includes a bugfix for a bug that caused ACLs not to be read properly
for files and directories inside subdirectories and as a result not being
stored or being incorrectly stored in tar archives.

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

7 years agoMFC r302778
asomers [Mon, 12 Sep 2016 17:35:45 +0000 (17:35 +0000)]
MFC r302778

pw should sanitize the argument of -w.

Otherwise, it will silently disable the login for the selected account if
the argument is unrecognizable.

usr.sbin/pw/pw.h
usr.sbin/pw/pw_conf.c
usr.sbin/pw/pw_user.c
        Use separate rules to validate boolean parameters and passwd
        parameters.  Error out if a password parameter cannot be parsed.

usr.sbin/pw/tests/Makefile
usr.sbin/pw/tests/crypt.c
usr.sbin/pw/tests/pw_useradd.sh
usr.sbin/pw/tests/pw_usermod.sh
        Add tests for the validation.  Also, enhance existing
        password-related tests to actually validate that the correct hash is
        written to master.passwd.

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

7 years agoMFC: 304825
gnn [Mon, 12 Sep 2016 17:05:42 +0000 (17:05 +0000)]
MFC: 304825
Unlike Solaris, in FreeBSD p_args can be 0 so check for that
instead of walking down to ar_args blindly.

Reported by: Amanda Strnad
Reviewed by: markj, jhb
Sponsored by: DARPA, AFRL

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

7 years agoMFC r304162
asomers [Mon, 12 Sep 2016 16:55:16 +0000 (16:55 +0000)]
MFC r304162

Decrease the anti-congestion sleep in 480.leapfile-ntpd to 1 hour

24 hours is too long. Periodic scripts are executed serially, so when
combined with the sleep in 410.pkg-audit periodic could actually take more
than 24 hours and block the next invocation.

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

7 years agoMFC r305421:
hselasky [Mon, 12 Sep 2016 10:17:25 +0000 (10:17 +0000)]
MFC r305421:
Resolve deadlock between device_detach() and usbd_do_request_flags()
by reviving the SX control request lock and refining which lock
protects the common scratch area in "struct usb_device".

The SX control request lock was removed by r246759 because it caused a
lock order reversal with the USB enumeration lock inside
usbd_transfer_setup() as a function of r246616. It was thought that
reducing the number of locks would resolve the LOR, but because some
USB device drivers use usbd_do_request_flags() inside callback
functions, like in taskqueues, a deadlock may occur when these are
drained from device_detach(). By restoring the SX control request
lock usbd_do_request_flags() is allowed to complete its execution
when a USB device driver is detaching. By using the SX control request
lock to protect the scratch area, the LOR introduced by r246616 is
also resolved.

Bump the FreeBSD version while at it to force recompilation of all USB
kernel modules.

Found by: avos@

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

7 years agoMFC 305177
sephe [Mon, 12 Sep 2016 08:32:06 +0000 (08:32 +0000)]
MFC 305177
    net/vlan: Shift for pri is 13 (pri mask 0xe000) not 1.

    Reviewed by:    araujo, hps
    Sponsored by:   Microsoft
    Differential Revision:  https://reviews.freebsd.org/D7710

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

7 years agoMFC r305430:
dim [Sun, 11 Sep 2016 14:19:06 +0000 (14:19 +0000)]
MFC r305430:

Define libcpp's HAVE_DESIGNATED_INITIALIZERS in a defined and portable
way.

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

7 years agoMFC 303720: Apply the fix from r232612 to fixed function counters.
jhb [Fri, 9 Sep 2016 21:19:31 +0000 (21:19 +0000)]
MFC 303720: Apply the fix from r232612 to fixed function counters.

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

7 years agoMFC 303713: Correct assertion on vcpuid argument to vm_gpa_hold().
jhb [Fri, 9 Sep 2016 20:30:36 +0000 (20:30 +0000)]
MFC 303713: Correct assertion on vcpuid argument to vm_gpa_hold().

PR: 208168

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

7 years agoMFC 304637: Fix build for !SMP kernels after the Xen MSIX workaround.
jhb [Fri, 9 Sep 2016 19:57:32 +0000 (19:57 +0000)]
MFC 304637: Fix build for !SMP kernels after the Xen MSIX workaround.

Move msix_disable_migration under #ifdef SMP since it doesn't make sense
for !SMP kernels.

PR: 212014

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

7 years agoMFC r305469:
delphij [Fri, 9 Sep 2016 06:59:49 +0000 (06:59 +0000)]
MFC r305469:

Ensure that we always open only files that is named by explicitly
using shell redirections instead of having gzip(1) to decide what
file to open.

Issue reported in the "non-cryptanalytic attacks against freebsd
update components" anonymous gist.

Reviewed by: allanjude, emaste

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

7 years agoMFC r304571:
hselasky [Fri, 9 Sep 2016 06:38:13 +0000 (06:38 +0000)]
MFC r304571:
Make the UKBD USB transfers double buffered and set them up one by one,
so they are memory independent which allows for handling panics
triggered by the keyboard driver itself, typically via CTRL+ALT+ESC
sequences. Or if the USB keyboard driver was processing a key at the
moment of panic. Allow UKBD to be attached while keyboard polling is active.

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

7 years agoMFC r305284:
hselasky [Fri, 9 Sep 2016 06:27:25 +0000 (06:27 +0000)]
MFC r305284:
Fix array size issue when using the pre-scaling feature for
ISOCHRONOUS USB transfers. Make sure enough length and buffer pointers
are allocated when setting up the libusb transfer structure to support
the maximum number of frames the kernel can handle.

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

7 years agoMFC r303893, r303894:
pfg [Thu, 8 Sep 2016 15:27:42 +0000 (15:27 +0000)]
MFC r303893, r303894:
misc replacements of comma with semicolon when pertinent.

Uses of commas instead of a semicolons can easily go undetected. The comma
can serve as a statement separator but this shouldn't be abused when
statements are meant to be standalone.

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

7 years agoMFC r303889:
pfg [Thu, 8 Sep 2016 15:12:55 +0000 (15:12 +0000)]
MFC r303889:
libc/rpc: replace comma with semicolon when pertinent.

Uses of commas instead of a semicolons can easily go undetected. The comma
can serve as a statement separator but this shouldn't be abused when
statements are meant to be standalone.

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

7 years agoMFC r303891, r303892:
pfg [Thu, 8 Sep 2016 15:06:28 +0000 (15:06 +0000)]
MFC r303891, r303892:
sys: replace comma with semicolon when pertinent.

Uses of commas instead of a semicolons can easily go undetected. The comma
can serve as a statement separator but this shouldn't be abused when
statements are meant to be standalone.

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

7 years agoMFC r281499:
hselasky [Thu, 8 Sep 2016 09:50:03 +0000 (09:50 +0000)]
MFC r281499:
Modify the return value of the uhci/ehci/xhci PCI probe routines to
'BUS_PROBE_DEFAULT'. This allows bhyve's 'ppt' driver to claim ownership
of the device and pass it through to the guest.

In the common case where there are no competing drivers for USB controllers
this change is a no-op.

PR: 212256

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

7 years agoMFC r305413
ache [Thu, 8 Sep 2016 07:14:48 +0000 (07:14 +0000)]
MFC r305413

Fix error handling.

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

7 years agoMFC r305406,r305409,r305412
ache [Thu, 8 Sep 2016 05:13:50 +0000 (05:13 +0000)]
MFC r305406,r305409,r305412

1) Fix errors handling.

2) Prevent out of bounds access to ws[-1] (passed buffer) which happens
when the first mb sequence is incomplete and there are not enougn chars in
the read buffer. ws[-1] may lead to memory faults or false results, in
case the memory here contains '\n'.

3) Fix n == 1 case. Here should be no physical read (fill buffer) attempt
(we read n - 1 chars with the room for NUL, see fgets()),
and no NULL return.

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

7 years agoMFC r305154: directory(3): Deprecate readdir_r(). Clarify dirent buffers.
jilles [Wed, 7 Sep 2016 21:09:44 +0000 (21:09 +0000)]
MFC r305154: directory(3): Deprecate readdir_r(). Clarify dirent buffers.

In existing implementations including FreeBSD, there is no reason to use
readdir_r() in the common case where potentially multiple threads each list
their own directory. Code using readdir() is simpler.

What's more, although readdir_r() can safely be used on FreeBSD because
NAME_MAX is forced to 255, it cannot be used safely on systems where
{NAME_MAX} is not fixed. As a concrete example, FAT/NTFS filenames can be up
to 255 UTF-16 code units long, which can be up to 765 UTF-8 bytes.

Deprecating readdir_r() in POSIX has been proposed in
http://www.austingroupbugs.net/view.php?id=696
and glibc wants to deprecate it as well.

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

7 years agoMFC r305090: getvfsbyname(3): Remove [EFAULT] error.
jilles [Wed, 7 Sep 2016 21:04:39 +0000 (21:04 +0000)]
MFC r305090: getvfsbyname(3): Remove [EFAULT] error.

Since r101651 in 2002, getvfsbyname() has written *vfc using userland
memcpy(), so the [EFAULT] error no longer occurs.

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

7 years agoMFC r305389:
dim [Wed, 7 Sep 2016 19:25:08 +0000 (19:25 +0000)]
MFC r305389:

With clang 3.9.0, compiling sys/netinet/igmp.c results in the following
warning:

sys/netinet/igmp.c:546:21: error: implicit conversion from 'int' to 'char' changes value from 148 to -108 [-Werror,-Wconstant-conversion]
        p->ipopt_list[0] = IPOPT_RA;    /* Router Alert Option */
                         ~ ^~~~~~~~
sys/netinet/ip.h:153:19: note: expanded from macro 'IPOPT_RA'
#define IPOPT_RA                148             /* router alert */
                                ^~~

This is because ipopt_list is an array of char, so IPOPT_RA is wrapped
to a negative value.  It would be nice to change ipopt_list to an array
of u_char, but it changes the signature of the public struct ipoption,
so add an explicit cast to suppress the warning.

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

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

7 years agoMFC r305388:
dim [Wed, 7 Sep 2016 19:21:52 +0000 (19:21 +0000)]
MFC r305388:

With clang 3.9.0, compiling uplcom results in the following warnings:

sys/dev/usb/serial/uplcom.c:543:29: error: implicit conversion from 'int' to 'int8_t' (aka 'signed char') changes value from 192 to -64 [-Werror,-Wconstant-conversion]
        if (uplcom_pl2303_do(udev, UT_READ_VENDOR_DEVICE, UPLCOM_SET_REQUEST, 0x8484, 0, 1)
            ~~~~~~~~~~~~~~~~       ^~~~~~~~~~~~~~~~~~~~~
sys/dev/usb/usb.h:179:53: note: expanded from macro 'UT_READ_VENDOR_DEVICE'
#define UT_READ_VENDOR_DEVICE   (UT_READ  | UT_VENDOR | UT_DEVICE)
                                 ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~

This is because UT_READ is 0x80, so the int8_t argument is wrapped to a
negative value.  Fix this by using uint8_t instead.

Reviewed by: imp, hselasky
Differential Revision: https://reviews.freebsd.org/D7776

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

7 years agoMFC r305360:
dim [Wed, 7 Sep 2016 19:17:03 +0000 (19:17 +0000)]
MFC r305360:

With clang 3.9.0, compiling cxgb results in the following warning:

sys/dev/cxgb/cxgb_sge.c:2873:44: error: implicit conversion from 'int'
to 'char' changes value from 128 to -128 [-Werror,-Wconstant-conversion]
                        *mtod(m, char *) = CPL_ASYNC_NOTIF;
                                         ~ ^~~~~~~~~~~~~~~

This is because CPL_ASYNC_NOTIF is 0x80, so the plain char argument is
wrapped to a negative value.  Fix this by using uint8_t instead.

Reviewed by: np
Differential Revision: https://reviews.freebsd.org/D7772

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

7 years agoMFC r305345:
dim [Wed, 7 Sep 2016 19:02:47 +0000 (19:02 +0000)]
MFC r305345:

With clang 3.9.0, compiling ppbus(4) results in the following warnings:

sys/dev/ppbus/ppb_1284.c:296:46: error: implicit conversion from 'int'
to 'char' changes value from 144 to -112 [-Werror,-Wconstant-conversion]
if ((error = do_peripheral_wait(bus, SELECT | nBUSY, 0))) {
     ~~~~~~~~~~~~~~~~~~      ~~~~~~~^~~~~~~
sys/dev/ppbus/ppb_1284.c:785:48: error: implicit conversion from 'int'
to 'char' changes value from 240 to -16 [-Werror,-Wconstant-conversion]
if (do_1284_wait(bus, nACK | SELECT | PERROR | nBUSY,
    ~~~~~~~~~~~~      ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~
sys/dev/ppbus/ppb_1284.c:786:29: error: implicit conversion from 'int'
to 'char' changes value from 240 to -16 [-Werror,-Wconstant-conversion]
nACK | SELECT | PERROR | nBUSY)) {
~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~

This is because nBUSY is 0x80, so the plain char argument is wrapped to
a negative value.  Fix this in a minimal fashion, by using uint8_t in a
few places.

Reviewed by: emaste
Differential Revision: https://reviews.freebsd.org/D7771

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

7 years agoMFC r305344:
dim [Wed, 7 Sep 2016 18:53:46 +0000 (18:53 +0000)]
MFC r305344:

Define drmP.h's __OS_HAS_AGP and __OS_HAS_MTRR macros in a defined and
portable way.

Reviewed by: dumbbell
Differential Revision: https://reviews.freebsd.org/D7770

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

7 years agoMFC r305085:
dim [Wed, 7 Sep 2016 18:33:18 +0000 (18:33 +0000)]
MFC r305085:

Fix warnings in tnftp about invalid constant conversions, e.g.:

contrib/tnftp/src/ftp.c:2067:11: error: implicit conversion from 'int'
to 'char' changes value from 255 to -1 [-Werror,-Wconstant-conversion]
        buf[0] = IAC;
               ~ ^~~
/usr/include/arpa/telnet.h:39:13: note: expanded from macro 'IAC'
#define IAC     255             /* interpret as command: */
                ^~~
contrib/tnftp/src/ftp.c:2068:11: error: implicit conversion from 'int'
to 'char' changes value from 244 to -12 [-Werror,-Wconstant-conversion]
        buf[1] = IP;
               ~ ^~
/usr/include/arpa/telnet.h:50:12: note: expanded from macro 'IP'
#define IP      244             /* interrupt process--permanently */
                ^~~

Use an unsigned char buffer instead.

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

7 years agoMFC r305077:
dim [Wed, 7 Sep 2016 18:22:08 +0000 (18:22 +0000)]
MFC r305077:

Squelch clang 3.9.0 warnings about BASE (which is 32768) being converted
to -32768 when it is used as an argument to mp_itom(), in both libtelnet
and newkey.  This code has been wrong since r26238 (!), so after almost
20 years it is rather useless to try to correct it.

MFC r305086:

Fix warnings in telnet about invalid constant conversions, e.g.:

contrib/telnet/telnet/commands.c:2914:13: error: implicit conversion
from 'int' to 'char' changes value from 137 to -119
[-Werror,-Wconstant-conversion]
*lsrp++ = IPOPT_SSRR;
~ ^~~~~~~~~~
/usr/include/netinet/ip.h:152:21: note: expanded from macro 'IPOPT_SSRR'
#define IPOPT_SSRR              137             /* strict source route */
^~~
contrib/telnet/telnet/commands.c:2916:13: error: implicit conversion
from 'int' to 'char' changes value from 131 to -125
[-Werror,-Wconstant-conversion]
*lsrp++ = IPOPT_LSRR;
~ ^~~~~~~~~~
/usr/include/netinet/ip.h:148:21: note: expanded from macro 'IPOPT_LSRR'
#define IPOPT_LSRR              131             /* loose source route */
^~~

Use unsigned char buffers instead.

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

7 years agoRegen after r305518: Allow getdtablesize in capability mode
emaste [Wed, 7 Sep 2016 04:07:43 +0000 (04:07 +0000)]
Regen after r305518: Allow getdtablesize in capability mode

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

7 years agoMFC r305140: Allow getdtablesize in capability mode
emaste [Wed, 7 Sep 2016 04:06:25 +0000 (04:06 +0000)]
MFC r305140: Allow getdtablesize in capability mode

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

7 years agoMFC r303799, r303800:
pfg [Tue, 6 Sep 2016 19:53:05 +0000 (19:53 +0000)]
MFC r303799, r303800:
ext2fs: Add defines for some missing ext4 features and inode flags.

These are currently unused in our implementation and some even appear to
have not been implemented yet on linux but it is good to keep them for
reference.

Obtained from: NetBSD

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

7 years agoMFC 304249
davidcs [Tue, 6 Sep 2016 19:29:14 +0000 (19:29 +0000)]
MFC 304249
    Add support for set/get cam search mode

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

7 years agoMFC r394247
davidcs [Tue, 6 Sep 2016 19:27:00 +0000 (19:27 +0000)]
MFC r394247
    Upgrade fw, bootloader and minidump template to version 5.4.58
    Add minidump retrieval code

MFC r394248
    Add ql_minidump.h

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

7 years agoMFC r304674: intpm: add support for SB800
avg [Tue, 6 Sep 2016 06:25:10 +0000 (06:25 +0000)]
MFC r304674: intpm: add support for SB800

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

7 years agoMFC r304520: fix bug introduced in r297521, set canmount=on doesn't
avg [Tue, 6 Sep 2016 06:17:39 +0000 (06:17 +0000)]
MFC r304520: fix bug introduced in r297521, set canmount=on doesn't
mount filesystem

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

7 years agoMFC r303738: report sector size and number of sectors in lsdev output
avg [Tue, 6 Sep 2016 06:13:47 +0000 (06:13 +0000)]
MFC r303738: report sector size and number of sectors in lsdev output
for bios disks

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

7 years agoMFC r305365
ache [Tue, 6 Sep 2016 00:32:33 +0000 (00:32 +0000)]
MFC r305365

The bug:
$ echo x | awk '/[[:cntrl:]]/'
x

The NUL character in cntrl class truncates the pattern, and an empty
pattern matches anything. The patch skips NUL as a quick fix.

PR:     195792
Submitted by:   kdrakehp@zoho.com
Approved by:    bwk@cs.princeton.edu (the author)

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

7 years agoMFC r305269: cron: use existing maximum username constant MAXLOGNAME
emaste [Mon, 5 Sep 2016 15:50:40 +0000 (15:50 +0000)]
MFC r305269: cron: use existing maximum username constant MAXLOGNAME

Previously cron had its own maximum username length limit, which was
smaller than the system's MAXLOGNAME. This could lead to crontab -u
updating the wrong user's crontab (if the name was truncated, and
matched another user).

PR: 212305
Reported by: Andrii Kuzik

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

7 years agoMFC r305241
ache [Mon, 5 Sep 2016 01:57:32 +0000 (01:57 +0000)]
MFC r305241

fgetwc(3) may set both __SEOF and __SERR at once (in case of incomplete
sequence near EOF), so we can't just check for
(wc == WEOF && !__sfeof(fp)) and must relay on __sferror(fp) with
__SERR clearing/restoring.

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

7 years agoMFC r305144
ache [Mon, 5 Sep 2016 00:36:52 +0000 (00:36 +0000)]
MFC r305144

'addrlen' does not matter when we need to find the first non-zero bit in
the byte from the left and 'addrlen' already counted in 'lim'.

PR:     212121
Submitted by:   Herbie.Robinson@stratus.com

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

7 years agoMFC r305219
ache [Sun, 4 Sep 2016 00:34:15 +0000 (00:34 +0000)]
MFC r305219

If error happens, don't overwrite original errno comes from __mbrtowc()
and __srefill().

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

7 years agoMFC r304928:
kib [Sat, 3 Sep 2016 11:09:47 +0000 (11:09 +0000)]
MFC r304928:
Do not obliterate errno value in the main thread during ptrace(2) call on x86.

MFC r304931:
Follow ABI when calling __error from the ptrace(2) wrapper.

MFC r305012:
Rewrite ptrace(2) wrappers in C.

MFC r305022:
Restore the requirement of setting errno to zero before calling ptrace(2).

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

7 years agoMFC r305133
ache [Sat, 3 Sep 2016 01:08:52 +0000 (01:08 +0000)]
MFC r305133

Apply the same qsort() usage fix as in r304911 getaddrinfo.c
qsort() can't be stabilized with just return(-1) alone.

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

7 years agoMFC r305023:
dim [Fri, 2 Sep 2016 17:24:16 +0000 (17:24 +0000)]
MFC r305023:

Avoid undefined behavior when calling va_start() in bnep_send_control(),
by making the 'type' parameter a plain unsigned.

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

7 years agoMFstable/11 r304951:
ngie [Fri, 2 Sep 2016 04:27:02 +0000 (04:27 +0000)]
MFstable/11 r304951:

MFC r303804:

Fix building usr.bin/tar/tests with PIE symbol building enabled by
removing CFLAGS+= -static

`CFLAGS+= -static` was a carryover from pre-r289195 with
usr.bin/tar/test/Makefile that should have been specified in LDFLAGS
There doesn't seem to be an apparent need for static compilation
of the test binaries.

Obtained-from: opBSD (418a491eed20d2603ddd1f1bd92c2c0d95094002)

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

7 years agoMFC r286321:
ngie [Fri, 2 Sep 2016 04:23:26 +0000 (04:23 +0000)]
MFC r286321:
r286321 (by lwhsu):

Fix `make depend` in sys/modules

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

7 years agoMFstable/11 r305271:
ngie [Fri, 2 Sep 2016 04:21:40 +0000 (04:21 +0000)]
MFstable/11 r305271:

MFC r303576:

Conditionalize code which defines sysctls per _KERNEL #ifdef guard

This resolves several issues when compiling libzpool (userspace library), i.e.
-Wimplicit-function-declaration and -Wmissing-declarations issues.

Tested with: clang 3.8.1, gcc 4.2.1, gcc 5.3.0

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

7 years agoMFstable/11 r304950:
ngie [Fri, 2 Sep 2016 04:12:36 +0000 (04:12 +0000)]
MFstable/11 r304950:

MFC r304033:

Increase timeout from 10 minutes to 20 minutes for all tests

On particular slow networks, it can (on average) take longer to
resolve hosts to IP* addresses. 20 minutes seemed reasonable for
my work network

This will be solved in a more meaningful way (if possible) using
concurrency in the near future

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