]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
7 years agoMFC: r304636
jkim [Wed, 31 Aug 2016 20:30:49 +0000 (20:30 +0000)]
MFC: r304636

Build OpenSSL assembly sources for arm.

7 years agoMFC r304315 (by jilles):
kib [Wed, 31 Aug 2016 20:25:37 +0000 (20:25 +0000)]
MFC r304315 (by jilles):
rights(4): CAP_FSYNC also permits fdatasync(2).

7 years agoMFC: r304320
jkim [Wed, 31 Aug 2016 20:21:03 +0000 (20:21 +0000)]
MFC: r304320

Disable assembly sources when compiler/assembler cannot compile certain
instructions.  For example, GCC 4.2.1 + binutils 2.17.50 does not support
AVX instructions.

7 years agoMFC r304969:
dim [Wed, 31 Aug 2016 18:37:04 +0000 (18:37 +0000)]
MFC r304969:

Define hastd's STRICT_ALIGN macro in a defined and portable way.

7 years agoMFC r304953:
dim [Wed, 31 Aug 2016 18:00:41 +0000 (18:00 +0000)]
MFC r304953:

Define ipfilter's SOLARIS macro in a defined and portable way.

Reviewed by: cy
Differential Revision: https://reviews.freebsd.org/D7671

MFC r304959 (by kib):

Complete r304953.

Sponsored by: The FreeBSD Foundation

MFC r304964:

Follow-up to r304953, in which I broke the build: apparently the SOLARIS
macro is defined in lots of different places in ipfilter, so replace all
of the nonportable definitions with portable ones.

Pointy hat to: dim

7 years agoMFC 302847, 302848, 302852, 302853:
andrew [Wed, 31 Aug 2016 17:36:43 +0000 (17:36 +0000)]
MFC 302847, 302848, 302852, 302853:
Remove the remaining non-INTRNG support from the arm64 code.

7 years agoMFC 302789:
andrew [Wed, 31 Aug 2016 17:30:21 +0000 (17:30 +0000)]
MFC 302789:
Add memmmap on arm64 so we can mmap /dev/mem and /dev/kmem.

7 years agoMFC r304751: Fix minor copy/paste bug.
mav [Wed, 31 Aug 2016 09:49:26 +0000 (09:49 +0000)]
MFC r304751:  Fix minor copy/paste bug.

7 years agoMFC r304055:
markj [Wed, 31 Aug 2016 01:26:21 +0000 (01:26 +0000)]
MFC r304055:
Fix handling of forward enum declarations in the CTF tools.

7 years agoMFC r304736:
tuexen [Tue, 30 Aug 2016 19:27:27 +0000 (19:27 +0000)]
MFC r304736:
When aborting an association, send the ABORT before notifying the upper
layer. For the kernel this doesn't matter, for the userland stack, it does.
While there, silence a clang warning when compiling it in userland.

MFC r304837:
Fix a bug, where no SACK is sent when receiving a FORWARD-TSN or
I-FORWARD-TSN chunk before any DATA or I-DATA chunk.

Thanks to Julian Cordes for finding this problem and prividing
packetdrill scripts to reporduce the issue.

7 years agoMFC r304916:
kib [Tue, 30 Aug 2016 13:56:11 +0000 (13:56 +0000)]
MFC r304916:
Consistently delimit each vnode description block with two blank
lines.

7 years agoMFC r304184:
badger [Tue, 30 Aug 2016 13:39:42 +0000 (13:39 +0000)]
MFC r304184:

sem_post(): wake up the sleeper only after adjusting has_waiters

If the caller of sem_post() wakes up a thread sleeping via sem_wait()
before it clears the has_waiters flag, the caller of sem_wait() has no way of
knowing when it is safe to destroy the semaphore and reuse the memory. This is
because the caller of sem_post() may be interrupted between the wake step and
the clearing of has_waiters. It will then write into the has_waiters flag in
userspace after being preempted for some unknown amount of time.

Approved by: vangyzen (mentor)
Sponsored by: Dell Inc.

7 years agoMFC r304911
ache [Tue, 30 Aug 2016 01:01:41 +0000 (01:01 +0000)]
MFC r304911

The formal behavior of qsort is unstable with regard to objects that
are equal. Unfortunately, RFC 3484 requires that otherwise equal objects
remain in the order supplied by the DNS server. The present code attempts
to deal with this by returning -1 for objects that are equal (i.e.,
returns that the first parameter is less then the second parameter).
Unfortunately, the qsort API does not state that the first parameter
passed in is in any particular position in the list.

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

7 years agoMFC r303626 (by gallatin)
hiren [Mon, 29 Aug 2016 18:00:14 +0000 (18:00 +0000)]
MFC r303626 (by gallatin)
Rework IPV6 TCP path MTU discovery to match IPv4.

No objection: gallatin

