]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
5 years agoMFC r338573: Add vt(4) INDEX.fonts
emaste [Mon, 24 Sep 2018 18:41:32 +0000 (18:41 +0000)]
MFC r338573: Add vt(4) INDEX.fonts

PR: 231237
Submitted by: Martin <martin.jakob@gmx.com> (original version)

5 years agoMFC r338724:
markj [Mon, 24 Sep 2018 14:48:27 +0000 (14:48 +0000)]
MFC r338724:
Fix an nvpair leak in vdev_geom_read_config().

PR: 230704

5 years agoMFC r338733:
kib [Mon, 24 Sep 2018 10:03:37 +0000 (10:03 +0000)]
MFC r338733:
Do not upgrade the vnode lock to call getinoquota().

5 years agoMFC r338711:
kib [Mon, 24 Sep 2018 09:57:47 +0000 (09:57 +0000)]
MFC r338711:
Make the PTI violation check to follow style of the SMAP check.

5 years agoMFC r338699:
kib [Sun, 23 Sep 2018 09:53:09 +0000 (09:53 +0000)]
MFC r338699:
Remove unneeded new line from the panic string.

5 years agoMFC r338801:
kib [Sat, 22 Sep 2018 16:19:21 +0000 (16:19 +0000)]
MFC r338801:
amd64 pmap: remove tautological assert.

5 years agoRevert MFC of r334231 in r338871.
erj [Fri, 21 Sep 2018 23:54:01 +0000 (23:54 +0000)]
Revert MFC of r334231 in r338871.

It did not apply cleanly and was causing build errors.

5 years agoMFC r334231, r334779, r335322, and r338208 to stable/11 from head
erj [Fri, 21 Sep 2018 23:31:04 +0000 (23:31 +0000)]
MFC r334231, r334779, r335322, and r338208 to stable/11 from head

These include:
r334231: iflib: Add new shared flag: IFLIB_ADMIN_ALWAYS_RUN
r334779: iflib: Record TCP checksum info in iflib when TCP checksum is requested
r335322: iflib: Style fixes
r338208: if_media: Add new 2.5G/5G/25G/40G/50G/100G/200G/400G media types

Sponsored by: Intel Corporation

5 years agoInclude stdbool.h so that we can use bool in linker.h.
markj [Fri, 21 Sep 2018 21:15:43 +0000 (21:15 +0000)]
Include stdbool.h so that we can use bool in linker.h.

As asf(8) is gone in head, this is a direct commit to stable/11.

5 years agoMFC r338211:
markj [Fri, 21 Sep 2018 20:40:37 +0000 (20:40 +0000)]
MFC r338211:
Prepare the kernel linker to handle PC-relative ifunc relocations.

5 years agoMFC r338754:
gjb [Fri, 21 Sep 2018 15:58:08 +0000 (15:58 +0000)]
MFC r338754:
 Update the pkg-stage.sh script used to populate packages on the
 dvd1.iso installation medium from including KDE4 to KDE5, as the
 KDE4-based ports have been marked as deprecated in the Ports
 Collection.

Sponsored by: The FreeBSD Foundation

5 years agoMFC 337270: Install the 32-bit compat sanitizer libraries.
jhb [Thu, 20 Sep 2018 16:43:58 +0000 (16:43 +0000)]
MFC 337270: Install the 32-bit compat sanitizer libraries.

The lib32 build was already building the i386 version of
the clang sanitizers (libclang_rt) but they were not being
installed.  This enables the installation.

MK_TOOLCHAIN=no was originally added to the install make
environment to disable includes so that NO_INCS could be
removed.  The MK_TOOLCHAIN in bsd.incs.mk was subsequently
renamed to MK_INCLUDES, but bsd.lib.mk doesn't even include
bsd.incs.mk when LIBRARIES_ONLY is defined which the install
make environment for compat libs now defines.  However,
setting MK_TOOLCHAIN=no forced MK_CLANG=no which disabled
libclang_rt during the install32 phase.  Remove MK_TOOLCHAIN=no
since LIBRARIES_ONLY is now sufficient.

Since the libcompat environment overrides both LIBDIR and
SHLIBDIR, libclang_rt/Makefile.inc has to set both variables
to force the libraries to be installed to the location
expected by the compiler.

5 years agoMFC r338600:
mm [Wed, 19 Sep 2018 09:41:33 +0000 (09:41 +0000)]
MFC r338600:
Update libarchive to 3.3.3

As all important changes have already been merged from libarchive git
this is just a version number bump, documentation update and some
polishing for cpio tests. Other source code changes are not relevant to
FreeBSD.

Relnotes: yes

5 years agoMFC r338679:
hselasky [Wed, 19 Sep 2018 08:11:44 +0000 (08:11 +0000)]
MFC r338679:
Improve LibUSB debugging by simultaneously allowing both function
and transfer prints. Make sure the debug level comes from the
correct USB context.

Found by: Ludovic Rousseau <ludovic.rousseau+freebsd@gmail.com>
PR: 231264
Sponsored by: Mellanox Technologies

