]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
4 years agoTemporarily skip timer tests in sys.kqueue.libkqueue.kqueue_test.main on i386
lwhsu [Mon, 20 Apr 2020 17:48:10 +0000 (17:48 +0000)]
Temporarily skip timer tests in sys.kqueue.libkqueue.kqueue_test.main on i386

PR: 245768
Sponsored by: The FreeBSD Foundation

4 years agoMerge commit ce5173c0e from llvm git (by Reid Kleckner):
dim [Mon, 20 Apr 2020 17:39:51 +0000 (17:39 +0000)]
Merge commit ce5173c0e from llvm git (by Reid Kleckner):

  Use FinishThunk to finish musttail thunks

  FinishThunk, and the invariant of setting and then unsetting
  CurCodeDecl, was added in 7f416cc42638 (2015). The invariant didn't
  exist when I added this musttail codepath in ab2090d10765 (2014).
  Recently in 28328c3771, I started using this codepath on non-Windows
  platforms, and users reported problems during release testing
  (PR44987).

  The issue was already present for users of EH on i686-windows-msvc,
  so I added a test for that case as well.

  Reviewed By: hans

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

This should fix 'Assertion failed: (!empty() && "popping exception stack
when not empty"), function popTerminate, file
/usr/src/contrib/llvm-project/clang/lib/CodeGen/CGCleanup.h, line 583'
when building the net-p2p/libtorrent-rasterbar

PR: 244830
Reported by: jbeich, yuri
MFC after: 6 weeks
X-MFC-With: 358851

4 years agoImplement the atomic fetch add unless functions for the LinuxKPI.
hselasky [Mon, 20 Apr 2020 16:21:37 +0000 (16:21 +0000)]
Implement the atomic fetch add unless functions for the LinuxKPI.

MFC after: 1 week
Sponsored by: Mellanox Technologies

4 years agoChange kern.evdev.rcpt_mask to 12 by default
zeising [Mon, 20 Apr 2020 16:17:16 +0000 (16:17 +0000)]
Change kern.evdev.rcpt_mask to 12 by default

Change kern.evdev.rcpt_mask from 3 to 12 by default.  This makes us much
more evdev-friendly, and will prevent everyone using xorg and wayland with
evdev devices (the default) from needing to change this locally.

powerpc32 still uses the old value for the keyboard part, becaues the adb
keyboard driver used there is not evdev compatible.

Reviewed by: wulf
Approved by: wulf
MFC after: 2 weeks
X-MFC-Note: 12 only
Relnotes: yes
Differential Revision: https://reviews.freebsd.org/D24370

4 years agodiff(1): reject conflicting formatting options
kevans [Mon, 20 Apr 2020 16:14:44 +0000 (16:14 +0000)]
diff(1): reject conflicting formatting options

This matches GNU diff(1) behavior and, more importantly, eliminates any
source of confusion if multiple formatting options are specified.

Note that the committed diff differs slightly from the submitted: I've
modified it so that we initialize diff_format to something that isn't an
accepted format option so that we can also reject --normal -c and -c
--normal, which would've otherwise been accepted because the default was
--normal. After option parsing we default it to D_NORMAL if it's still
unset.

PR: 243975
Submitted by: fehmi noyan isi
MFC after: 1 week

4 years agohdac: remove unused macro
emaste [Mon, 20 Apr 2020 15:41:40 +0000 (15:41 +0000)]
hdac: remove unused macro

4 years agoAllow namespace-id specification where it makes sense.
mav [Mon, 20 Apr 2020 14:54:41 +0000 (14:54 +0000)]
Allow namespace-id specification where it makes sense.

It makes tool more convenient to not require user to explicitly convert
namespace device name into controller device name.  There should be no
changes to already existing syntaxes.

MFC after: 1 week

4 years agoHandle trashed queue pointers in vm_page_acquire_unlocked().
markj [Mon, 20 Apr 2020 14:45:17 +0000 (14:45 +0000)]
Handle trashed queue pointers in vm_page_acquire_unlocked().

vm_page_acquire_unlocked() relies on type-stability of vm_page
structures and assumes that the listq linkage pointers always point to a
vm_page or are NULL.  QUEUE_MACRO_DEBUG_TRASH breaks that assumption, so
add an explicit check for a trashed queue pointer before dereferencing.

Reported and tested by: pho
Reviewed by: kib
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D24472

4 years agoOnly skip sys.netinet.socket_afinet.socket_afinet_bind_zero in CI env
lwhsu [Mon, 20 Apr 2020 14:24:13 +0000 (14:24 +0000)]
Only skip sys.netinet.socket_afinet.socket_afinet_bind_zero in CI env

Sponsored by: The FreeBSD Foundation

4 years agoTemporarily disable sys.netinet.divert.* on i386
lwhsu [Mon, 20 Apr 2020 14:18:56 +0000 (14:18 +0000)]
Temporarily disable sys.netinet.divert.* on i386

PR: 244703
Sponsored by: The FreeBSD Foundation

4 years agoImplement aligned LinuxKPI types for u16, u32 and u64.
hselasky [Mon, 20 Apr 2020 14:03:05 +0000 (14:03 +0000)]
Implement aligned LinuxKPI types for u16, u32 and u64.
Makes a difference for 32-bit platforms mostly.

MFC after: 1 week
Sponsored by: Mellanox Technologies