7 years agoMFC r304747:
cy [Mon, 29 Aug 2016 12:54:46 +0000 (12:54 +0000)]
MFC r304747:

Update from sqlite3-3.12.1 (3120100) to sqlite3-3.14.1 (3140100).

This commit addresses the tmpdir selection vulnerability fixed in
sqlite3-1.13.0.  See VuXML entry 546deeea-3fc6-11e6-a671-60a44ce6887b.

Security: VuXML 546deeea-3fc6-11e6-a671-60a44ce6887b
Security: CVE-2016-6153

7 years agoMFC r304629:
hselasky [Mon, 29 Aug 2016 08:52:53 +0000 (08:52 +0000)]
MFC r304629:
Don't separate the status stage of the XHCI USB control transfers into
its own job because this breaks the simplified QEMU XHCI TRB parser,
which expects the complete USB control transfer as a series of back to
back TRBs. The old behaviour is kept under #ifdef in case this change
breaks enumeration of any USB devices.

PR: 212021

7 years agoMFC r304601:
hselasky [Mon, 29 Aug 2016 08:48:10 +0000 (08:48 +0000)]
MFC r304601:
Increase the maximum RX/TX queue size. This allows for a RX/TX queue
size of 16384 mbufs. Previously the limit was 8192.

Sponsored by: Mellanox Technologies

7 years agoMFC r304597:
hselasky [Mon, 29 Aug 2016 08:39:53 +0000 (08:39 +0000)]
MFC r304597:
Fix for invalid use of bits in input context. Basically split
configuring of EP0 and non-EP0 into xhci_cmd_evaluate_ctx() and
xhci_cmd_configure_ep() respectivly. This resolves some errors when
using XHCI under QEMU and gets is more in line with the XHCI
specification.

PR: 212021

7 years agoMFC r304182 (by ed):
kib [Mon, 29 Aug 2016 06:32:30 +0000 (06:32 +0000)]
MFC r304182 (by ed):
Let CloudABI use fdatasync() as well.

MFC r304185 (by ed):
Eliminate use of sys_fsync() and sys_fdatasync().

7 years agoMFC r304287:
kib [Mon, 29 Aug 2016 05:59:12 +0000 (05:59 +0000)]
MFC r304287:
Add fdatasync(2) man page, combined with fsync(2).

7 years agoMFC r304180:
kib [Mon, 29 Aug 2016 05:53:59 +0000 (05:53 +0000)]
MFC r304180:
Implement VOP_FDATASYNC() for UFS.

7 years agoMFC r303924 (by trasz):
kib [Mon, 29 Aug 2016 05:51:27 +0000 (05:51 +0000)]
MFC r303924 (by trasz):
Eliminate vprint().

7 years agoMFC r304178:
kib [Mon, 29 Aug 2016 05:40:21 +0000 (05:40 +0000)]
MFC r304178:
Implement VOP_FDATASYNC() for msdosfs.

7 years agoMFC r304209:
kib [Mon, 29 Aug 2016 05:37:03 +0000 (05:37 +0000)]
MFC r304209:
The fdatasync(2) call must be cancellation point.

7 years agoRegen
kib [Mon, 29 Aug 2016 05:17:44 +0000 (05:17 +0000)]
Regen

7 years agoMFC r304176:
kib [Mon, 29 Aug 2016 05:15:43 +0000 (05:15 +0000)]
MFC r304176:
Add a trivial implementation of fdatasync(2).

7 years agoMFC r303548:
kib [Mon, 29 Aug 2016 04:45:58 +0000 (04:45 +0000)]
MFC r303548:
Cache getbintime(9) answer in timehands.

7 years agoMFC r303804:
ngie [Sun, 28 Aug 2016 07:19:33 +0000 (07:19 +0000)]
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)

7 years agoMFC r304033:
ngie [Sun, 28 Aug 2016 07:17:25 +0000 (07:17 +0000)]
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

7 years agoMFC r303830,r304693,r304694,r304698:
ngie [Sun, 28 Aug 2016 07:16:11 +0000 (07:16 +0000)]
MFC r303830,r304693,r304694,r304698:

r303830:

Remove vestigal references to __alpha__

Replace alpha reference in getconf(1) with amd64 [*]

PR:   211300 [*]

r304693:

Clean up trailing whitespace

r304694:

Add `MIN_HOLE_SIZE` pathconf(2) support to getconf

This allows shell programs to programmatically determine whether
or not a filesystem supports sparse files

r304698:

Add support for _PC_ACL_NFS4 as TRUSTEDBSD_ACL_NFS4

The TRUSTEDBSD prefix was chosen for consistency with the other
related `_PC_ACL*` prefixed variables.

7 years agoMFC r303900:
ngie [Sun, 28 Aug 2016 07:12:47 +0000 (07:12 +0000)]
MFC r303900:

Highball memory requirement (4GB) with common/{raise,safety}

Both test suites require more memory than my amd64 VM using
GENERIC-NODEBUG can provide and reliably panic it with OOM issues in
dtrace(4).

Some of the testcases fail, but this at least bypasses the panic behavior
on platforms that don't have enough resources

Discussed with: markj

7 years agoMFC r304238:
ngie [Sun, 28 Aug 2016 07:10:48 +0000 (07:10 +0000)]
MFC r304238:

Only expect :encode_tv_random_million to fail on 64-bit platforms

It passes on i386

7 years agoMFC r304040:
ngie [Sun, 28 Aug 2016 07:09:45 +0000 (07:09 +0000)]
MFC r304040:

Redirect the output of the testcases to stderr instead of
redirecting it to /dev/null

This will aid in debugging failures

7 years agoMFC r304034:
ngie [Sun, 28 Aug 2016 07:08:29 +0000 (07:08 +0000)]
MFC r304034:

Initialize `ai` to NULL and test for `ai` with type-appropriate values

Depending on the address family and ai_flags containing AI_V4MAPPED,
it might not do a proper DNS lookup on the provided DNS address

Convert some `ai` boolean true/false checks to NULL/non-NULL while here.

PR: 211790

7 years agoMFC r304050
alc [Sun, 28 Aug 2016 05:18:39 +0000 (05:18 +0000)]
MFC r304050
  Eliminate two calls to vm_page_xunbusy() that are both unnecessary and
  incorrect from the error cases in exec_map_first_page().  They are
  unnecessary because we automatically unbusy the page in vm_page_free()
  when we remove it from the object.  The calls are incorrect because they
  happen after the page is freed, so we might actually unbusy the page
  after it has been reallocated to a different object.  (This error was
  introduced in r292373.)

7 years agoRemove stale items
skreuzer [Sun, 28 Aug 2016 00:21:24 +0000 (00:21 +0000)]
Remove stale items

Approved by: re (gjb, implicit, relnotes)

7 years agoDocument r299142, The leap-seconds file has been updated to
skreuzer [Sun, 28 Aug 2016 00:12:45 +0000 (00:12 +0000)]
Document r299142, The leap-seconds file has been updated to
                  leap-seconds.3676752000
Document r302177, WITH_SYSTEM_COMPILER: Enable by default
Document r304246, PCIe HotPlug: Detect bridges that are not really
                  HotPlug capable
Document r301565, Switch arm64 to use intrng by default
Document r299781, Support for the Allwinner Reduced Serial Bus (RSB)
Document r296064, Support for Allwinner A20 HDMI
Document r299393, Default installation directory for modules is /boot/modules
Document r303716, Drop SSH1 support
Document r303719, Disable DSA by default
Document r297633, RCTL resources for limited filesystem IO
Document r300723, Mellanox implementation of iSER
Document r299848, Allow reroot to NFS
Document r301033, Discovery without attaching support in iscsictl
Document r299371, camcontrol reprobe
Document r295212, Add an additional, libucl-based configuration file parser
                  to ctld
Document r287842, Change default regulatory domain from DEBUG to FCC in ifconfig
Document r301875, The SIOCSIFALIFETIME_IN6 ioctl has been removed

Approved by: re (gjb, implicit, relnotes)

7 years agoDocument r299142, Native PCIe Hotplug support
skreuzer [Sat, 27 Aug 2016 21:32:56 +0000 (21:32 +0000)]
Document r299142, Native PCIe Hotplug support
Document r298166, libucl has been updated to version 0.8.0
Document r302288, Enable indirect segment I/O by default when running on EC2
Document r302265, Allow ZFS ARC min / max to be tuned at runtime

Approved by: re (gjb, implicit, relnotes)

7 years agoMFC r303747,303982
alc [Sat, 27 Aug 2016 21:31:00 +0000 (21:31 +0000)]
MFC r303747,303982
  Correct errors and clean up the comments on the active queue scan.

  Eliminate some unnecessary blank lines.

  Clean up the comments and code style in and around vm_pageout_cluster().
  In particular, fix factual, grammatical, and spelling errors in various
  comments, and remove comments that are out of place in this function.

7 years agoMFC r303877:
skreuzer [Sat, 27 Aug 2016 20:43:52 +0000 (20:43 +0000)]
MFC r303877:

Write kern.randompid to /etc/sysctl.conf

Approved by: allanjude

7 years agoDocument 292120, Update to ELF Tool Chain r3272
skreuzer [Sat, 27 Aug 2016 20:08:34 +0000 (20:08 +0000)]
Document 292120, Update to ELF Tool Chain r3272

Approved by: re (gjb, implicit, relnotes)

7 years agoMFC r304607,r304641,r304819,r304811
ache [Sat, 27 Aug 2016 11:07:57 +0000 (11:07 +0000)]
MFC r304607,r304641,r304819,r304811