5 years agoMFC r338616:
hselasky [Wed, 19 Sep 2018 07:56:19 +0000 (07:56 +0000)]
MFC r338616:
Fix issues about cancelling USB transfers in LibUSB when the USB device has
been detached. When a USB device has been detached the kernel file handle
stops responding to commands. USB applications which continue to run after
the USB device has been detached, depend on LibUSB generated events to tear
down its pending USB transfers. Add code to handle the needed cleanup when
processing the USB transfer(s) fails and prevent new USB transfer(s) from
being submitted.

Found by: Ludovic Rousseau <ludovic.rousseau+freebsd@gmail.com>
PR: 231076
Sponsored by: Mellanox Technologies

5 years agoMFC r309748 (by glebius):
dim [Tue, 18 Sep 2018 20:46:55 +0000 (20:46 +0000)]
MFC r309748 (by glebius):

Treat R_X86_64_PLT32 relocs as R_X86_64_PC32.

If we load a binary that is designed to be a library, it produces
relocatable code via assembler directives in the assembly itself
(rather than compiler options).  This emits R_X86_64_PLT32 relocations,
which are not handled by the kernel linker.

Submitted by: gallatin
Reviewed by: kib
PR: 231451

5 years agoMFC r338697:
dim [Tue, 18 Sep 2018 07:29:01 +0000 (07:29 +0000)]
MFC r338697:

Pull in r325478 from upstream clang trunk (by Ivan A. Kosarev):

  [CodeGen] Initialize large arrays by copying from a global

  Currently, clang compiles explicit initializers for array elements
  into series of store instructions. For large arrays of built-in types
  this results in bloated output code and significant amount of time
  spent on the instruction selection phase. This patch fixes the issue
  by initializing such arrays with global constants that store the
  binary image of the initializer.

  Differential Revision: https://reviews.llvm.org/D43181

This should fix a compiler hang (and excessive memory usage) while
building the science/rmg port.

Reported by: yuri@tsoft.com
See also: https://bugs.llvm.org/show_bug.cgi?id=38798

5 years agorevert r338726 (getdirentries capsicum addition)
emaste [Mon, 17 Sep 2018 18:46:30 +0000 (18:46 +0000)]
revert r338726 (getdirentries capsicum addition)

Compat getdirentries was added with the ino64 project and is not needed
in stable/11.  I MFC'd r335900 accidentally as a side effect of some
other WIP.

PR: 228671

5 years agoMFC 335913:
jhb [Mon, 17 Sep 2018 18:45:16 +0000 (18:45 +0000)]
MFC 335913:
Use 'e' instead of 'i' constraints with 64-bit atomic operations on amd64.

The ADD, AND, OR, and SUB instructions take at most a 32-bit
sign-extended immediate operand.  64-bit constants that do not fit into
that constraint need to be loaded into a register.  The 'i' constraint
tells the compiler it can pass any integer constant to the assembler,
whereas the 'e' constrain only permits constants that fit into a 32-bit
sign-extended value.  This fixes using
atomic_add/clear/set/subtract_long/64 with constants that do not fit into
a 32-bit sign-extended immediate.

5 years agoMFC r335900 (oshogbo): capsicum: add getdirentries to the freebsd32 compact
emaste [Mon, 17 Sep 2018 18:36:29 +0000 (18:36 +0000)]
MFC r335900 (oshogbo): capsicum: add getdirentries to the freebsd32 compact

There is a getdirentries syscall in freebsd32 and it's
capability ready so allow calling it in the capability mode.

PR: 228671

5 years agoMFC r338689:
dim [Mon, 17 Sep 2018 14:53:03 +0000 (14:53 +0000)]
MFC r338689:

Pull in r335365 from upstream llvm trunk (by Krzysztof Parzyszek):

  Initialize LiveRegs once in BranchFolder::mergeCommonTails

This should fix '(TRI && "LivePhysRegs is not initialized."' assertions
when building the lang/qt5-qml port in certain configurations.

Reported by: Piotr Kubaj <pkubaj@anongoth.pl>
PR: 231355

5 years agoMFC r338613:
hselasky [Mon, 17 Sep 2018 11:24:16 +0000 (11:24 +0000)]
MFC r338613:
Fix for backends which doesn't support capsicum.

Not all libpcap backends use the BPF compatible set
of IOCTLs. For example the mlx5 backend uses libibverbs
which is currently not capsicum compatible.

Disable sandboxing for such backends.

Discussed with: emaste@
Sponsored by: Mellanox Technologies

5 years agoMFC r337992, r338125:
pfg [Mon, 17 Sep 2018 02:51:08 +0000 (02:51 +0000)]
MFC r337992, r338125:
POSIX compliance improvements in the pthread(3) functions.

This basically adds makes use of the C99 restrict keyword, and also
adds some 'const's to four threading functions: pthread_mutexattr_gettype(),
pthread_mutexattr_getprioceiling(), pthread_mutexattr_getprotocol(), and
pthread_mutex_getprioceiling. The changes are in accordance to POSIX/SUSv4-2018.

Hinted by: DragonFlyBSD

Relnotes: yes

5 years agoRevert r338695: it depends on r334032, which was not MFCed.
markj [Sat, 15 Sep 2018 18:47:07 +0000 (18:47 +0000)]
Revert r338695: it depends on r334032, which was not MFCed.