4 years agoAllow test_bit() in the LinuxKPI to accept a const pointer.
hselasky [Mon, 20 Apr 2020 13:47:15 +0000 (13:47 +0000)]
Allow test_bit() in the LinuxKPI to accept a const pointer.

MFC after: 1 week
Sponsored by: Mellanox Technologies

4 years agoOpen device with O_RDONLY when command is non-invasive.
mav [Mon, 20 Apr 2020 13:47:07 +0000 (13:47 +0000)]
Open device with O_RDONLY when command is non-invasive.

This allows to use some of the subcommands against mounted nvd devices.

MFC after: 1 week
Sponsored by: iXystems, Inc.

4 years agoSubstitute le_read_supported_status with le_read_supported_states.
hselasky [Mon, 20 Apr 2020 13:44:14 +0000 (13:44 +0000)]
Substitute le_read_supported_status with le_read_supported_states.
Refer to bluetooth core v5.2 specifications Vol4. Part E. 7.8.27.

PR: 245763
Submitted by: Marc Veldman <marc@bumblingdork.com>
MFC after: 1 week
Sponsored by: Mellanox Technologies

4 years agoAllow the ERR_CAST() function in the LinuxKPI to take a const void pointer.
hselasky [Mon, 20 Apr 2020 13:36:01 +0000 (13:36 +0000)]
Allow the ERR_CAST() function in the LinuxKPI to take a const void pointer.
No functional change.

MFC after: 1 week
Sponsored by: Mellanox Technologies

4 years agotests: kqueue: fix some issues with now() on ILP32 platforms
kevans [Mon, 20 Apr 2020 00:47:28 +0000 (00:47 +0000)]
tests: kqueue: fix some issues with now() on ILP32 platforms

There were ultimately two separate problems here:
- a 32-bit long cannot represent microseconds since 1970 (noted by ian)
- time_t is 32-bit on i386, so now() was wrong anyways even with the correct
  return type.

For the first, just explicitly use a uint64_t for now() and all of the
callers. For the second, we need to explicitly cast tv_sec to uint64_t
before it gets multiplied in the SEC_TO_US macro. Casting this instance
rather than generally in the macro was arbitrarily chosen simply because all
other uses are converting small relative time values.

The tests now pass on i386, at least; presumably other ILP32 will be fine
now as well.

4 years agovmm(4): Bump VM_MAX_MEMMAPS for vmgenid
cem [Sun, 19 Apr 2020 23:53:47 +0000 (23:53 +0000)]
vmm(4): Bump VM_MAX_MEMMAPS for vmgenid

As a short term solution for the problem reported by Shawn Webb re: r359950,
bump the maximum number of memmaps per VM. This structure is 40 bytes, and the
additional four (fixed array embedded in the struct vm) members increase the
size of struct vm by 3%.

(The vast majority of struct vm is the embedded struct vcpu array, which
accounts for 84% of the size -- over 4 kB.)

Reported by: Shawn Webb <shawn.webb AT hardenedbsd.org>
Reviewed by: grehan
X-MFC-With: r359950
Differential Revision: https://reviews.freebsd.org/D24507

4 years agoDue to popular demand, revert r360102.
cy [Sun, 19 Apr 2020 21:38:03 +0000 (21:38 +0000)]
Due to popular demand, revert r360102.

Reported by: many

4 years agosnd_hda: whitespace and style(9) cleanups
emaste [Sun, 19 Apr 2020 17:53:44 +0000 (17:53 +0000)]
snd_hda: whitespace and style(9) cleanups

4 years agoUse LIST_FOREACH_SAFE instead of LIST_FOREACH as we are removing
delphij [Sun, 19 Apr 2020 17:28:42 +0000 (17:28 +0000)]
Use LIST_FOREACH_SAFE instead of LIST_FOREACH as we are removing
elements in the middle.

This fixes a panic when detaching USB mouse.

PR: 245732
Reviewed by: wulf
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D24500

4 years agoConditionally install Kerberos rc files based on MK_KERBEROS_SCRIPTS
cy [Sun, 19 Apr 2020 17:01:21 +0000 (17:01 +0000)]
Conditionally install Kerberos rc files based on MK_KERBEROS_SCRIPTS
instead of MK_KERBEROS. The reason for this change is some users
prefer to build FreeBSD WITHOUT_KERBEROS, wanting to retain the
Kerberos rc scripts to start/stop MIT Kerberos or Heimdal from ports.

PR: 197337
Reported by: Adam McDougall <ebay at looksharp.net>
Reviewed by: imp
Differential Revision: https://reviews.freebsd.org/D24252

4 years agoConvert ipfilter to the new routing KPI.
cy [Sun, 19 Apr 2020 17:01:17 +0000 (17:01 +0000)]
Convert ipfilter to the new routing KPI.

Reviewed by: melifaro (previous version)

4 years agofib4_free_nh_ext is an empty function. It does nothing. Don't call it.
cy [Sun, 19 Apr 2020 17:01:14 +0000 (17:01 +0000)]
fib4_free_nh_ext is an empty function. It does nothing. Don't call it.

MFC after: 2 weeks

4 years agobridge tests: Ensure that bridges in different jails get different MAC addresses
kp [Sun, 19 Apr 2020 16:30:49 +0000 (16:30 +0000)]
bridge tests: Ensure that bridges in different jails get different MAC addresses