1) Don't forget to set __SERR on __slbexpand() error.

2) Remove "Fast path" from fgetwc()/fputwc() since it can't detect
encoding errors and ignores them all.
One of affected encoding example: US-ASCII

3)  Original fgetln() from 44lite return success for line tail errors,
i.e. partial line, but set __SERR and errno in the same time, which
is inconsistent.
Now both OpenBSD and NetBSD return failure, i.e. no line and set error
indicators for such case, so make our fgetln() and fgetwln()
(as its wide version) compatible with the rest of *BSD.

PR:     212033

7 years agoMFC r304810
ache [Sat, 27 Aug 2016 10:00:36 +0000 (10:00 +0000)]
MFC r304810

Don't check for __SERR which may stick from one of any previous stdio
functions.
__SERR is for user and the rest of stdio code do not check it
for error sensing internally, only set it.
In vf(w)printf.c here it is more easy to save __SERR, clear and restore it.

7 years agoMFC r303426:
kib [Sat, 27 Aug 2016 09:23:20 +0000 (09:23 +0000)]
MFC r303426:
Rewrite subr_sleepqueue.c use of callouts to not depend on the
specifics of callout KPI.

7 years agoMFC r303425:
kib [Sat, 27 Aug 2016 09:11:57 +0000 (09:11 +0000)]
MFC r303425:
Add callout_when(9).

MFC r303919:
Fix indentation.

7 years agoMFC r304779, r304780, r304781, r304782, r304802
cy [Sat, 27 Aug 2016 02:53:21 +0000 (02:53 +0000)]
MFC r304779, r304780, r304781, r304782, r304802

r304779:

  Revert r298887 (spelling fix) and remove $FreeBSD$ because text changes
  to leap-seconds invaldidates validation hash at the end of the file.

  Remove svn:keywords and replace with fbsd:nokeywords=yes to
  support this change.

r304780:

  Change the algorithm by which /var/db/leap-seconds is updated.

  1. Use the leap-seconds version number (update time) to determine
     whether to update the file or not.

  2. If the version numbers of the files is the same, use the later
     expiry date to determine which file to use.

  Suggested by: ian@

r304781:

  Add logic to replace the working ntp leap-seconds file in /var/db
  if it contains a $FreeBSD$ header. The header will cause the file
  to fail checksum of the hash causing ntpd to ignore the file.

r304782:

  Make validation of the leap-seconds file unconditional.

r304802:

  Remove the gratuitous check for $FreeBSD$ and rename the function
  to ntpd_init_leapfile, to ensure a copy exists in /var/db if a copy
  isn't already there.

  Reported by: ache@

7 years agoMFC r304721:
cy [Sat, 27 Aug 2016 02:27:29 +0000 (02:27 +0000)]
MFC r304721:

Fixup man page formatting.

Submitted by: Steve Kargl <sgk@troutmask.apl.washington.edu>
Discussed with: bjk@

7 years agoBump __FreeBSD_version after LC_*_MASK fix
ache [Fri, 26 Aug 2016 21:28:24 +0000 (21:28 +0000)]
Bump __FreeBSD_version after LC_*_MASK fix

7 years agoMFC r304703, r304755
ache [Fri, 26 Aug 2016 21:23:38 +0000 (21:23 +0000)]
MFC r304703, r304755

1) _locale.h
LC_*_MASK bit shifting order was partially broken from the initial commit
time at year 2012. Only LC_COLLATE_MASK and LC_CTYPE_MASK are in the
right order.

The order here should match XLC_* from "xlocale_private.h" which, in turn,
match LC_* publicly visible order from <locale.h> which determines how
locale components are stored in the structure.
LC_*_MASK -> XLC_* translation done as "ffs(mask) - 1" in the querylocale()
and equivalent shift loop in the newlocale(), so mapped to some wrong
components (excluding two mentioned above).

Formally the fix is ABI breakage, but old code using those masks
never works properly in any case.
Only newlocale() and querylocale() are affected.

2) msgcat.c
Use current locale (f.e. set by thread). It was global locale always
previously.

PR:     211743

7 years agoMFC r304342:
hselasky [Fri, 26 Aug 2016 12:04:31 +0000 (12:04 +0000)]
MFC r304342:
Add support for setting blocking and non-blocking mode on /dev/rdma_cm
by returning success on FIONBIO and FIOASYNC IOCTLs. The actual flags
handling is done by the kern_ioctl() function.

Reported by: Alex Bowden <alex.bowden@outlook.com>
Sponsored by: Mellanox Technologies

7 years agoMFC r303388:
kib [Fri, 26 Aug 2016 10:06:24 +0000 (10:06 +0000)]
MFC r303388:
Remove Giant from settime().