PR: 231064

5 years agoMFC r338538:
markj [Sat, 15 Sep 2018 18:02:28 +0000 (18:02 +0000)]
MFC r338538:
Exclude the EFI framebuffer from phys_avail[] on arm64.

PR: 231064

5 years agoMFC r338537, r338539:
markj [Sat, 15 Sep 2018 18:01:15 +0000 (18:01 +0000)]
MFC r338537, r338539:
Bump MAX_HWCNT and MAX_EXCNT.

5 years agoMFC r338534:
kib [Sat, 15 Sep 2018 13:07:43 +0000 (13:07 +0000)]
MFC r338534:
intelspi: don't leak spibus children on detach.

5 years agoMFC r333454: Skip setting the MTU for ENA if it is not changing
mw [Sat, 15 Sep 2018 09:03:50 +0000 (09:03 +0000)]
MFC r333454: Skip setting the MTU for ENA if it is not changing

Sponsored by: Amazon, Inc.

5 years agoMFC 332454,334009,334122: Various fixes for x86 debug exceptions.
jhb [Fri, 14 Sep 2018 23:21:52 +0000 (23:21 +0000)]
MFC 332454,334009,334122: Various fixes for x86 debug exceptions.

332454:
Fix PSL_T inheritance on exec for x86.

The miscellaneous x86 sysent->sv_setregs() implementations tried to
migrate PSL_T from the previous program to the new executed one, but
they evaluated regs->tf_eflags after the whole regs structure was
bzeroed.  Make this functional by saving PSL_T value before zeroing.

Note that if the debugger is not attached, executing the first
instruction in the new program with PSL_T set results in SIGTRAP, and
since all intercepted signals are reset to default dispostion on
exec(2), this means that non-debugged process gets killed immediately
if PSL_T is inherited.  In particular, since suid images drop
P_TRACED, attempt to set PSL_T for execution of such program would
kill the process.

Another issue with userspace PSL_T handling is that it is reset by
trap().  It is reasonable to clear PSL_T when entering SIGTRAP
handler, to allow the signal to be handled without recursion or
delivery of blocked fault.  But it is not reasonable to return back to
the normal flow with PSL_T cleared.  This is too late to change, I
think.

334009:
Cleanups related to debug exceptions on x86.

- Add constants for fields in DR6 and the reserved fields in DR7.  Use
  these constants instead of magic numbers in most places that use DR6
  and DR7.
- Refer to T_TRCTRAP as "debug exception" rather than a "trace trap"
  as it is not just for trace exceptions.
- Always read DR6 for debug exceptions and only clear TF in the flags
  register for user exceptions where DR6.BS is set.
- Clear DR6 before returning from a debug exception handler as
  recommended by the SDM dating all the way back to the 386.  This
  allows debuggers to determine the cause of each exception.  For
  kernel traps, clear DR6 in the T_TRCTRAP case and pass DR6 by value
  to other parts of the handler (namely, user_dbreg_trap()).  For user
  traps, wait until after trapsignal to clear DR6 so that userland
  debuggers can read DR6 via PT_GETDBREGS while the thread is stopped
  in trapsignal().

334122:
x86: stop unconditionally clearing PSL_T on the trace trap.

We certainly should clear PSL_T when calling the SIGTRAP signal
handler, which is already done by all x86 sendsig(9) ABI code.  On the
other hand, there is no obvious reason why PSL_T needs to be cleared
when returning from the signal handler.  For instance, Linux allows
userspace to set PSL_T and keep tracing enabled for the desired
period.  There are userspace programs which would use PSL_T if we make
it possible, for instance sbcl.

Remember if PSL_T was set by PT_STEP or PT_SETSTEP by mean of TDB_STEP
flag, and only clear it when the flag is set.

5 years agoMFC r338522, r338523, r338533:
kib [Fri, 14 Sep 2018 14:06:33 +0000 (14:06 +0000)]
MFC r338522, r338523, r338533:
Teach sysctl(8) about the Persistent memory type.
Improve nearby code.

5 years agoMFC r338528:
markj [Fri, 14 Sep 2018 01:52:34 +0000 (01:52 +0000)]
MFC r338528:
Specify the correct resource type in teardown paths.

5 years agoDocument SA-18:12 and EN-18:08.
gjb [Thu, 13 Sep 2018 15:55:22 +0000 (15:55 +0000)]
Document SA-18:12 and EN-18:08.

Sponsored by: The FreeBSD Foundation

5 years agoMFC: r333647, r338275, r338280, r338513
marius [Thu, 13 Sep 2018 10:18:47 +0000 (10:18 +0000)]
MFC: r333647, r338275, r338280, r338513

- If present, take advantage of the R/W cache of eMMC revision 1.5 and
  later devices. These caches work akin to the ones found in HDDs/SSDs
  that ada(4)/da(4) also enable if existent, but likewise increase the
  likelihood of data loss in case of a sudden power outage etc. On the
  other hand, write performance is up to twice as high for e. g. 1 GiB
  files depending on the actual chip and transfer mode employed.
  For maximum data integrity, the usage of eMMC caches can be disabled
  via the hw.mmcsd.cache tunable.