We used to have a problem where bridges created in different vnet jails
would end up having the same mac address. This is now fixed by
including the jail name as a seed for the mac address generation, but we
should verify that it doesn't regress.

4 years agopf: Improve ioctl() input validation
kp [Sun, 19 Apr 2020 16:10:20 +0000 (16:10 +0000)]
pf: Improve ioctl() input validation

Both DIOCCHANGEADDR and DIOCADDADDR take a struct pf_pooladdr from
userspace. They failed to validate the dyn pointer contained in its
struct pf_addr_wrap member structure.

This triggered assertion failures under fuzz testing in
pfi_dynaddr_setup(). Happily the dyn variable was overruled there, but
we should verify that it's set to NULL anyway.

Reported-by: syzbot+93e93150bc29f9b4b85f@syzkaller.appspotmail.com
Reviewed by: emaste
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D24431

4 years agopfctl: Call ifa_load() before ifa_grouplookup()
kp [Sun, 19 Apr 2020 15:37:13 +0000 (15:37 +0000)]
pfctl: Call ifa_load() before ifa_grouplookup()

ifa_grouplookup() uses the data loaded in ifa_load() (through is_a_group()), so
we must call ifa_load() before we can rely on any of the data it populates.

Submitted by: Nick Rogers
MFC after: 1 week
Sponsored by: RG Nets

4 years agopfctl: Remove unused variable
kp [Sun, 19 Apr 2020 15:32:14 +0000 (15:32 +0000)]
pfctl: Remove unused variable

Submitted by: Nick Rogers
MFC after: 1 week
Sponsored by: RG Nets

4 years agoFix cut and paste off-by-one error in hccontrol(8).
hselasky [Sun, 19 Apr 2020 14:25:56 +0000 (14:25 +0000)]
Fix cut and paste off-by-one error in hccontrol(8).
Make sure strncpy() doesn't write beyond its given buffer.

PR: 245739
MFC after: 1 week
Sponsored by: Mellanox Technologies

4 years agoImprove printing of le features in hccontrol(8).
hselasky [Sun, 19 Apr 2020 14:22:21 +0000 (14:22 +0000)]
Improve printing of le features in hccontrol(8).

Submitted by: Marc Veldman <marc@bumblingdork.com>
PR: 245739
MFC after: 1 week
Sponsored by: Mellanox Technologies

4 years agorelease: arm64: Remove DTSO for Allwinner boards
manu [Sun, 19 Apr 2020 10:50:29 +0000 (10:50 +0000)]
release: arm64: Remove DTSO for Allwinner boards

Both SID and THS dts node are now in the main dts and the DTSO have
been removed in r359935

MFC after: 2 month
X-MFC-With: r359935

4 years agoBring HCI error messages up-to-date.
hselasky [Sun, 19 Apr 2020 10:24:15 +0000 (10:24 +0000)]
Bring HCI error messages up-to-date.
See Bluetooth v5.6 core specification Vol.1 Part F: Controller error codes.

Submitted by: Marc Veldman <marc@bumblingdork.com>
PR: 245737
MFC after: 1 week
Sponsored by: Mellanox Technologies

4 years agoAlign initial-exec TLS segments to the p_vaddr % align.
kib [Sun, 19 Apr 2020 09:28:59 +0000 (09:28 +0000)]
Align initial-exec TLS segments to the p_vaddr % align.

This is continuation of D21163/r359634, which handled the alignment
for global mode.

Non-x86 arches are not handled, maintainers are welcomed.

Tested by: emaste
Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks
Differential revision: https://reviews.freebsd.org/D24366

4 years agoFix lookup key generation in fib6_check_urpf().
melifaro [Sun, 19 Apr 2020 07:27:12 +0000 (07:27 +0000)]
Fix lookup key generation in fib6_check_urpf().

The version introduced in r359823 assumed D23051
 had been in tree already. As this is not the case yet,
 revert to sockaddr.

4 years agolibauditd: make it a PRIVATELIB
asomers [Sun, 19 Apr 2020 02:20:39 +0000 (02:20 +0000)]
libauditd: make it a PRIVATELIB