7 years agoMFC r303382:
kib [Fri, 26 Aug 2016 10:04:10 +0000 (10:04 +0000)]
MFC r303382:
Provide the getboottime(9) and getboottimebin(9) KPI.

MFC r303387:
Prevent parallel tc_windup() calls.  Keep boottime in timehands,
and adjust it from tc_windup().

MFC notes:

The boottime and boottimebin globals are still exported from
the kernel dyn symbol table in stable/11, but their declarations are
removed from sys/time.h.  This preserves KBI but not KPI, while all
in-tree consumers are converted to getboottime().

The variables are updated after tc_setclock_mtx is dropped, which gives
approximately same unlocked bugs as before.

The boottime and boottimebin locals in several sys/kern_tc.c functions
were renamed by adding the '_x' suffix to avoid name conficts.

7 years agoMFC r303386:
kib [Fri, 26 Aug 2016 09:42:51 +0000 (09:42 +0000)]
MFC r303386:
Change ntpadj_lock to spinlock always.
Add missed lock to ntp_update_second().

7 years agoMFC r303385:
kib [Fri, 26 Aug 2016 09:40:34 +0000 (09:40 +0000)]
MFC r303385:
Reduce the resettodr_lock scope to only CLOCK_SETTIME() call.

7 years agoMFC r303384:
kib [Fri, 26 Aug 2016 09:38:25 +0000 (09:38 +0000)]
MFC r303384:
Style.

7 years agoMFC r303383:
kib [Fri, 26 Aug 2016 09:36:45 +0000 (09:36 +0000)]
MFC r303383:
Reduce number of timehands to just two.

7 years agoMFC 303766
sephe [Fri, 26 Aug 2016 05:37:44 +0000 (05:37 +0000)]
MFC 303766
    tcp/lro: If timestamps mismatch or it's a FIN, force flush.

    This keeps the segments/ACK/FIN delivery order.

    Before this patch, it was observed: if A sent FIN immediately after
    an ACK, B would deliver FIN first to the TCP stack, then the ACK.
    This out-of-order delivery causes one unnecessary ACK sent from B.

    Reviewed by:    gallatin, hps
    Obtained from:  rrs, gallatin
    Sponsored by:   Netflix (rrs, gallatin), Microsoft (sephe)
    Differential Revision:  https://reviews.freebsd.org/D7415

7 years agoMFC r304543:
tuexen [Thu, 25 Aug 2016 09:16:25 +0000 (09:16 +0000)]
MFC r304543:
Unbreak sctp_connectx().

MFC r304573:
Remove duplicate code, which is not protected by the appropriate locks.

MFC r304579:
Improve the locking when sending user messages.

First, keep a ref count on the stcb after looking it up, as
done in the other lookup cases.
Second, before looking again at sp, ensure that it is not
freed, because the assoc is about to be freed.

7 years agoMFC r304286:
kib [Wed, 24 Aug 2016 09:18:38 +0000 (09:18 +0000)]
MFC r304286:
Remove duplicated code.

7 years agoMFC r304697:
bdrewery [Wed, 24 Aug 2016 02:23:03 +0000 (02:23 +0000)]
MFC r304697:

  FAST_DEPEND: Fix 'make all install' not properly rebuilding based on
  .depend.* files.

7 years agoMFC r304322:
bdrewery [Wed, 24 Aug 2016 01:44:53 +0000 (01:44 +0000)]
MFC r304322:

  [net80211] correctly lock the ifp before accessing the lladdr.

7 years agoMFC r304643:
bdrewery [Wed, 24 Aug 2016 01:34:22 +0000 (01:34 +0000)]
MFC r304643:

  Fix building on read-only source trees.

PR: 211952

7 years agoMFC r304021: Update iflib to support more NIC designs
shurd [Tue, 23 Aug 2016 21:21:56 +0000 (21:21 +0000)]
MFC r304021: Update iflib to support more NIC designs

- Move group task queue into kern/subr_gtaskqueue.c
- Change intr_enable to return an int so it can be detected if it's not
  implemented
- Allow different TX/RX queues per set to be different sizes
- Don't split up TX mbufs before transmit
- Allow a completion queue for TX as well as RX
- Pass the RX budget to isc_rxd_available() to allow an earlier return
  and avoid multiple calls

Approved by: sbruno

7 years agoMFC r304232:
kib [Tue, 23 Aug 2016 07:32:12 +0000 (07:32 +0000)]
MFC r304232:
In UFS_BALLOC(), invalidate pages of indirect buffers on failed block
allocation unwinding.

7 years agoMFC r304231:
kib [Tue, 23 Aug 2016 07:30:20 +0000 (07:30 +0000)]
MFC r304231:
On unwind after failed block allocation in ffs_balloc_ufs{1,2}, assert
that recorded allocated blocks numbers match the physical block numbers
of dandling buffers which are released.
When finally freeing the blocks during unwind, assert that dandling
buffers where not re-allocated.