- Get rid of the NOP mmcsd_open().
- Obtain the bus mode (MMC or SD) from the directly superordinated
  bus rather than reaching up to the bridge and use the cached mode
  in mmcsd_delete(), too.
- Use le32dec(9) for decoding EXT_CSD values where it makes sense. [1]
- Locally cache some instance variable values in mmc_discover_cards()
  in order to improve the code readability a bit.

Obtained from: NetBSD [1]

5 years agoMFC: r338512
marius [Thu, 13 Sep 2018 09:20:13 +0000 (09:20 +0000)]
MFC: r338512

Explicitly compare a pointer to NULL. The __builtin_expect() of clang
3.4.1 otherwise isn't able to cope with the expression.

5 years agoMFC r337329:
markj [Wed, 12 Sep 2018 19:15:58 +0000 (19:15 +0000)]
MFC r337329:
Fix the regression test for PR 181741.

MFC r337424:
Update PR 131876 regression tests after r337423.

PR: 131876

5 years agoMFC r337423:
markj [Wed, 12 Sep 2018 19:13:32 +0000 (19:13 +0000)]
MFC r337423:
Improve handling of control message truncation.

PR: 131876

5 years agoMFC r312296 and r323254, which is new a socket option
sobomax [Wed, 12 Sep 2018 18:52:18 +0000 (18:52 +0000)]
MFC r312296 and r323254, which is new a socket option
SO_TS_CLOCK to pick from several different clock sources to
return timestamps when SO_TIMESTAMP is enabled and two
new nanosecond-precision timestamp types. This also fixes
recvmsg32() system call to properly down-convert layout of the
64-bit structures to match what 32-bit app(s) expect.

Bump __FreeBSD_version to indicate presence of a new
functionality.

Differential Revision: https://reviews.freebsd.org/D9171

5 years agoMFC r338491:
hselasky [Wed, 12 Sep 2018 08:56:08 +0000 (08:56 +0000)]
MFC r338491:
ibcore: Fix endless loop in searching for matching VLAN device

In r337943 ifnet's if_pcp was set to the PCP value in use
instead of IFNET_PCP_NONE.
Current ibcore code assumes that if_pcp is IFNET_PCP_NONE with
VLAN interfaces so it can identify prio-tagged traffic.
Fix that by explicitly verifying that that the if_type is IFT_ETHER
and not IFT_L2VLAN.

Approved by:    re (Marius), hselasky (mentor), kib (mentor)
Sponsored by:   Mellanox Technologies

5 years agoMFC r338468: Fix "ipfw fwd" to work for incoming IPv4 packets
eugen [Wed, 12 Sep 2018 08:46:49 +0000 (08:46 +0000)]
MFC r338468: Fix "ipfw fwd" to work for incoming IPv4 packets
when ip_tryforward() chooses fast forwarding path, as it already works
for IPv6 and for both of them on old slow path.

PR: 231143
Reviewed by: ae
Differential Revision: https://reviews.freebsd.org/D17039

5 years agoMFC 338603:
gordon [Wed, 12 Sep 2018 05:02:11 +0000 (05:02 +0000)]
MFC 338603:
Correct ELF header parsing code to prevent invalid ELF sections from
disclosing memory.

Submitted by: markj
Reported by: Thomas Barabosch, Fraunhofer FKIE
Approved by: so
Security: FreeBSD-SA-18:12.elf
Security: CVE-2018-6924
Sponsored by: The FreeBSD Foundation

5 years agoMFC r334856, r338434:
kib [Tue, 11 Sep 2018 18:39:04 +0000 (18:39 +0000)]
MFC r334856, r338434:
Don't bother looking for non-executable pages when a process is
excluded from PTI.

5 years agoMFC r338435:
kib [Tue, 11 Sep 2018 18:35:08 +0000 (18:35 +0000)]
MFC r338435:
Improve error messages from clock_if.m method failures.

5 years agoMFC r338433:
kib [Tue, 11 Sep 2018 18:31:57 +0000 (18:31 +0000)]
MFC r338433:
Normalize use of semicolon with EFI_TIME_LOCK macros.

5 years agoFix compile warning about missing prototype when WANT_FUNCTIONS is defined.
hselasky [Tue, 11 Sep 2018 15:56:06 +0000 (15:56 +0000)]
Fix compile warning about missing prototype when WANT_FUNCTIONS is defined.

This is a direct commit.

Found by: bde @
Sponsored by: Mellanox Technologies

5 years agoFix the port name in the 2018-06-26 errata entry for 11.2-RELEASE.
gjb [Tue, 11 Sep 2018 15:00:16 +0000 (15:00 +0000)]
Fix the port name in the 2018-06-26 errata entry for 11.2-RELEASE.

Submitted by: rkoberman at gmail _dot_ com
Sponsored by: The FreeBSD Foundation

5 years agoMFC r338541:
hselasky [Mon, 10 Sep 2018 08:19:38 +0000 (08:19 +0000)]
MFC r338541:
Introduce and use sgid_index in CM requests in ibcore.

For RoCE, when CM requests are received for RC and UD connections,
netdevice of the incoming request is unavailable. Because of that CM
requests are always forwarded to init_net namespace.