According to the upstream man page (which we don't install), none of
libauditd's symbols are intended to be public. Also, I can't find any
evidence for a port that uses libauditd. Therefore, we should treat it like
other such libraries and use PRIVATELIB.

Reported by: phk
Reviewed by: cem, emaste
MFC after: 2 weeks

4 years agolibbsm: fix some MLINKS
asomers [Sun, 19 Apr 2020 02:18:40 +0000 (02:18 +0000)]
libbsm: fix some MLINKS

Add missing MLINKS entries for a few functions. Remove some old typo
entries.

Reported by: phk
Reviewed by: cem
MFC after: 2 weeks

4 years agobectl.8: correctly sort SEE ALSO section after 360078
asomers [Sun, 19 Apr 2020 01:43:59 +0000 (01:43 +0000)]
bectl.8: correctly sort SEE ALSO section after 360078

Reported by: yuripv
MFC after: 2 weeks
MFC with: 360078

4 years agoRISC-V: provide the correct value for kernstart
mhorne [Sun, 19 Apr 2020 00:34:49 +0000 (00:34 +0000)]
RISC-V: provide the correct value for kernstart

pmap_bootstrap() expects the kernel's physical load address, but we have
been providing the start of physical memory. This had the nice effect of
protecting the memory used by the SBI runtime firmware, but now that we
have alternate means of achieving that, we should provide the correct
value. This will free up any memory between the SBI firmware and the
kernel for allocation.

Reviewed by: markj
Differential Revision: https://reviews.freebsd.org/D24156

4 years agoRISC-V: exclude reserved memory regions
mhorne [Sun, 19 Apr 2020 00:33:05 +0000 (00:33 +0000)]
RISC-V: exclude reserved memory regions

The device tree may contain a "reserved-memory" node, whose purpose is
to communicate sections of physical memory that should not be used for
general allocations. Add the logic to parse and exclude these regions.

The particular motivation for this is protection of the SBI runtime
firmware. Currently, there is no mechanism through which the SBI
can communicate the details of its reserved memory region(s) to
a supervisor payload. There has been some discussion recently on how
this can be achieved [1], and it seems that the path going forward
will be to add an entry to the reserved-memory node.

This hasn't caused any issues for us yet, since we exclude all physical
memory below the kernel's load address from being allocated, and on all
currently supported platforms this covers the SBI firmware region. This
will change in another commit, so as a safety measure, ensure that the
lowest 2MB of memory is excluded if this region has not been reported.

[1] https://github.com/riscv/riscv-sbi-doc/pull/37

Reviewed by: markj, nick (older version)
Differential Revision: https://reviews.freebsd.org/D24155

4 years agoRISC-V: use physmem to manage physical memory
mhorne [Sun, 19 Apr 2020 00:18:16 +0000 (00:18 +0000)]
RISC-V: use physmem to manage physical memory

Replace our hand-rolled functions with the generic ones provided by
kern/subr_physmem.c. This greatly simplifies the initialization of
physical memory regions and kernel globals.

Tested by: nick
Differential Revision: https://reviews.freebsd.org/D24154

4 years agoConvert arm's physmem interface to MI code
mhorne [Sun, 19 Apr 2020 00:12:30 +0000 (00:12 +0000)]
Convert arm's physmem interface to MI code

The arm_physmem interface found in arm's MD code provides a convenient
set of routines for adding/excluding physical memory regions and
initializing important kernel globals such as Maxmem, realmem,
phys_avail[], and dump_avail[]. It is especially convenient for FDT
systems, since we can use FDT parsing functions and pass the result
directly to one of these physmem routines. This interface is already in
use on arm and arm64, and can be used to simplify this early
initialization on RISC-V as well.

This requires only a couple trivial changes:
  - Move arm_physmem_kernel_addr to arm/machdep.c. It is unused on arm64,
    and manipulated entirely in arm MD code.
  - Convert arm32_btop/arm64_btop to atop. This is equivalently defined
    on all architectures.
  - Drop the "arm" prefix.

Reviewed by: manu, emaste ("looks reasonable")
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D24153

4 years agoChange the type of "len" to avoid warnings.
rmacklem [Sat, 18 Apr 2020 23:46:58 +0000 (23:46 +0000)]
Change the type of "len" to avoid warnings.

The "len" variable is used as the last argument to getsockname(2) and
accept(2). It was declared an "int" and this patch changes it to "socklen_t".

4 years agozfs-program.8: fix orphan .Xr
asomers [Sat, 18 Apr 2020 20:55:43 +0000 (20:55 +0000)]
zfs-program.8: fix orphan .Xr

Reported by: phk
Reviewed by: avg
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D24488

4 years agocap_dns.3: fix some orphan .Xr links
asomers [Sat, 18 Apr 2020 20:13:43 +0000 (20:13 +0000)]
cap_dns.3: fix some orphan .Xr links

Reported by: phk
MFC after: 2 weeks

4 years agobectl.8, beinstall.sh.8: fix man page section of beinstall.sh
asomers [Sat, 18 Apr 2020 19:53:47 +0000 (19:53 +0000)]
bectl.8, beinstall.sh.8: fix man page section of beinstall.sh

Reported by: phk
MFC after: 2 weeks

4 years agozfsd.8: fix orphan .Xr
asomers [Sat, 18 Apr 2020 19:47:38 +0000 (19:47 +0000)]
zfsd.8: fix orphan .Xr

Though ZFS is a kernel module, it has no man page in section 4.

Reported by: phk
MFC after: 2 weeks

4 years agohda: remove hda*_lockowned macros
emaste [Sat, 18 Apr 2020 18:25:30 +0000 (18:25 +0000)]
hda: remove hda*_lockowned macros

These are not used anywhere.

4 years agoSet the maximum exit latency to 0 for XHCI USB 3.0 devices, because we
hselasky [Sat, 18 Apr 2020 15:05:10 +0000 (15:05 +0000)]
Set the maximum exit latency to 0 for XHCI USB 3.0 devices, because we
don't implement link power management, LPM.

This fixes error code XHCI_TRB_ERROR_BANDWIDTH for isochronous USB 3.0
transactions.

Submitted by: Horse Ma <Shichun.Ma@dell.com>
MFC after: 1 week
Sponsored by: Mellanox Technologies

4 years agoUse the Ic macro for find(1) primaries consistently
0mp [Sat, 18 Apr 2020 13:29:54 +0000 (13:29 +0000)]
Use the Ic macro for find(1) primaries consistently

MFC after: 3 days

4 years agoFix various warnings in tests/sys/kqueue and bump WARNS
arichardson [Sat, 18 Apr 2020 12:54:47 +0000 (12:54 +0000)]
Fix various warnings in tests/sys/kqueue and bump WARNS

Reviewed By: kevans
Differential Revision: https://reviews.freebsd.org/D24296

4 years agoMore fixes to build the kernel with a compiler that defaults to -fno-common
arichardson [Sat, 18 Apr 2020 12:54:40 +0000 (12:54 +0000)]
More fixes to build the kernel with a compiler that defaults to -fno-common

Using the same approach as the last commit for the files used by genassym.sh.

Obtained from: CheriBSD

4 years agoAllow kernel modules to build with a compiler that defaults to -fno-common
arichardson [Sat, 18 Apr 2020 12:54:35 +0000 (12:54 +0000)]
Allow kernel modules to build with a compiler that defaults to -fno-common

This uses the same approach as r359691.

Reviewed By: brooks
Differential Revision: https://reviews.freebsd.org/D24405

4 years agoAdd missing feature descriptions to hci_features2str().
hselasky [Sat, 18 Apr 2020 08:29:16 +0000 (08:29 +0000)]
Add missing feature descriptions to hci_features2str().

The list of possible features in hccontrol/features2str() is incomplete.
Refer to "Bluetooth Core Specification 5.2 Vol. 2 Part C. 3.3 Feature Mask Definition".

Submitted by: Marc Veldman <marc@bumblingdork.com>
PR: 245354
MFC after: 1 week
Sponsored by: Mellanox Technologies

4 years agobridge: Simplify mac address generation
kp [Sat, 18 Apr 2020 08:00:58 +0000 (08:00 +0000)]
bridge: Simplify mac address generation

Unconditionally use ether_gen_addr() to generate bridge mac addresses.  This
function is now less likely to generate duplicate mac addresses across jails.
The old hand rolled hostid based code adds no value.

Reviewed by: bz
Differential Revision: https://reviews.freebsd.org/D24432

4 years agoethersubr: Make the mac address generation more robust
kp [Sat, 18 Apr 2020 07:50:30 +0000 (07:50 +0000)]
ethersubr: Make the mac address generation more robust

If we create two (vnet) jails and create a bridge interface in each we end up
with the same mac address on both bridge interfaces.
These very often conflicts, resulting in same mac address in both jails.

Mitigate this problem by including the jail name in the mac address.

Reviewed by: kevans, melifaro
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D24383

4 years agosendfile: When all io finished, assert that sfio->pa[] is in expected state.
kib [Sat, 18 Apr 2020 03:09:25 +0000 (03:09 +0000)]
sendfile: When all io finished, assert that sfio->pa[] is in expected state.

It must contain fully restored contigous run of the wired pages from
the object, except possible trimmed tail.

Tested by: pho
Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks

4 years agoThe pa argument for sendfile_iodone() is not necessary a slice of sfio->pa.
kib [Sat, 18 Apr 2020 03:07:18 +0000 (03:07 +0000)]
The pa argument for sendfile_iodone() is not necessary a slice of sfio->pa.

It is true for zfs, but it is not for e.g. vnode or buffer pagers.
When fixing bogus pages, fix them in both places.  Rely on the fact
that pa[0] must have been invalid so it cannot be bogus.

Reported and tested by: pho
Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks

4 years agoAdd deprecation notice to amr(4)
imp [Sat, 18 Apr 2020 02:53:19 +0000 (02:53 +0000)]
Add deprecation notice to amr(4)

4 years agotwa(4) deprecation notice
imp [Sat, 18 Apr 2020 02:53:14 +0000 (02:53 +0000)]
twa(4) deprecation notice

4 years agoDeprecation notice for iir
imp [Sat, 18 Apr 2020 02:53:09 +0000 (02:53 +0000)]
Deprecation notice for iir

4 years agoAdd deprecation notice to mly
imp [Sat, 18 Apr 2020 02:53:04 +0000 (02:53 +0000)]
Add deprecation notice to mly

4 years agoAdd deprecation notice for esp(4).
imp [Sat, 18 Apr 2020 02:52:59 +0000 (02:52 +0000)]
Add deprecation notice for esp(4).

4 years agoDefine enum for so_qstate outside of struct.
sjg [Sat, 18 Apr 2020 01:22:41 +0000 (01:22 +0000)]
Define enum for so_qstate outside of struct.

LLVM-9.0 clang++ throws an error for enum defined within
an anonymous struct.

Reviewed by: jtl, rpokala
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org//D24477

4 years agohdac: replace printf for unowned lock with a lock assertion
emaste [Sat, 18 Apr 2020 01:16:30 +0000 (01:16 +0000)]
hdac: replace printf for unowned lock with a lock assertion

Reviewed by: markj, mav
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D24479

4 years agoTidy up syntax and punctuation of some entries.
grog [Fri, 17 Apr 2020 23:14:51 +0000 (23:14 +0000)]
Tidy up syntax and punctuation of some entries.

4 years agoReplace all instances of the typedef mbuf_t with "struct mbuf *".
rmacklem [Fri, 17 Apr 2020 21:17:51 +0000 (21:17 +0000)]
Replace all instances of the typedef mbuf_t with "struct mbuf *".

The typedef mbuf_t was used for the Mac OS/X port of the code long ago.
Since this port is no longer used and the use of mbuf_t obscures what
the code does (and is not consistent with style(9)), it is no longer needed.
This patch replaces all instances of mbuf_t with "struct mbuf *", so that
it is no longer used.

This patch should not result in any semantic change.

4 years agoxen-locore: Silence DWARF2 section warning
cem [Fri, 17 Apr 2020 20:20:03 +0000 (20:20 +0000)]
xen-locore: Silence DWARF2 section warning

Silence the "DWARF2 can only represent one section per compilation unit"
warning in amd64 GENERIC builds by disabling Clang's debuginfo generation for
this assembler file (-g0).  The message is replaced by a warning from
ctfconvert that there is no debuginfo to convert (future work).

The file contains some metadata (several ELF notes) and some code.  The code
does not appear to have anything that debuginfo would aid.

I looked at the generated debuginfo (readelf -w xen-locore.o) prior to this
change, and the metadata that would be disabled are things like associated
between binary offset and code line number (not especially useful with a
disassembler), and label metadata for the entry points (not especially useful
as this is already in the symbol table).

Reviewed by: royger
Differential Revision: https://reviews.freebsd.org/D24384

4 years agohdac: update comment to match function name
emaste [Fri, 17 Apr 2020 19:14:05 +0000 (19:14 +0000)]
hdac: update comment to match function name

snd_hda was rewritten in r230130; one function retained a comment
referencing the previous name.

MFC after: 3 days
Sponsored by: The FreeBSD Foundation

4 years agoRemove a vestigal reference to kmem_object.
markj [Fri, 17 Apr 2020 19:12:52 +0000 (19:12 +0000)]
Remove a vestigal reference to kmem_object.

kmem_object has been an alias of kernel_object for a while.

MFC after: 1 week

4 years agotty: convert tty_lock_assert to tty_assert_locked to hide lock type
kevans [Fri, 17 Apr 2020 18:34:49 +0000 (18:34 +0000)]
tty: convert tty_lock_assert to tty_assert_locked to hide lock type

A later change, currently being iterated on in D24459, will in-fact change
the lock type to an sx so that TTY drivers can sleep on it if they need to.
Committing this ahead of time to make the review in question a little more
palatable.

tty_lock_assert() is unfortunately still needed for now in two places to
make sure that the tty lock has not been recursed upon, for those scenarios
where it's supplied by the TTY driver and possibly a mutex that is allowed
to recurse.

Suggested by: markj

4 years agoUse the right type for 64-bit coprocessor registers.
jhb [Fri, 17 Apr 2020 18:24:47 +0000 (18:24 +0000)]
Use the right type for 64-bit coprocessor registers.

The use of "int" here caused the compiler to believe that it needs to
insert a "sll $n, $n, 0" to sign extend as part of the implicit cast
to uint64_t.

Submitted by: Nathaniel Filardo <nwf20@cl.cam.ac.uk>
Reviewed by: brooks, arichardson
Obtained from: CheriBSD
Sponsored by: DARPA
Differential Revision: https://reviews.freebsd.org/D24457

4 years agoUnbreak build by reverting if_bridge part of r360047.
melifaro [Fri, 17 Apr 2020 18:22:37 +0000 (18:22 +0000)]
Unbreak build by reverting if_bridge part of r360047.

Pointy hat to: melifaro

4 years agoDon't try to copyout() to a kernel buffer.
jhb [Fri, 17 Apr 2020 18:19:13 +0000 (18:19 +0000)]
Don't try to copyout() to a kernel buffer.

The handle_string callback for the ENCIOC_GET_ENCNAME and
ENCIOC_GETENCID ioctls tries to copy the size of the generated string
out to userland.  However, the callback only has access to the kernel
copy of the structure populated by copyin().  The copyout() call
simply overwrites the value in the kernel's copy preventing the
subsequent overflow prevention logic from working.

Fix this by instead doing a copyout() of the updated length in the
caller after the callback returns.

Reviewed by: kib
Obtained from: CheriBSD
Sponsored by: DARPA
Differential Revision: https://reviews.freebsd.org/D24456

4 years agoFinish r191148: replace rtentry with route in if_bridge if_output() callback.
melifaro [Fri, 17 Apr 2020 17:05:58 +0000 (17:05 +0000)]
Finish r191148: replace rtentry with route in if_bridge if_output() callback.

Generic if_output() callback signature was modified to use struct route
 instead of struct rtentry in r191148, back in 2009.

Quoting commit message:

 Change if_output to take a struct route as its fourth argument in order
 to allow passing a cached struct llentry * down to L2

Fix bridge_output() to match this signature and update the remaining
 comment in if_var.h.

Reviewed by: kp
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D24394

4 years agoAlways compile minidump_machdep.c on arm.
markj [Fri, 17 Apr 2020 16:55:14 +0000 (16:55 +0000)]
Always compile minidump_machdep.c on arm.

It is not logically dependent on "device mem", and an arm kernel
compiled without that device fails to link since the minidumpsys()
symbol is referenced by kern_dump.c.

MFC after: 1 week
Sponsored by: The FreeBSD Foundation

4 years agoSkip routing regression tests depending on if_epair if this module isn't installed.
olivier [Fri, 17 Apr 2020 16:31:07 +0000 (16:31 +0000)]
Skip routing regression tests depending on if_epair if this module isn't installed.

Approved by: melifaro
Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D24468

4 years agovmm.h: Add ABI assertions and mark implicit holes
cem [Fri, 17 Apr 2020 15:19:42 +0000 (15:19 +0000)]
vmm.h: Add ABI assertions and mark implicit holes

The static assertions were added (with size and offsets from gdb) and verified
with a build prior to marking the holes explicitly.

This is in preparation for a subsequent revision, pending in phabricator, that
makes use of some of these unused bits without impacting the ABI.

Reviewed by: grehan
Differential Revision: https://reviews.freebsd.org/D24461

4 years agobridge tests: Test deleting a bridge with members
kp [Fri, 17 Apr 2020 14:57:15 +0000 (14:57 +0000)]
bridge tests: Test deleting a bridge with members

Reviewed by: philip, emaste
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D24337

4 years agopf: Do not allow negative ps_len in DIOCGETSTATES
kp [Fri, 17 Apr 2020 14:35:11 +0000 (14:35 +0000)]
pf: Do not allow negative ps_len in DIOCGETSTATES

Userspace may pass a negative ps_len value to us, which causes an
assertion failure in malloc().
Treat negative values as zero, i.e. return the required size.

Reported-by: syzbot+53370d9d0358ee2a059a@syzkaller.appspotmail.com
Reviewed by: lutz at donnerhacke.de
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D24447

4 years agojail(8): improve manual and usage information with more clear
eugen [Fri, 17 Apr 2020 10:12:11 +0000 (10:12 +0000)]
jail(8): improve manual and usage information with more clear
description for "jail -e" mode to show that it does not take
additional jail name argument.

Reported by: David Marec <david.marec@davenulle.org>
MFC after: 3 days

4 years agoMake ZFS depend on xdr.ko only. It doesn't need kernel RPC.
glebius [Fri, 17 Apr 2020 06:05:08 +0000 (06:05 +0000)]
Make ZFS depend on xdr.ko only.  It doesn't need kernel RPC.

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

4 years agoSplit XDR into separate kernel module. Make krpc depend on xdr.
glebius [Fri, 17 Apr 2020 06:04:20 +0000 (06:04 +0000)]
Split XDR into separate kernel module.  Make krpc depend on xdr.

Reviewed by: rmacklem
Differential Revision: https://reviews.freebsd.org/D24408

4 years agoMove M_RPC malloc type into XDR. Both RPC and XDR libraries use
glebius [Fri, 17 Apr 2020 06:02:13 +0000 (06:02 +0000)]
Move M_RPC malloc type into XDR.  Both RPC and XDR libraries use
this type, but since RPC depends on XDR (not vice versa) we need
it defined in XDR to make the module loadable without RPC.

Reviewed by: rmacklem
Differential Revision: https://reviews.freebsd.org/D24408

4 years agoDon't initialize m->m_data to m->m_pktdat, this is already done by the
glebius [Fri, 17 Apr 2020 05:59:38 +0000 (05:59 +0000)]
Don't initialize m->m_data to m->m_pktdat, this is already done by the
mbuf allocator.  That was the last remnant of such code in the kernel.

4 years agotests: kqueue: use a more precise timer for the NOTE_ABSTIME test
kevans [Fri, 17 Apr 2020 02:22:15 +0000 (02:22 +0000)]
tests: kqueue: use a more precise timer for the NOTE_ABSTIME test

Originally noticed while attempting to run the kqueue tests under
qemu-user-static, this apparently just happens sometimes when running in a
jail in general -- the timer will fire off "too early," but it's really just
the result of imprecise measurements (noted by cem).

Kicking this over to NOTE_USECONDS still tests the correct thing while
allowing it to work more consistently; a basic sanity test reveals that we
often end up coming in just less than 200 microseconds after the timer
fired off.

MFC after: 3 days

4 years agoAdd a sanity check for nes_numsecflavor to the NFS server.
rmacklem [Fri, 17 Apr 2020 02:21:46 +0000 (02:21 +0000)]
Add a sanity check for nes_numsecflavor to the NFS server.

Ryan Moeller reported crashes in the NFS server that appear to be
caused by stack corruption in nfsrv_compound(). It appears that
the stack got corrupted just after a NFSv4.1 Lookup that crosses
a server mount point.
Although it is just a "theory" at this point, the most obvious way
the stack could get corrupted would be if nfsvno_checkexp() somehow
acquires an export with a bogus nes_numsecflavor value. This would
cause the copying of the secflavors to run off the end of the array,
which is allocated on the stack below where the corruption occurs.

This sanity check is simple to do and would stop the stack corruption
if the theory is correct. Otherwise, doing the sanity check seems to
be a reasonable safety belt to add to the code.

Reported by: freqlabs
MFC after: 2 weeks

4 years agoaudit_canon_path_vp: don't panic if cdir == NULL
kevans [Fri, 17 Apr 2020 02:09:31 +0000 (02:09 +0000)]
audit_canon_path_vp: don't panic if cdir == NULL

cdir may have simply failed to resolve (e.g. fget_cap failure in namei
leading to NULL dp passed to AUDIT_ARG_UPATH*_VP); restore the pre-rS358191
behavior of setting cpath[0] = '\0' and bailing out instead of panicking.

This was found by inadvertently running the libc/c063 tests with auditing
enabled, resulting in a panic.

Reviewed by: mjg (committed version actually his)
Differential Revision: https://reviews.freebsd.org/D24445

4 years ago[sh] Fix a "may be unused" warning on mips-gcc
adrian [Thu, 16 Apr 2020 23:31:39 +0000 (23:31 +0000)]
[sh] Fix a "may be unused" warning on mips-gcc

mips-gcc for mips32 was complaining that c was potentially used before
being set.  Setting it to 0 before calling fdgetsc() looks like the right
thing to do in this instance; there's an explicit check for c == 0 later
on.

Tested: mips-gcc mips32 build, running /bin/sh on mips32

4 years ago[libsa] Fix typecast of pointer for st_dev
adrian [Thu, 16 Apr 2020 23:29:49 +0000 (23:29 +0000)]
[libsa] Fix typecast of pointer for st_dev

This code was trying to use a pointer value for st_dev, which is definitely
not a pointer.  Instead, cast to uintptr_t so it becomes a non-pointer value
before casting it.

Tested: mips-gcc cross compile, mips32 build

4 years agoRemove an duplicate definition of nhops_dump_sysctl()
adrian [Thu, 16 Apr 2020 23:28:47 +0000 (23:28 +0000)]
Remove an duplicate definition of nhops_dump_sysctl()

One of the source files included both nhop.h and shared.h, leading to this
clashing.

Tested with: mips-gcc cross toolchain

4 years agoAlert devd when acpi_video brightness changes
cperciva [Thu, 16 Apr 2020 21:56:52 +0000 (21:56 +0000)]
Alert devd when acpi_video brightness changes

On my Dell Latitude 7390 laptop, the brightness hotkeys
(Fn+<up/down arrow>) send ACPI notifications which acpi_video
handles by adjusting its brightness setting; but ACPI does not
actually do anything with the backlight.

Announcing brightness changes via devd makes it possible to close
the loop by triggering the intel_backlight utility to perform the
required backlight adjustment.

Reviewed by: imp
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D24424

4 years agoConvert canary, execpathp, and pagesizes to pointers.
brooks [Thu, 16 Apr 2020 21:53:17 +0000 (21:53 +0000)]
Convert canary, execpathp, and pagesizes to pointers.

Use AUXARGS_ENTRY_PTR to export these pointers.  This is a followup to
r359987 and r359988.

Reviewed by: jhb
Obtained from: CheriBSD
Sponsored by: DARPA
Differential Revision: https://reviews.freebsd.org/D24446

4 years agoUse %zu to print a size_t value instead of %ju.
jhb [Thu, 16 Apr 2020 20:46:35 +0000 (20:46 +0000)]
Use %zu to print a size_t value instead of %ju.

This fixes the build for 32-bit kernels.

4 years agoAdd 'gpio' since mmc now requires gpio_if.h.
jhb [Thu, 16 Apr 2020 20:45:54 +0000 (20:45 +0000)]
Add 'gpio' since mmc now requires gpio_if.h.

4 years agoarm: nvidia: pcie: Rename class name to pcib
manu [Thu, 16 Apr 2020 20:44:23 +0000 (20:44 +0000)]
arm: nvidia: pcie: Rename class name to pcib

Reported by: jhb

4 years agoAvoid calling protocol drain routines more than once per reclamation event.
jtl [Thu, 16 Apr 2020 20:17:24 +0000 (20:17 +0000)]
Avoid calling protocol drain routines more than once per reclamation event.

mb_reclaim() calls the protocol drain routines for each protocol in each
domain. Some protocols exist in more than one domain and share drain
routines. In the case of SCTP, it also uses the same drain routine for
its SOCK_SEQPACKET and SOCK_STREAM entries in the same domain.

On systems with INET, INET6, and SCTP all defined, mb_reclaim() calls
sctp_drain() four times. On systems with INET and INET6 defined,
mb_reclaim() calls tcp_drain() twice. mb_reclaim() is the only in-tree
caller of the pr_drain protocol entry.

Eliminate this duplication by ensuring that each pr_drain routine is only
specified for one protocol entry in one domain.

Reviewed by: tuexen
MFC after: 2 weeks
Sponsored by: Netflix, Inc.
Differential Revision: https://reviews.freebsd.org/D24418

4 years agoAdd a regression test for the changes in r359922 and r359923.
jtl [Thu, 16 Apr 2020 20:07:34 +0000 (20:07 +0000)]
Add a regression test for the changes in r359922 and r359923.

Note that the Python code has been tested on both Python 2.7 and 3.7.

Reviewed by: olivier
MFC after: 2 weeks
Sponsored by: Netflix, Inc.

4 years agoarm: Fix duplicate pcib DRIVER_MODULE
manu [Thu, 16 Apr 2020 18:37:11 +0000 (18:37 +0000)]
arm: Fix duplicate pcib DRIVER_MODULE

Name each pcib driver uniquely.
This remove the warning printed at each arm boot :
module_register: cannot register simplebus/pcib from kernel; already loaded from kernel

4 years agoFix userland build broken by r360014.
melifaro [Thu, 16 Apr 2020 17:53:23 +0000 (17:53 +0000)]
Fix userland build broken by r360014.

4 years agoDocument TCP_TLS_MODE_TOE.
jhb [Thu, 16 Apr 2020 17:41:32 +0000 (17:41 +0000)]
Document TCP_TLS_MODE_TOE.

4 years agostyle(9): end continued line with operator.
brooks [Thu, 16 Apr 2020 17:24:13 +0000 (17:24 +0000)]
style(9): end continued line with operator.