7 years agoMFC r304229:
kib [Tue, 23 Aug 2016 07:27:38 +0000 (07:27 +0000)]
MFC r304229:
When looking up dandling buffers for unwing after failing block
allocation in UFS_BALLOC(), there is no need to map them.

7 years agoMFC r304228:
kib [Tue, 23 Aug 2016 07:25:39 +0000 (07:25 +0000)]
MFC r304228:
When block allocation fails in UFS_BALLOC(), and the volume does not
have SU enabled, there is no point in calling softdep_request_cleanup().

7 years agoMFC r304227:
kib [Tue, 23 Aug 2016 07:23:50 +0000 (07:23 +0000)]
MFC r304227:
In ffs_balloc_ufs{1,2} routines, assert that unwind records do not
overflow local arrays.

7 years agoMFC r304521: JMicron JMB361 has only a single SATA port
avg [Tue, 23 Aug 2016 07:02:50 +0000 (07:02 +0000)]
MFC r304521: JMicron JMB361 has only a single SATA port

7 years agoMFC r304530:
dim [Tue, 23 Aug 2016 05:22:03 +0000 (05:22 +0000)]
MFC r304530:

Pull in r265122 from upstream llvm trunk (by James Molloy):

  Fix for pr24346: arm asm label calculation error in sub

  Some ARM instructions encode 32-bit immediates as a 8-bit integer
  (0-255) and a 4-bit rotation (0-30, even) in its least significant 12
  bits. The original fixup, FK_Data_4, patches the instruction by the
  value bit-to-bit, regardless of the encoding. For example, assuming
  the label L1 and L2 are 0x0 and 0x104 respectively, the following
  instruction:

    add r0, r0, #(L2 - L1) ; expects 0x104, i.e., 260

  would be assembled to the following, which adds 1 to r0, instead of
  260:

    e2800104 add r0, r0, #4, 2 ; equivalently 1

  The new fixup kind fixup_arm_mod_imm takes care of the encoding:

    e2800f41 add r0, r0, #260

  Patch by Ting-Yuan Huang!

This fixes label calculation for ARM assembly, and is needed to enable
ARM assembly sources for OpenSSL.

Requested by: jkim

7 years agoMFC 304476: Fix various nits in the aio operation manpages.
jhb [Mon, 22 Aug 2016 17:52:10 +0000 (17:52 +0000)]
MFC 304476: Fix various nits in the aio operation manpages.

- Avoid double use of "request" in a single sentence.  Instead, describe
  aio_sigevent as being used to request notification of the associated
  operation's completion.  This matches the language used to describe
  aio_sigevent in aio(4).
- Simplify the prohibition on modifying buffers while requests are in
  flight.
- Fix case mismatch.
- Drop note about not using stack variables. C programmers should be able
  to figure out if a stack variable is safe based on the later warning
  about the life cycle requirements of control blocks.
- Remove prohibition on modifying the I/O buffer for aio_fsync() since
  it does not use an I/O buffer.  For aio_mlock(), prohibit modifications
  to the mapping (e.g. due to mprotect, munmap, mmap, etc.) but do not
  prohibit modifications to the memory backing the buffer (stores into
  the pages backing the buffer).

7 years agoMFC r304440, r304487:
markj [Mon, 22 Aug 2016 17:23:27 +0000 (17:23 +0000)]
MFC r304440, r304487:
Fix some handling of P2_PTRACE_FSTP.

7 years agoMFC r304608:
bdrewery [Mon, 22 Aug 2016 15:53:32 +0000 (15:53 +0000)]
MFC r304608:

  Bump __FreeBSD_version for C++11 thread_local support in r303795.

PR:         192320

7 years agoMFC r304174:
kib [Mon, 22 Aug 2016 07:25:09 +0000 (07:25 +0000)]
MFC r304174:
VOP_FSYNC() does not take cred as an argument.  Correct comment.

7 years agoImport Dragonfly Mail Agent snapshort from 20160806 aka v0.11+
bapt [Mon, 22 Aug 2016 07:08:00 +0000 (07:08 +0000)]
Import Dragonfly Mail Agent snapshort from 20160806 aka v0.11+

Most important change being:
dma - Fix security hole

Affecting DragonFly 4.6 and earlier, Matt Dillon fixed this in base after
finding out from BSDNow Episode 152. Comments following were from his commit
which explains better than I. Just taking his change and putting it here as well.

* dma makes an age-old mistake of not properly checking whether a file
owned by a user is a symlink or not, a bug which the original mail.local
also had.

* Add O_NOFOLLOW to disallow symlinks.
Thanks-to: BSDNow Episode 152, made me dive dma to check when they talked
about the mail.local bug.