Now that we have the GID index available, introduce SGID index in
incoming CM requests and refer to the netdevice of it.

While at it fix some incorrect uses of init_net and make sure
the rdma_create_id() function stores the VNET it is passed.

Based on linux commit:
cee104334c98dd04e9dd4d9a4fa4784f7f6aada9

Sponsored by: Mellanox Technologies

5 years agoMFC r338526:
hselasky [Mon, 10 Sep 2018 08:17:36 +0000 (08:17 +0000)]
MFC r338526:
Implement get network interface by params function in ipoib.

Also fix the validate_ipv4_net_dev() and validate_ipv6_net_dev() functions
which had source and destination addresses swapped, and didn't set the
scope ID for IPv6 link-local addresses.

This allows applications like krping to work using IPoIB devices.

Sponsored by: Mellanox Technologies

5 years agoMFC r338495:
hselasky [Mon, 10 Sep 2018 08:14:52 +0000 (08:14 +0000)]
MFC r338495:
Add proper support for VIMAGE to krping.

Make sure we pass the correct VNET when allocating the RDMA ID.

Sponsored by: Mellanox Technologies

5 years agoMFC r338493:
hselasky [Mon, 10 Sep 2018 08:13:33 +0000 (08:13 +0000)]
MFC r338493:
Make the MSIX module parameter limit per device, in mlx5en(4).

Sponsored by: Mellanox Technologies

5 years agoMFC r338492:
hselasky [Mon, 10 Sep 2018 08:09:42 +0000 (08:09 +0000)]
MFC r338492:
Add support for receive side scaling stride, RSSS, in mlx5en(4).

The receive side scaling stride parameter is a value which define the interval
between active receive side queues. The traffic for the inactive queues is
redirected to the nearest active queue by use of modulus. The default value
of this parameter is one, which means all receive side queues are used.

The point of this feature is to redirect more traffic to fewer receive side
queues in order to take more advantage of sorted large receive offload,
sorted LRO. The sorted LRO works better when more packets are accumulated
per service interval.

Sponsored by: Mellanox Technologies

5 years agoMFC r338490:
hselasky [Mon, 10 Sep 2018 08:05:36 +0000 (08:05 +0000)]
MFC r338490:
Don't stall transmit queue on drops in mlx5en(4).

When a transmitted packet is dropped don't stall the transmit queue.

Sponsored by: Mellanox Technologies

5 years agoMFC r338489:
hselasky [Mon, 10 Sep 2018 08:02:02 +0000 (08:02 +0000)]
MFC r338489:
Maximum number of mbuf frags is off-by-one for worst case scenario in mlx5en(4).

Inspecting the PRM no more than 0x3F data segments, DS, of size 16 bytes is
allowed.

Worst case scenario summary of DS usage:
Header is fixed: 2 DS
Maximum inlining: 98 => (98 - 2) / 16 = 6 DS
Remainder: 0x3F - 2 - 6 = 55 DS (mbuf frags)

Previously a value of 56 DS was used and this would work in the
normal case because not all inline data area was used up.

Sponsored by: Mellanox Technologies

5 years agoMFC r316623: fix build after incomplete MFC r338544 by me.
eugen [Sun, 9 Sep 2018 18:38:55 +0000 (18:38 +0000)]
MFC r316623: fix build after incomplete MFC r338544 by me.

5 years agoMFC r316615 by sevan: Remove the last vestiges of FDC_DEBUG & FD_DEBUG
eugen [Sun, 9 Sep 2018 18:08:38 +0000 (18:08 +0000)]
MFC r316615 by sevan: Remove the last vestiges of FDC_DEBUG & FD_DEBUG

PR: 105608
Differential Revision: https://reviews.freebsd.org/D10303

5 years agoMFC r338126: MFV r338092: ntp 4.2.8p12.
delphij [Sat, 8 Sep 2018 04:09:30 +0000 (04:09 +0000)]
MFC r338126: MFV r338092: ntp 4.2.8p12.

Relnotes: yes

5 years agoMFC r338459:
kib [Fri, 7 Sep 2018 10:34:27 +0000 (10:34 +0000)]
MFC r338459:
amd64: For non-PTI mode, do not initialize PCPU kcr3 to KPML4phys.

5 years agoMFC 332908: Add two tests for TRAP_* signal codes for SIGTRAP.
jhb [Thu, 6 Sep 2018 22:32:59 +0000 (22:32 +0000)]
MFC 332908: Add two tests for TRAP_* signal codes for SIGTRAP.

- ptrace__breakpoint_siginfo tests that a SIGTRAP for a software breakpoint
  in userland triggers a SIGTRAP with a signal code of TRAP_BRKPT.
- ptrace__step_siginfo tests that a SIGTRAP reported for a step after
  stepping via PT_STEP or PT_SETSTEP has a signal code of TRAP_TRACE.

5 years agoMFC 332909: Report proper signal codes for SIGTRAP traps on MIPS.
jhb [Thu, 6 Sep 2018 22:30:34 +0000 (22:30 +0000)]
MFC 332909: Report proper signal codes for SIGTRAP traps on MIPS.

- Use TRAP_TRACE for traps after stepping via PT_STEP.
- Use TRAP_BRKPT for software breakpoint traps and watchpoint traps.

This was tested via the recently added siginfo ptrace() tests.  PT_STEP on
MIPS has several bugs that prevent it from working yet, but this does fix
the ptrace__breakpoint_siginfo test on MIPS.

5 years agoMFC 332906,332907,332976,333679,336053: Expand testing of breakpoints.
jhb [Thu, 6 Sep 2018 22:23:39 +0000 (22:23 +0000)]
MFC 332906,332907,332976,333679,336053: Expand testing of breakpoints.

332906:
Extend support for ptrace() tests using breakpoints.

- Use a single list of platforms to define HAVE_BREAKPOINT for platforms
  that expose a functional breakpoint() inline to userland.  Replace
  existing lists of platform tests with HAVE_BREAKPOINT instead.
- Add support for advancing PC past a breakpoint inserted via breakpoint()
  to support the existing ptrace__PT_CONTINUE_different_thread test on
  non-x86 platforms (x86 advances the PC past the breakpoint instruction,
  but other platforms do not).  This is implemented by defining a new
  SKIP_BREAK macro which accepts a pointer to a 'struct reg' as its sole
  argument and modifies the contents to advance the PC.  The intention is
  to use it in between PT_GETREGS and PT_SETREGS.

332907:
Expose breakpoint() to userland from <machine/cpufunc.h> on MIPS.

Enable ptrace() tests using breakpoint on MIPS as well.

332976:
Shorten some recently-added lines that are an extra indent over 80 columns.

333679:
Export a breakpoint() function to userland for riscv.

As a result, enable tests using breakpoint() on riscv.

336053:
Export a breakpoint() function to userland for arm and arm64.

Enable ptrace() tests using breakpoint() on these architectures.

5 years agoMFC r338370:
kib [Wed, 5 Sep 2018 21:28:33 +0000 (21:28 +0000)]
MFC r338370:
Remove {max/min}_offset() macros, use vm_map_{max/min}() inlines.

5 years agoMFC r338428:
kib [Wed, 5 Sep 2018 21:24:26 +0000 (21:24 +0000)]
MFC r338428:
Style cleanup.

5 years agoMFC r324856:
kib [Wed, 5 Sep 2018 21:23:40 +0000 (21:23 +0000)]
MFC r324856:
Don't call realpath(3) from libmap rtld code.

5 years agoRegen.
kib [Wed, 5 Sep 2018 21:15:48 +0000 (21:15 +0000)]
Regen.

5 years agoMFC r338357:
kib [Wed, 5 Sep 2018 21:15:23 +0000 (21:15 +0000)]
MFC r338357:
Fix compat32 ftruncate cap mode.

PR: 230120

5 years agoMFC: r338261
marius [Wed, 5 Sep 2018 21:05:16 +0000 (21:05 +0000)]
MFC: r338261

- According to section 2.2.5 of the SDHCI specification version 4.20,
  SDHCI_TRNS_ACMD12 is to be set only for multiple-block read/write
  commands without data length information, so don't unconditionally
  set this bit. The result matches what e. g. Linux does.
- Section 2.2.19 of the SDHCI specification version 4.20 states that
  SDHCI_ACMD12_ERR should be only valid if SDHCI_INT_ACMD12ERR is set
  and hardware may clear SDHCI_ACMD12_ERR when SDHCI_INT_ACMD12ERR is
  cleared (differing silicon behavior is specifically allowed, though).
  Thus, read SDHCI_ACMD12_ERR before clearing SDHCI_INT_ACMD12ERR.
  While at it, use the 16-bit accessor rather than the 32-bit one for
  reading the 16-bit SDHCI_ACMD12_ERR.
- SDHCI_INT_TUNEERR isn't one of the ROC bits in SDHCI_INT_STATUS so
  clear it explicitly.
- Add missing prototypes and sort them.

5 years agoMFC: r338304
marius [Wed, 5 Sep 2018 20:43:46 +0000 (20:43 +0000)]
MFC: r338304

The read accessors generated by __BUS_ACCESSOR() have the problem that
they don't check the result of BUS_READ_IVAR(9) and silently return stack
garbage on failure in case a bus doesn't implement a particular instance
variable for example. With MMC bridges not providing MMCBR_IVAR_RETUNE_REQ,
yet, this in turn can cause mmc(4) to get into a state in which re-tuning
seems to be necessary but is inappropriate, causing mmc_wait_for_request()
to fail. Thus, don't use __BUS_ACCESSOR() for mmcbr_get_retune_req() and
instead provide a version of the latter which returns retune_req_none if
reading MMCBR_IVAR_RETUNE_REQ fails.

5 years agoMFC r314000:
oshogbo [Wed, 5 Sep 2018 20:13:28 +0000 (20:13 +0000)]
MFC r314000:

  Capsicumize traceroute.

  PR:  193973
  Submitted by:  Mikhail <mp39590@gmail.com>
  Reviewed by:  pjd, bapt, emaste, AllanJude
  Differential Revision: https://reviews.freebsd.org/D9303