7 years agoMFC 304251
sephe [Mon, 22 Aug 2016 02:23:05 +0000 (02:23 +0000)]
MFC 304251

    hyperv/storvsc: Deliver CAM_SEL_TIMEOUT upon SRB status error.

    SRB status is set to 0x20 by the hypervisor, if the specified LUN is
    unaccessible, and even worse the INQUIRY response will not be set by
    the hypervisor at all under this situation.  Additionally, SRB status
    is 0x20 too, for TUR on an unaccessible LUN.

    Deliver CAM_SEL_TIMEOUT to CAM upon SRB status errors as suggested by
    Scott Long, other values seems improper.

    This commit fixes the Hyper-V disk hotplug support.

    Submitted by:   Hongjiang Zhang <honzhan microsoft com>
    Sponsored by:   Microsoft
    Differential Revision:  https://reviews.freebsd.org/D7521

7 years agoMFC r304313:
ae [Sun, 21 Aug 2016 17:26:16 +0000 (17:26 +0000)]
MFC r304313:
  Teach netisr_get_cpuid() to limit a given value to supported by netisr.
  Use netisr_get_cpuid() in netisr_select_cpuid() to limit cpuid value
  returned by protocol to be sure that it is not greather than nws_count.

  PR: 211836

7 years agoMFC r304077:
manu [Sun, 21 Aug 2016 15:45:12 +0000 (15:45 +0000)]
MFC r304077:

Correct the size of the softc in a10_ehci

Reported by: andrew

7 years agoMFC r304545: Disable L2 caching for UDP over IPv6
karels [Sat, 20 Aug 2016 20:56:36 +0000 (20:56 +0000)]
MFC r304545: Disable L2 caching for UDP over IPv6

The ip6_output routine is missing L2 cache invalication as done
in ip_output.  Even with that code, some problems with UDP over
IPv6 have been reported.  Diabling L2 cache for that problem works
around the problem for now.

PR: 211872 211926
Reviewed by: gnn
Approved by: gnn (mentor)
Tested by: peter@, Mike Andrews
MFC after: immediate

7 years agoMFC r304319:
dim [Sat, 20 Aug 2016 12:49:05 +0000 (12:49 +0000)]
MFC r304319:

Pull in r262772 from upstream clang trunk (by Simon Pilgrim):

  [X86] AMD Bobcat CPU (btver1) doesn't support XSAVE

  btver1 is a SSSE3/SSE4a only CPU - it doesn't have AVX and doesn't
  support XSAVE.

  Differential Revision: http://reviews.llvm.org/D17682

Pull in r262782 from upstream llvm trunk (by Simon Pilgrim):

  [X86] AMD Bobcat CPU (btver1) doesn't support XSAVE

  btver1 is a SSSE3/SSE4a only CPU - it doesn't have AVX and doesn't
  support XSAVE.

  Differential Revision: http://reviews.llvm.org/D17683

This ensures clang does not emit AVX instructions for CPUTYPE=btver1.

Reported by: Michel Depeige <demik+freebsd@lostwave.net>
PR: 211864

7 years agoMFC r303795:
kib [Sat, 20 Aug 2016 11:58:23 +0000 (11:58 +0000)]
MFC r303795:
Add __cxa_thread_atexit(3) API implementation.

7 years agoMFC r303794:
kib [Sat, 20 Aug 2016 11:54:11 +0000 (11:54 +0000)]
MFC r303794:
Create namespace for the symbols added during 12-CURRENT cycle.

7 years agoMFC r304292:
tuexen [Sat, 20 Aug 2016 07:44:41 +0000 (07:44 +0000)]
MFC r304292:
Use names for SCTP and UDPLite when reporting the input histogram.

MFC r304295:
Fix the output for scope statistics.

7 years agoMFC r303147
pfg [Sat, 20 Aug 2016 02:14:14 +0000 (02:14 +0000)]
MFC r303147
binutils: fix "Bad value" error in bfd for MIPS when using -Bsymbolic.

From OpenBSD's log:

Inspired by https://sourceware.org/ml/binutils/2010-08/msg00333.html,
but expressed differently so there are no GPLv3 issues.

Obtained from: OpenBSD (CVS rev. 1.7)

7 years agoMFC r303062, r303567, r303593:
pfg [Sat, 20 Aug 2016 02:06:59 +0000 (02:06 +0000)]
MFC r303062, r303567, r303593:
MFV r298167, r300962, r303048:
openresolv(8): update to version 3.8.1.

Among the new features it attempts to support alternative init systems.

7 years agoMFC r304288:
bdrewery [Sat, 20 Aug 2016 00:34:19 +0000 (00:34 +0000)]
MFC r304288:

  Garbage collect _umtx_lock(2)/_umtx_unlock(2) references removed in r263318.