5 years agoRevert an unintentional change from r338462.
markj [Wed, 5 Sep 2018 14:49:26 +0000 (14:49 +0000)]
Revert an unintentional change from r338462.

Reported by: kib

5 years agoAvoid printing extraneous function names when searching man page
cy [Wed, 5 Sep 2018 01:33:30 +0000 (01:33 +0000)]
Avoid printing extraneous function names when searching man page
database (apropos, man -k). This commit Replaces .SS with .SH,
similar to the man page provided by original heimdal (as in port).

PR: 230573
Submitted by: yuripv@yuripv.net

5 years agoMFC r337974:
markj [Wed, 5 Sep 2018 01:24:13 +0000 (01:24 +0000)]
MFC r337974:
Add INVARIANTS-only fences around lockless vnode refcount updates.

5 years agoMFC r338375:
markj [Wed, 5 Sep 2018 00:30:34 +0000 (00:30 +0000)]
MFC r338375:
sed: Fix -i option behavior with 'q' command.

PR: 230507

5 years agoMFC r338416:
markj [Tue, 4 Sep 2018 16:47:08 +0000 (16:47 +0000)]
MFC r338416:
Re-compute the ARC size before computing the MFU target.

5 years agoMFC r338350:
markj [Tue, 4 Sep 2018 16:45:08 +0000 (16:45 +0000)]
MFC r338350:
Add missing endpwent() and endgrent() calls to nfsuserd(8).

PR: 230937

5 years agoMFC r338353:
philip [Tue, 4 Sep 2018 09:58:13 +0000 (09:58 +0000)]
MFC r338353:
  Add libxo(3) support to lastlogin(8).

5 years agoMFC r319508:
philip [Tue, 4 Sep 2018 09:53:45 +0000 (09:53 +0000)]
MFC r319508:
  Fix a memory leak with last
  free memory allocated to 'buf'

  Submitted by: Thomas Rix <trix@juniper.net>

MFC r338352:
  Add libxo(3) support to last(1).

5 years agoMFC r338406:
kp [Mon, 3 Sep 2018 08:57:09 +0000 (08:57 +0000)]
MFC r338406:

frag6: Fix fragment reassembly

r337776 started hashing the fragments into buckets for faster lookup.

The hashkey is larger than intended. This results in random stack data being
included in the hashed data, which in turn means that fragments of the same
packet might end up in different buckets, causing the reassembly to fail.

Set the correct size for hashkey.

PR: 231045

5 years agoMFC r337522:
delphij [Mon, 3 Sep 2018 06:55:38 +0000 (06:55 +0000)]
MFC r337522:

In read_zones(), check if the file name actually fit in the buffer
and make sure it would terminate with nul with strlcpy().

Reviewed by: imp (earlier revision)
Differential Revision: https://reviews.freebsd.org/D16595

5 years agoMFC r336754: Improve --strip-trailing-cr handling.
delphij [Mon, 3 Sep 2018 06:36:28 +0000 (06:36 +0000)]
MFC r336754: Improve --strip-trailing-cr handling.

5 years agoMFC r338068, r338113:
kib [Sun, 2 Sep 2018 10:51:31 +0000 (10:51 +0000)]
MFC r338068, r338113:
Update L1TF workaround to sustain L1D pollution from NMI.

5 years agoMFC r338365:
markj [Sat, 1 Sep 2018 16:13:56 +0000 (16:13 +0000)]
MFC r338365:
Add a sysctl for the ZFS abd_scatter_enabled setting.

5 years agoMFC r338024:
kib [Sat, 1 Sep 2018 10:03:30 +0000 (10:03 +0000)]
MFC r338024:
Rudimentary AER reading code for ddb(4).

5 years agoMFC r338313:
kib [Sat, 1 Sep 2018 10:01:19 +0000 (10:01 +0000)]
MFC r338313:
Remove dead code in i386 cpu_throw().

5 years agoMFC r338312:
kib [Sat, 1 Sep 2018 09:59:46 +0000 (09:59 +0000)]
MFC r338312:
Unify amd64 and i386 vmspace0 pmap activation.

5 years agoMFC r333063: Update ELF Tool Chain to r3614
emaste [Fri, 31 Aug 2018 17:36:45 +0000 (17:36 +0000)]
MFC r333063: Update ELF Tool Chain to r3614

Sponsored by: The FreeBSD Foundation

5 years agoMFC r336745: elf_common: update ARM ABI flag names
emaste [Fri, 31 Aug 2018 17:35:09 +0000 (17:35 +0000)]
MFC r336745: elf_common: update ARM ABI flag names

In the V5 ABI the flags are EF_ARM_ABI_FLOAT_HARD and
EF_ARM_ABI_FLOAT_SOFT. The flags have the same values as the legacy GCC
flags EF_ARM_VFP_FLOAT and EF_ARM_SOFT_FLOAT respectively.

The legacy names are kept for compatibility.

Reported by: Peter Smith (Linaro)
Sponsored by: The FreeBSD Foundation

5 years agoMFC r333062: elf_common.h: add DT_SUNW_ASLR tag
emaste [Fri, 31 Aug 2018 17:34:18 +0000 (17:34 +0000)]
MFC r333062: elf_common.h: add DT_SUNW_ASLR tag

For upcoming ELF Tool Chain import (readelf).

Sponsored by: The FreeBSD Foundation

5 years agoMFC r337045: libelf: reload section headers after update with ELF_C_WRITE
emaste [Fri, 31 Aug 2018 17:29:24 +0000 (17:29 +0000)]
MFC r337045: libelf: reload section headers after update with ELF_C_WRITE

These issues (PR 218860 and PR 218861) are still undergoing additional
discussion in the upstream context and there may be additional changes
to come.

PR: 218860
Submitted by: Eric McCorkle
Sponsored by: The FreeBSD Foundation (MFC)

5 years agoMFC r337983, r338044:
kib [Fri, 31 Aug 2018 05:21:33 +0000 (05:21 +0000)]
MFC r337983, r338044:
Add pthread_get_name_np(3).

5 years agoMFV r338288: Unblock speculative prefetcher also on pool creation.
mav [Fri, 31 Aug 2018 01:50:40 +0000 (01:50 +0000)]
MFV r338288: Unblock speculative prefetcher also on pool creation.

Fix at r331950 appeared to be incomplete, fixing only case of pool
import, but not pool creation, leaving prefetcher still blocked for
newly created pools.

5 years agoMFC r337926:
markj [Thu, 30 Aug 2018 13:45:14 +0000 (13:45 +0000)]
MFC r337926:
Add partial documentation for dtrace(1)'s -x configuration options.

5 years agoMFC r338183, r338183:
kp [Wed, 29 Aug 2018 20:49:56 +0000 (20:49 +0000)]
MFC r338183, r338183:

pfctl: Improve set skip handling for groups

Rely on the kernel to appropriately mark group members as skipped.
Once a group is skipped we can clear the update flag on all the members.

PR: 229241
Submitted by: Andreas Longwitz <longwitz AT incore.de>

5 years agoMFC r332968:
markj [Wed, 29 Aug 2018 17:58:01 +0000 (17:58 +0000)]
MFC r332968:
Add a UMA zone flag to disable the use of buckets.

5 years agoMFC r333280:
markj [Wed, 29 Aug 2018 17:50:27 +0000 (17:50 +0000)]
MFC r333280:
Style.

5 years agoMFC r337965:
oshogbo [Wed, 29 Aug 2018 08:35:23 +0000 (08:35 +0000)]
MFC r337965:
  capsicum: allow the setproctitle(3) function in capability mode

  Capsicum in past allowed to change the process title.
  This was broken with r335939.

  PR:           230584
  Submitted by: Yuichiro NAITO <naito.yuichiro@gmail.com>
  Reported by:  ian@niw.com.au
  MFC after:    1 week

5 years agoMFC r337505, r337865, r337869: dd status=progress
kevans [Wed, 29 Aug 2018 02:18:13 +0000 (02:18 +0000)]
MFC r337505, r337865, r337869: dd status=progress

r337505:
dd: add status=progress support

This reports the current status on a single line every second, mirroring
similar functionality in GNU dd, and carefully interacts with SIGINFO.

PR: 229615

r337865:
dd: Incorporate some changes from imp for status=progress

Notable changes from what landed in r337505:
- sigalarm handler isn't setup unless we're actually using it
- Humanized versions of the amount of data transferred in the progress
  update

r337869:
dd(1): Kill off duplicate progress definition following r337865

5 years agoMFC r338142:
markj [Tue, 28 Aug 2018 14:33:04 +0000 (14:33 +0000)]
MFC r338142:
Set arc_kmem_cache_reap_retry_ms to 0 and make it configurable.

5 years agoMFC r337736:
ae [Tue, 28 Aug 2018 07:24:09 +0000 (07:24 +0000)]
MFC r337736:
  Restore ability to send ICMP and ICMPv6 redirects.

  It was lost when tryforward appeared. Now ip[6]_tryforward will be enabled
  only when sending redirects for corresponding IP version is disabled via
  sysctl. Otherwise will be used default forwarding function.

  PR: 221137

5 years agoMFC r337714:
kib [Mon, 27 Aug 2018 09:39:34 +0000 (09:39 +0000)]
MFC r337714:
Prevent some parallel swap-ins, rate-limit swapper swap-ins.

5 years agoMFC r336086:
ed [Mon, 27 Aug 2018 07:32:41 +0000 (07:32 +0000)]
MFC r336086:

  Use the FQDN in the newsyslog log message when RFC 5424 is enabled.

  The RFC 5424 spec mentions that logging FQDNs over short hostnames is
  preferred. Alter this code, so that the hostname doesn't get truncated
  on startup. Keep track of the length of the short hostname, so that
  fprintf() can do the truncation where necessary.

5 years agoMFC r338105: Remove extra M_ZERO from NG_MKRESPONSE() argument.
mav [Mon, 27 Aug 2018 03:42:19 +0000 (03:42 +0000)]
MFC r338105: Remove extra M_ZERO from NG_MKRESPONSE() argument.

NG_MKRESPONSE() sets M_ZERO by itself.

Submitted by: Dmitry Luhtionov <dmitryluhtionov@gmail.com>