7 years agoMFC 304018: Add defines needed to export SMBIOS serial numbers
jhb [Fri, 19 Aug 2016 23:31:56 +0000 (23:31 +0000)]
MFC 304018: Add defines needed to export SMBIOS serial numbers

Some defines needed for exporting serial numbers from the SMBIOS were
missed during integration of SMBIOS support in the EFI boot loader (r281138).
This is needed for getting the hostid set from the system hardware UUID.

PR: 206031

7 years agoMFC 303001: Add PTRACE_VFORK to trace vfork events.
jhb [Fri, 19 Aug 2016 20:17:57 +0000 (20:17 +0000)]
MFC 303001: Add PTRACE_VFORK to trace vfork events.

First, PL_FLAG_FORKED events now also set a PL_FLAG_VFORKED flag when
the new child was created via vfork() rather than fork().  Second, a
new PL_FLAG_VFORK_DONE event can now be enabled via the PTRACE_VFORK
event mask.  This new stop is reported after the vfork parent resumes
due to the child calling exit or exec.  Debuggers can use this stop to
reinsert breakpoints in the vfork parent process before it resumes.

7 years agoMFC r303354,303373,303404,304045,304192
bapt [Fri, 19 Aug 2016 19:26:16 +0000 (19:26 +0000)]
MFC r303354,303373,303404,304045,304192

Set date and time formats back to what they were before CLDR

While CLDR brings us a good and up to date source data to generate locales for
all databses we are using for locales, it is not the case of LC_TIME. Where it
does not defines the informations we need.

Put back all the date and time formats from the old locales.
Make it statically for now (in order to be able to merge it now into
11.0-RELEASE). The generation tools will be updated soon.

That gives us time to properly work on LC_TIME during the 12 timeframe.

While here fix abbreviated month for af_ZA (which are already fixed in CLDR
data upstream)

In locales where AP/PM was not defined before CLDR data, remove again the AP/PM
informations

For locales where AP/PM was defined before CLDR data, keep the CLDR information
which was properly translated.

r303354,303373 by kevlo
r303404,304192 by jkim

7 years agoMFC r304217:
bdrewery [Fri, 19 Aug 2016 17:03:14 +0000 (17:03 +0000)]
MFC r304217:

  Trim unneeded bootstrap after r301470 made 9.1 the minimum supported release.

7 years agoMFC r304008:
bdrewery [Fri, 19 Aug 2016 17:02:14 +0000 (17:02 +0000)]
MFC r304008:

  Avoid taking PROC_LOCK in syscalls if not being traced.

7 years agoMFC r304006:
bdrewery [Fri, 19 Aug 2016 17:01:13 +0000 (17:01 +0000)]
MFC r304006:

  Avoid showing the bootstrap make command for check-old, etc.

7 years agoMFC r304005:
bdrewery [Fri, 19 Aug 2016 16:59:01 +0000 (16:59 +0000)]
MFC r304005:

  PORTS_MODULES: Don't leak in CC/CXX/CPP.

7 years agoMFC r303929,r303930,r303931,r303932,r303933:
bdrewery [Fri, 19 Aug 2016 16:56:52 +0000 (16:56 +0000)]
MFC r303929,r303930,r303931,r303932,r303933:

  r303929:
    Fix -S with -b not atomically updating the destination file.
  r303930:
    Support -v for -l.
  r303931:
    Fix -S with -l not being atomic.
  r303932:
    Fix -b failure not restoring flags on the destination file.
  r303933:
    Squelch a false-positive Clang static analyzer warning.

7 years agoMFC r304152:
kp [Fri, 19 Aug 2016 11:31:30 +0000 (11:31 +0000)]
MFC r304152:

pf: Add missing byte-order swap to pf_match_addr_range

Without this, rules using address ranges (e.g. "10.1.1.1 - 10.1.1.5") did not
match addresses correctly on little-endian systems.

PR:       211796
Obtained from:    OpenBSD (sthen)

7 years agoMFC r304016:
kib [Fri, 19 Aug 2016 08:00:48 +0000 (08:00 +0000)]
MFC r304016:
Move defines common between rtld and libsysdecode into the header.

7 years agoMFC r304012:
kib [Fri, 19 Aug 2016 07:59:00 +0000 (07:59 +0000)]
MFC r304012:
Fill phdr and phsize for rtld object.

7 years agoMFC r304011:
kib [Fri, 19 Aug 2016 07:57:43 +0000 (07:57 +0000)]
MFC r304011:
Remove all remaining uses of TAILQ_FOREACH_FROM() from rtld-elf.

7 years agoMFC r303991:
kib [Fri, 19 Aug 2016 07:56:07 +0000 (07:56 +0000)]
MFC r303991:
Decode 32bit utrace records on the 64bit host.

7 years agoMFC r303990:
kib [Fri, 19 Aug 2016 07:48:32 +0000 (07:48 +0000)]
MFC r303990:
Remove unused prototypes.