]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
4 years agoMFC r351407: libc: mips: remove unused longjmp.c
Kyle Evans [Tue, 3 Sep 2019 20:15:06 +0000 (20:15 +0000)]
MFC r351407: libc: mips: remove unused longjmp.c

4 years agoMFC r350502:
Konstantin Belousov [Tue, 3 Sep 2019 20:06:36 +0000 (20:06 +0000)]
MFC r350502:
Make umtxq_check_susp() to correctly handle thread exit requests.

4 years agoMFC r349951, r349994, r349995, r350005, r350023 (by jhibbits), r350478:
Konstantin Belousov [Tue, 3 Sep 2019 20:04:44 +0000 (20:04 +0000)]
MFC r349951, r349994, r349995, r350005, r350023 (by jhibbits), r350478:
Provide protection against starvation of the ll/sc loops when accessing
userpace.

4 years agoMFC r350863:
Konstantin Belousov [Tue, 3 Sep 2019 19:56:52 +0000 (19:56 +0000)]
MFC r350863:
compat/linux: Remove obsoleted and somewhat confusing comments related to COMPAT_43.

4 years agoMFC r350862:
Konstantin Belousov [Tue, 3 Sep 2019 19:55:44 +0000 (19:55 +0000)]
MFC r350862:
Only enable COMPAT_43 changes for syscalls ABI for a.out processes.

4 years agoMFC r350204:
Konstantin Belousov [Tue, 3 Sep 2019 19:52:28 +0000 (19:52 +0000)]
MFC r350204:
Switch the rest of the refcount(9) functions to bool return type.

4 years agoMFC r350200:
Konstantin Belousov [Tue, 3 Sep 2019 19:50:38 +0000 (19:50 +0000)]
MFC r350200:
Fix userspace build after r350199.

4 years agoMFC r350199:
Konstantin Belousov [Tue, 3 Sep 2019 19:49:40 +0000 (19:49 +0000)]
MFC r350199:
Check and avoid overflow when incrementing fp->f_count in
fget_unlocked() and fhold().

4 years agoMFC r351458:
Konstantin Belousov [Tue, 3 Sep 2019 19:39:06 +0000 (19:39 +0000)]
MFC r351458:
Add nvdimm(4) man page.

4 years agoMFC r350575:
Konstantin Belousov [Tue, 3 Sep 2019 19:36:46 +0000 (19:36 +0000)]
MFC r350575:
rtld-elf: Remove x86 elf_rtld.x linker scripts.

4 years agoMFC r350504:
Konstantin Belousov [Tue, 3 Sep 2019 19:34:32 +0000 (19:34 +0000)]
MFC r350504:
Try to decrease the number of bugs in unionfs after the VV_TEXT flag removal.

4 years agoMFC r351435:
Konstantin Belousov [Tue, 3 Sep 2019 19:30:02 +0000 (19:30 +0000)]
MFC r351435:
De-commision the MNTK_NOINSMNTQ kernel mount flag.

4 years agoMFC r351114:
Konstantin Belousov [Tue, 3 Sep 2019 19:27:59 +0000 (19:27 +0000)]
MFC r351114:
Fix OOM handling of some corner cases.

4 years agoMFC r350882:
Cy Schubert [Tue, 3 Sep 2019 19:14:00 +0000 (19:14 +0000)]
MFC r350882:

Initialize the frentry (the control block that defines a rule) checksum
to zero. Matching checksums save time and effort by mitigating the need
for full rule compare.

4 years agoMFC r351488
Vincenzo Maffione [Tue, 3 Sep 2019 18:04:45 +0000 (18:04 +0000)]
MFC r351488

netmap: remove obsolete file

The netmap_pt.c module has become obsolete after
the refactoring that added netmap_kloop.c.
Remove it and unlink it from the build system.

4 years agoMFC r351253:
Dimitry Andric [Tue, 3 Sep 2019 17:31:12 +0000 (17:31 +0000)]
MFC r351253:

Pull in r368867 from upstream libc++ trunk (by Marshall Clow):

  Rework recursive_timed_mutex so that it uses __thread_id instead of
  using the lower-level __libcpp_thread_id. This is prep for fixing
  PR42918. Reviewed as https://reviews.llvm.org/D65895

Pull in r368916 from upstream libc++ trunk (by Marshall Clow):

  Fix thread comparison by making sure we never pass our special 'not a
  thread' value to the underlying implementation. Fixes PR#42918.

This should fix std::thread::id::operator==() attempting to call
pthread_equal(3) with zero values.

Reported by: andrew@tao11.riddles.org.uk
PR: 239038, 239550

4 years agoMFC r348628: elf_common: add GNU note types and NT_GNU_PROPERTY_TYPE_0 bits
Ed Maste [Tue, 3 Sep 2019 17:29:01 +0000 (17:29 +0000)]
MFC r348628: elf_common: add GNU note types and NT_GNU_PROPERTY_TYPE_0 bits

To support Intel CET IBT/Shadow Stack.

Sponsored by: The FreeBSD Foundation

4 years agoMFC r350989: Remove some more leftover rlogin man page xrefs
Ed Maste [Tue, 3 Sep 2019 16:57:32 +0000 (16:57 +0000)]
MFC r350989: Remove some more leftover rlogin man page xrefs

rcmds were removed in r32435 and these three man pages can trivially
drop the references.

There's still a reference in pts.4 because it describes a mode
(TIOCPKT_NOSTOP), and only lists rlogin/rlogind as examples of programs
that use that mode.  To update later.

Sponsored by: The FreeBSD Foundation

4 years agoMFC r350983: crunch: remove rsh and rlogin from example config file
Ed Maste [Tue, 3 Sep 2019 16:55:28 +0000 (16:55 +0000)]
MFC r350983: crunch: remove rsh and rlogin from example config file

rcmds removed in r324351.

Historical references in the README are maintained.  There's a paragraph
describing a "980K crunched 'fixit'" that references rsh and rlogin.

Sponsored by: The FreeBSD Foundation

4 years agoMFC r350979: Remove rsh/rlogin references from security man page
Ed Maste [Tue, 3 Sep 2019 16:54:27 +0000 (16:54 +0000)]
MFC r350979: Remove rsh/rlogin references from security man page

More extensive changes to this page are certainly needed, but at least
remove references to binaries that no longer exist.

Sponsored by: The FreeBSD Foundation

4 years agoMFC r350980: Remove rlogin/rsh references from src.conf(5) WITHOUT_BLACKLIST_SUPPORT
Ed Maste [Tue, 3 Sep 2019 16:52:44 +0000 (16:52 +0000)]
MFC r350980: Remove rlogin/rsh references from src.conf(5) WITHOUT_BLACKLIST_SUPPORT

rcmds were removed in r324351

Sponsored by: The FreeBSD Foundation

4 years agoMFC r351134: Add support for 'j', 't' and 'z' flags to kernel sscanf().
Alexander Motin [Tue, 3 Sep 2019 16:38:25 +0000 (16:38 +0000)]
MFC r351134: Add support for 'j', 't' and 'z' flags to kernel sscanf().

4 years agoMFC r351000: sys/{x86,amd64}: remove one of doubled ;s
Ed Maste [Tue, 3 Sep 2019 16:26:35 +0000 (16:26 +0000)]
MFC r351000: sys/{x86,amd64}: remove one of doubled ;s

4 years agoMFC r351395: msdosfs_fat: reduce diffs with NetBSD and makefs
Ed Maste [Tue, 3 Sep 2019 16:25:27 +0000 (16:25 +0000)]
MFC r351395: msdosfs_fat: reduce diffs with NetBSD and makefs

Use pointer arithmetic (as now done in makefs, and in NetBSD) instead of
taking the address of array element.  No functional change, but this
makes it easier to compare different versions of this file.

Sponsored by: The FreeBSD Foundation

4 years agoMFC r351606: Take proper lock in ses_setphyspath_callback().
Alexander Motin [Tue, 3 Sep 2019 16:20:04 +0000 (16:20 +0000)]
MFC r351606: Take proper lock in ses_setphyspath_callback().

XPT_DEV_ADVINFO call should be protected by the lock of the specific
device it is addressed to, not the lock of SES device.  In some weird
case, probably with hardware violating standards, it sometimes caused
NULL dereference due to race.

To protect from it further, add lock assertion to *_dev_advinfo().

4 years agoMFC r350492: vmx: use C99 bool, not boolean_t
Ed Maste [Tue, 3 Sep 2019 16:18:07 +0000 (16:18 +0000)]
MFC r350492: vmx: use C99 bool, not boolean_t

Bhyve's vmm is a self-contained modern component and thus a good
candidate for use of C99 types.

Sponsored by: The FreeBSD Foundation

4 years agoMFC r351425: vtfontcvt: simplify rshift_row
Ed Maste [Tue, 3 Sep 2019 16:15:57 +0000 (16:15 +0000)]
MFC r351425: vtfontcvt: simplify rshift_row

We don't need to specify the buffer size in both bytes and bits.

Sponsored by: The FreeBSD Foundation

4 years agoMFC r351550: Always check cam_periph_error() status for ERESTART.
Alexander Motin [Tue, 3 Sep 2019 14:52:39 +0000 (14:52 +0000)]
MFC r351550: Always check cam_periph_error() status for ERESTART.

Even if we do not expect retries, we better be sure, since otherwise it
may result in use after free kernel panic.  I've noticed that it retries
SCSI_STATUS_BUSY even with SF_NO_RECOVERY | SF_NO_RETRY.

4 years agoMFC r351205: Use calloc().
Xin LI [Tue, 3 Sep 2019 07:02:18 +0000 (07:02 +0000)]
MFC r351205: Use calloc().

4 years agoMFC r351204:
Xin LI [Tue, 3 Sep 2019 06:52:21 +0000 (06:52 +0000)]
MFC r351204:

Remove redundant check and wrong fix: fat.c checks already take care
about cluster chains.

Obtained from: OpenBSD

4 years agoMFC r351542:
Konstantin Belousov [Tue, 3 Sep 2019 06:40:17 +0000 (06:40 +0000)]
MFC r351542:
vn_vget_ino_gen(): relock the lower vnode on error.

4 years agoMFC r351518:
Mark Johnston [Mon, 2 Sep 2019 21:52:18 +0000 (21:52 +0000)]
MFC r351518:
Fix a few nits in vm_pqbatch_process_page().

4 years agoMFC r350957:
Konstantin Belousov [Mon, 2 Sep 2019 08:20:02 +0000 (08:20 +0000)]
MFC r350957:
Increase YPMAXRECORD to 16M to be compatible with Linux.

Sponsored by: Mellanox Technologies

4 years agoMFC r351603: vnic: avoid NULL deref in error case
Ed Maste [Mon, 2 Sep 2019 00:37:59 +0000 (00:37 +0000)]
MFC r351603: vnic: avoid NULL deref in error case

Reported by: Dr Silvio Cesare of InfoSect
Sponsored by: The FreeBSD Foundation

4 years agoMFC r351621: xdma: avoid NULL deref in error case
Ed Maste [Mon, 2 Sep 2019 00:36:26 +0000 (00:36 +0000)]
MFC r351621: xdma: avoid NULL deref in error case

Reported by: Dr Silvio Cesare of InfoSect
Sponsored by: The FreeBSD Foundation

4 years agoMFC r351620: qlxgbe: avoid NULL deref in error case
Ed Maste [Mon, 2 Sep 2019 00:31:03 +0000 (00:31 +0000)]
MFC r351620: qlxgbe: avoid NULL deref in error case

Reported by: Dr Silvio Cesare of InfoSect
Sponsored by: The FreeBSD Foundation

4 years agoMFC r351618, r351619: exynos5: avoid NULL deref in error case
Ed Maste [Mon, 2 Sep 2019 00:29:14 +0000 (00:29 +0000)]
MFC r351618, r351619: exynos5: avoid NULL deref in error case

Reported by: Dr Silvio Cesare of InfoSect
Sponsored by: The FreeBSD Foundation

4 years agoMFC r351587:
Mark Johnston [Sun, 1 Sep 2019 16:57:19 +0000 (16:57 +0000)]
MFC r351587:
Install all bzip2.1 MLINKs from the same place.

4 years agoMFC r351453:
Konstantin Belousov [Sat, 31 Aug 2019 08:40:41 +0000 (08:40 +0000)]
MFC r351453:
Make stack grow use the same gap as stack create.

4 years agoMFC r351563:
Cy Schubert [Sat, 31 Aug 2019 04:28:22 +0000 (04:28 +0000)]
MFC r351563:

Document ipf_nat_hashtab_add() return codes.

4 years agoMFC r351562:
Cy Schubert [Sat, 31 Aug 2019 04:26:59 +0000 (04:26 +0000)]
MFC r351562:

Destroy the mutex in case of error.

Obtained from: NetBSD ip_nat.c r1.7

4 years agoMFC r351561:
Cy Schubert [Sat, 31 Aug 2019 04:25:35 +0000 (04:25 +0000)]
MFC r351561:

Fixup typo in comment.

Obtained from: NetBSD ip_nat.c r1.7

4 years agoMFC r350103:
Cy Schubert [Sat, 31 Aug 2019 04:23:25 +0000 (04:23 +0000)]
MFC r350103:

MFV r350080:

Update sqlite3-3.28.0 (3280000) --> sqlite3-3.29.0 (3290000)

4 years agoBump __FreeBSD_version number for changes made in r351276
Eric Joyner [Fri, 30 Aug 2019 17:36:45 +0000 (17:36 +0000)]
Bump __FreeBSD_version number for changes made in r351276

Sponsored by: Intel Corporation

4 years agoMFC r351397:
Cy Schubert [Thu, 29 Aug 2019 19:13:27 +0000 (19:13 +0000)]
MFC r351397:

MFV r346563:

Update wpa 2.8 --> 2.9

hostapd:
* SAE changes
  - disable use of groups using Brainpool curves
  - improved protection against side channel attacks
  [https://w1.fi/security/2019-6/]
* EAP-pwd changes
  - disable use of groups using Brainpool curves
  - improved protection against side channel attacks
  [https://w1.fi/security/2019-6/]
* fixed FT-EAP initial mobility domain association using PMKSA caching
* added configuration of airtime policy
* fixed FILS to and RSNE into (Re)Association Response frames
* fixed DPP bootstrapping URI parser of channel list
* added support for regulatory WMM limitation (for ETSI)
* added support for MACsec Key Agreement using IEEE 802.1X/PSK
* added experimental support for EAP-TEAP server (RFC 7170)
* added experimental support for EAP-TLS server with TLS v1.3
* added support for two server certificates/keys (RSA/ECC)
* added AKMSuiteSelector into "STA <addr>" control interface data to
  determine with AKM was used for an association
* added eap_sim_id parameter to allow EAP-SIM/AKA server pseudonym and
  fast reauthentication use to be disabled
* fixed an ECDH operation corner case with OpenSSL

wpa_supplicant:
* SAE changes
  - disable use of groups using Brainpool curves
  - improved protection against side channel attacks
  [https://w1.fi/security/2019-6/]
* EAP-pwd changes
  - disable use of groups using Brainpool curves
  - allow the set of groups to be configured (eap_pwd_groups)
  - improved protection against side channel attacks
  [https://w1.fi/security/2019-6/]
* fixed FT-EAP initial mobility domain association using PMKSA caching
  (disabled by default for backwards compatibility; can be enabled
  with ft_eap_pmksa_caching=1)
* fixed a regression in OpenSSL 1.1+ engine loading
* added validation of RSNE in (Re)Association Response frames
* fixed DPP bootstrapping URI parser of channel list
* extended EAP-SIM/AKA fast re-authentication to allow use with FILS
* extended ca_cert_blob to support PEM format
* improved robustness of P2P Action frame scheduling
* added support for EAP-SIM/AKA using anonymous@realm identity
* fixed Hotspot 2.0 credential selection based on roaming consortium
  to ignore credentials without a specific EAP method
* added experimental support for EAP-TEAP peer (RFC 7170)
* added experimental support for EAP-TLS peer with TLS v1.3
* fixed a regression in WMM parameter configuration for a TDLS peer
* fixed a regression in operation with drivers that offload 802.1X
  4-way handshake
* fixed an ECDH operation corner case with OpenSSL

Security:       https://w1.fi/security/2019-6/\
                sae-eap-pwd-side-channel-attack-update.txt

4 years agoMFC r351331:
Mark Johnston [Wed, 28 Aug 2019 16:16:35 +0000 (16:16 +0000)]
MFC r351331:
Don't requeue active pages in vm_swapout_object_deactivate_pages().

4 years agoMFC r351333:
Mark Johnston [Wed, 28 Aug 2019 16:16:14 +0000 (16:16 +0000)]
MFC r351333:
Simplify vm_page_dequeue() and fix an assertion.

4 years agoMFC r351389:
Brooks Davis [Wed, 28 Aug 2019 08:09:10 +0000 (08:09 +0000)]
MFC r351389:

Reorganise conditionals to reduce duplication.

No functional change.

Obtained from: CheriBSD
Sponsored by: DARPA, AFRL

4 years agoMFC r348446:
Brooks Davis [Wed, 28 Aug 2019 08:05:16 +0000 (08:05 +0000)]
MFC r348446:

makesyscalls.sh: always use absolute path for syscalls.conf

syscalls.conf is included using "." which per the Open Group:

 If file does not contain a <slash>, the shell shall use the search
 path specified by PATH to find the directory containing file.

POSIX shells don't fall back to the current working directory.

Submitted by: Nathaniel Wesley Filardo <nwf20@cl.cam.ac.uk>
Reviewed by: bdrewery
Sponsored by: DARPA, AFRL
Differential Revision: https://reviews.freebsd.org/D20476

4 years agoMFC r340424:
Brooks Davis [Wed, 28 Aug 2019 07:53:10 +0000 (07:53 +0000)]
MFC r340424:

Use the main capabilities.conf for freebsd32.

Allow the location of capabilities.conf to be configured.

Also allow a per-abi syscall prefix to be configured with the
abi_func_prefix syscalls.conf variable and check syscalls against
entries in capabilities.conf with and without the prefix amended.

Take advantage of these two features to allow use shared
capabilities.conf
between the default syscall vector and the freebsd32 compatability
layer.  We've been inconsistent about keeping the two in sync as
evidenced by the bugs fixed in r340294.  This eliminates that problem
going forward.

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

4 years agoRegenerate to add @generated tag in generated files.
Brooks Davis [Wed, 28 Aug 2019 07:43:31 +0000 (07:43 +0000)]
Regenerate to add @generated tag in generated files.

This is a manual merge of r347230.

4 years agoMFC r339624:
Brooks Davis [Wed, 28 Aug 2019 07:37:34 +0000 (07:37 +0000)]
MFC r339624:

Remove the need for backslashes in syscalls.master.

Join non-special lines together until we hit a line containing a '}'
character. This allows the function declaration body to be split
across multiple lines without backslash continuation characters.

Continue to join lines ending with backslashes to allow gradual
migration and to support out-of-tree syscall vectors

Reviewed by: emaste, kib
Obtained from: CheriBSD
Sponsored by: DARPA, AFRL
Differential Revision: https://reviews.freebsd.org/D17488

4 years agoMFC r350433: Fix sound on headset jack for ALC255 and ALC256 codec.
Marcelo Araujo [Tue, 27 Aug 2019 07:17:31 +0000 (07:17 +0000)]
MFC r350433: Fix sound on headset jack for ALC255 and ALC256 codec.

PR: 219350 [1], [2]
Submitted by: Masachika ISHIZUKA (ish_at_amail.plala.or.jp) [1]
Neel Chauhan (neel_at_neelc.org) [2]
Yuri Momotyuk (yurkis_at_gmail.com) [3]
Reported by: miwi
Reviewed by: mav
Obtained from: https://github.com/trueos/trueos/pull/279 [3]
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D19017

4 years agoMFC r351105, r351107: Limit memory window usage in ntb_transport to 256MB.
Alexander Motin [Tue, 27 Aug 2019 04:16:42 +0000 (04:16 +0000)]
MFC r351105, r351107: Limit memory window usage in ntb_transport to 256MB.

This adds safety net for the case of misconfigured NTB with too big
memory window, for which we may be unable to allocate a memory buffer,
which does not make much sense for the network interface.  While there,
fix the code to really work with asymmetric window sizes setup.

This makes driver just print warning message on boot instead of hanging
if too large memory window is configured.

4 years agoMFC r351072: Implement new methods for Intel and PLX NTB.
Alexander Motin [Tue, 27 Aug 2019 04:15:21 +0000 (04:15 +0000)]
MFC r351072: Implement new methods for Intel and PLX NTB.

This restores parity with AMD NTB driver.  Though without any drivers
supporting more then one peer and respective KPI modification to pass
peer index to most of the calls this addition is pretty useless now.

4 years agoMFC r351056, r351083: Add support for PCI Device ID 0x148B in ntb_hw_amd driver.
Alexander Motin [Tue, 27 Aug 2019 04:14:38 +0000 (04:14 +0000)]
MFC r351056, r351083: Add support for PCI Device ID 0x148B in ntb_hw_amd driver.

Submitted by: Rajesh Kumar <rajesh1.kumar@amd.com>

4 years agoMFC r349594, r349595, r349601: Add driver for NTB in AMD SoC.
Alexander Motin [Tue, 27 Aug 2019 04:13:22 +0000 (04:13 +0000)]
MFC r349594, r349595, r349601: Add driver for NTB in AMD SoC.

This patch is the driver for NTB hardware in AMD SoCs (ported from Linux)
and enables the NTB infrastructure like Doorbells, Scratchpads and Memory
window in AMD SoC. This driver has been validated using ntb_transport and
if_ntb driver already available in FreeBSD.

Submitted by: Rajesh Kumar <rajesh1.kumar@amd.com>
Relnotes: yes

4 years agoMFC r351352: Improve NVMe hot unplug handling.
Alexander Motin [Tue, 27 Aug 2019 04:04:19 +0000 (04:04 +0000)]
MFC r351352: Improve NVMe hot unplug handling.

If device is unplugged from the system (CSTS register reads return
0xffffffff), it makes no sense to send any more recovery requests or
expect any responses back.  If there is a detach call in such state,
just stop all activity and free resources.  If there is no detach
call (hot-plug is not supported), rely on normal timeout handling,
but when it trigger controller reset, do not wait for impossible and
quickly report failure.

Sponsored by: iXsystems, Inc.

4 years agoMFC r351320: Formalize NVMe controller consumer life cycle.
Alexander Motin [Tue, 27 Aug 2019 04:03:42 +0000 (04:03 +0000)]
MFC r351320: Formalize NVMe controller consumer life cycle.

This fixes possible double call of fail_fn, for example on hot removal.
It also allows ctrlr_fn to safely return NULL cookie in case of failure
and not get useless ns_fn or fail_fn call with NULL cookie later.

4 years agoMFC r351038: Print few more useful identify fields.
Alexander Motin [Tue, 27 Aug 2019 04:02:25 +0000 (04:02 +0000)]
MFC r351038: Print few more useful identify fields.

4 years agoMFC r351028: Report NOIOB and NPWG fields as stripe size.
Alexander Motin [Tue, 27 Aug 2019 04:01:56 +0000 (04:01 +0000)]
MFC r351028: Report NOIOB and NPWG fields as stripe size.

Namespace Optimal I/O Boundary field added in NVMe 1.3 and Namespace
Preferred Write Granularity added in 1.4 allow upper layers to align
I/Os for improved SSD performance and endurance.

I don't have hardware reportig those yet, but NPWG could probably be
reported by bhyve.

Sponsored by: iXsystems, Inc.

4 years agoMFC r351004, r351006: Make nvd(4) report NGUID or EUI64 as GEOM::lunid.
Alexander Motin [Tue, 27 Aug 2019 04:01:09 +0000 (04:01 +0000)]
MFC r351004, r351006: Make nvd(4) report NGUID or EUI64 as GEOM::lunid.

With support for multiple namespaces and multiple ports in NVMe there is
now a need for reliable unique namespace identification alike to SCSI.

Sponsored by: iXsystems, Inc.

4 years agoMFC r350676, r350677: Make `camcontrol modepage` support block descriptors.
Alexander Motin [Tue, 27 Aug 2019 03:55:38 +0000 (03:55 +0000)]
MFC r350676, r350677: Make `camcontrol modepage` support block descriptors.

It allows to read and write block descriptors alike to mode page parameters.
It allows to change block size or short-stroke HDDs or overprovision SSDs.
Depenting on -P parameter the change can be either persistent or till reset.
In case of block size change device may need reformat after the setting.
In case of SSD overprovisioning format or sanitize may be needed to really
free the flash.

During implementation appeared that csio_encode_visit() can not handle
integers of more then 4 bytes, that makes 8-byte LBA handling awkward.
I had to split it into two 4-byte halves now.

Relnotes: yes
Sponsored by: iXsystems, Inc.

4 years agoMFC r350457: Make `camcontrol modepage` to use 10 byte commands.
Alexander Motin [Tue, 27 Aug 2019 03:54:29 +0000 (03:54 +0000)]
MFC r350457: Make `camcontrol modepage` to use 10 byte commands.

While old devices may not support 10 byte MODE SENSE/MODE SELECT commands,
new ones may not be able to report all mode pages with 6 byte commands.

This patch makes camcontrol by default start with 10 byte commands and
fall back to 6 byte on ILLEGAL REQUEST error, or 6 byte can be forced.

4 years agoMFC r350424: Use present now scsi_mode_sense_subpage().
Alexander Motin [Tue, 27 Aug 2019 03:53:22 +0000 (03:53 +0000)]
MFC r350424: Use present now scsi_mode_sense_subpage().

4 years agoMFC r350393: Decode some more IDENTIFY DEVICE bits.
Alexander Motin [Tue, 27 Aug 2019 03:52:22 +0000 (03:52 +0000)]
MFC r350393: Decode some more IDENTIFY DEVICE bits.

4 years agoMFC r351348 (by markj):
Alexander Motin [Tue, 27 Aug 2019 03:05:57 +0000 (03:05 +0000)]
MFC r351348 (by markj):
Modify pipe_poll() to properly check for pending direct writes.

With r349546, it is a responsibility of the writer to clear PIPE_DIRECTW
after pinned data has been read.  In particular, once a reader has
drained this data, there is a small window where the pipe is empty but
PIPE_DIRECTW is set.  pipe_poll() was using the presence of PIPE_DIRECTW
to determine whether to return POLLIN, so in this window it would
claim that data was available to read when this was not the case.

Fix this by modifying several checks for PIPE_DIRECTW to instead look
at the number of residual bytes in data pinned by a direct writer.  In
some cases we really do want to check for PIPE_DIRECTW, since the
presence of this flag indicates that any attempt to write to the pipe
will block on the existing direct writer.

4 years agoMFC 349474: Reject attempts to register a TCP stack being unloaded.
John Baldwin [Tue, 27 Aug 2019 00:29:30 +0000 (00:29 +0000)]
MFC 349474: Reject attempts to register a TCP stack being unloaded.

4 years agoMFC r351221
Vincenzo Maffione [Mon, 26 Aug 2019 18:57:29 +0000 (18:57 +0000)]
MFC r351221

link ptnet(4) man page to the build system

Reported by:    kevans
Reviewed by:    kevans, bcr
Differential Revision:  https://reviews.freebsd.org/D21312

4 years agoMFC r351119, r351135-r351136, r351412: stand xtoolchain-llvm90 fixes
Kyle Evans [Mon, 26 Aug 2019 17:34:07 +0000 (17:34 +0000)]
MFC r351119, r351135-r351136, r351412: stand xtoolchain-llvm90 fixes

r351119:
stand: push LIBC_SRC up into defs.mk

Other parts of stand/ that don't use libsa will need to grab bits from libc
shortly. Push LIBC_SRC up to defs.mk in advance of this so that they can use
it, and rename it to LIBCSRC to match the convention of the rest of the *SRC
variables in this file.

r351135:
stand: boot2: fix build with xtoolchain-llvm90

ufsread.c grows a dependency on __ashldi3 with llvm90. Grab ashldi3.c out of
compiler-rt rather than trying to link against libsa (for now).
-Wno-missing-prototypes is necessary to compile ashldi3.c standalone.

r351136:
stand: gptboot: fix build with xtoolchain-llvm90

ufsread.c grows a dependency on __ashldi3 with llvm90. For gptboot, just
start pulling in ashldi3.c ashrdi3.c lshrdi3.c into libsa for all archs as
the number of archs requiring one or more of them keeps growing. qdivrem.c
and quad.h can be trivially kicked out of libsa if we start pulling these
from compiler-rt as qdivrem was only used to implement umoddi3, divdi3,
moddi3 (also in qdivrem.c).

r351412:
stand: boot2: fix amd64-xtoolchain-gcc build

-Wno-missing-declarations is the GCC equivalent of
-Wno-missing-prototypes... this was overlooked in r351135.

4 years agoMFC r351359:
Mark Johnston [Mon, 26 Aug 2019 15:21:29 +0000 (15:21 +0000)]
MFC r351359:
Fix inverted predicates for sx lock hold events in lockstat(1).

4 years agoMFC r351214:
Andrey V. Elsukov [Mon, 26 Aug 2019 09:29:14 +0000 (09:29 +0000)]
MFC r351214:
  Use TAILQ_FOREACH_SAFE() macro to avoid use after free in soclose().

  PR: 239893

4 years agoMFC r351211:
Konstantin Belousov [Mon, 26 Aug 2019 08:07:10 +0000 (08:07 +0000)]
MFC r351211:
sys.kern.pdeathsig.signal_delivered_ptrace: fix startup.

PR: 237657

4 years agoMFC r351210:
Konstantin Belousov [Mon, 26 Aug 2019 08:06:18 +0000 (08:06 +0000)]
MFC r351210:
sys.kern.pdeathsig.signal_delivered_ptrace: fix debugger detach

PR: 237657

4 years agoMFC r350881:
Cy Schubert [Sun, 25 Aug 2019 13:36:20 +0000 (13:36 +0000)]
MFC r350881:

Calculate the number interface array elements using the new FR_NUM macro
instead of the hard-coded value of 4. This is a precursor to increasing
the number of interfaces speficied in "on {interface, ..., interface}".
Note that though this feature is coded in ipf_y.y, it is partially
supported in the ipfilter kld, meaning it does not work yet (and is yet
to be documented in ipf.5 too).

4 years agoMFC r351195:
Konstantin Belousov [Sun, 25 Aug 2019 06:22:13 +0000 (06:22 +0000)]
MFC r351195:
Fix an issue with executing tmpfs binary.

4 years agoMFC r351194:
Konstantin Belousov [Sun, 25 Aug 2019 06:19:51 +0000 (06:19 +0000)]
MFC r351194:
Change locking requirements for VOP_UNSET_TEXT().

4 years agoMFC r351190:
Konstantin Belousov [Sun, 25 Aug 2019 06:14:00 +0000 (06:14 +0000)]
MFC r351190:
i386: Implement atomic_load_64(9) and atomic_store_64(9).

4 years agoMFC r350880:
Cy Schubert [Sun, 25 Aug 2019 04:56:33 +0000 (04:56 +0000)]
MFC r350880:

r272552 applied the patch from ipfilter upstream fil.c r1.129 to fix
broken ipfilter rule matches (upstream bug #554). The upstream patch
was incomplete, it resolved all but one rule compare issue. The issue
fixed here is when "{to, reply-to, dup-to} interface" are used in
conjuncion with "on interface". The match was only made if the on keyword
was specified in the same order in each case referencing the same rule.
This commit fixes this.

The reason for this is that interface name strings and comment keyword
comments are stored in a a variable length field starting at fr_names
in the frentry struct. These strings are placed into this variable length
in the order they are encountered by ipf_y.y and indexed through index
pointers in fr_ifnames, fr_comment or one of the frdest struct fd_name
fields. (Three frdest structs are within frentry.) Order matters and
this patch takes this into account.

While in here it was discovered that though ipfilter is designed to
pport multiple interface specifiations per rule (up to four), this
undocumented (the man page makes no mention of it) feature does not work.
A todo is to fix the multiple interfaces feature at a later date. To
understand the design decision as to why only four were intended, it is
suspected that the decision was made because Sun workstations and PCs
rarely if ever exceeded four NICs at the time, this is not true in 2019.

PR: 238796
Reported by: WHR <msl0000023508@gmail.com>

4 years agoMFC r351380:
Cy Schubert [Sun, 25 Aug 2019 01:09:31 +0000 (01:09 +0000)]
MFC r351380:

Specifying array sizes for fully initialized tables at compile time is
redundant.

4 years agoMFC r351179: simple_httpd was not buildable for some time
Eugene Grosbein [Sun, 25 Aug 2019 00:55:41 +0000 (00:55 +0000)]
MFC r351179: simple_httpd was not buildable for some time
due to multiple missing "static" keywords
and -Werror,-Wmissing-variable-declarations

This change adds needed "static" so it builds again with WARNS?=6
No functional changes.

4 years agoMFC r351349:
Konstantin Belousov [Sat, 24 Aug 2019 12:51:46 +0000 (12:51 +0000)]
MFC r351349:
Fix _pthread_cancel_enter() and _pthread_cancel_leave() jmptable entries.

PR: 240022

4 years agoMFC 350551:
John Baldwin [Sat, 24 Aug 2019 00:35:59 +0000 (00:35 +0000)]
MFC 350551:
Don't reset memory attributes when mapping physical addresses for ACPI.

Previously, AcpiOsMemory was using pmap_mapbios which would always map
the requested address Write-Back (WB).  For several AMD Ryzen laptops,
the BIOS uses AcpiOsMemory to directly access the PCI MCFG region in
order to access PCI config registers.  This has the side effect of
remapping the MCFG region in the direct map as WB instead of UC
hanging the laptops during boot.

On the one laptop I examined in detail, the _PIC global method used to
switch from 8259A PICs to I/O APICs uses a pair of PCI config space
registers at offset 0x84 in the device at 0:0:0 to as a pair of
address/data registers to access an indirect register in the chipset
and clear a single bit to switch modes.

To fix, alter the semantics of pmap_mapbios() such that it does not
modify the attributes of any existing mappings and instead uses the
existing attributes.  If a new mapping is created, this new mapping
uses WB (the default memory attribute).

Special thanks to the gentleman whose name I don't have who brought
two affected laptops to the hacker lounge at BSDCan.  Direct access to
the affected systems permitted finding the root cause within an hour
or so.

PR: 231760, 236899

4 years agoMFC r351070: telnet: remove 3rd clause from Berkeley copyrights
Ed Maste [Fri, 23 Aug 2019 17:39:59 +0000 (17:39 +0000)]
MFC r351070: telnet: remove 3rd clause from Berkeley copyrights

Per the July 22, 1999 letter (in /COPYRIGHT) from
William Hoskins
Director, Office of Technology Licensing
University of California, Berkeley

4 years agovtfontcvt: improve BDF and hex font parsing
Ed Maste [Fri, 23 Aug 2019 16:18:25 +0000 (16:18 +0000)]
vtfontcvt: improve BDF and hex font parsing

MFC r348661: vtfontcvt: rework height/width setting

Introduce VFNT_MAXDIMENSION to replace bare 128, add set_height, and
consistently use set_height and set_width.

Submitted by: Dmitry Wagin

MFC r348662: vtfontcvt: include width and height in verbose info

Submitted by: Dmitry Wagin

MFC r348668: vtfontcvt: zero memory allocated by xmalloc

Submitted by: Dmitry Wagin

MFC r348692: vtfontcvt: exit on error if the input font has too many glyphs

The kernel has a limit of 131072 glyphs in a font; add the same check to
vtfontcvt so that we won't create a font file that the kernel will not
load.

MFC r348796: vtfontcvt: allow out-of-order glyphs

Reported by: mi

MFC r349049: vtfontcvt: add comments in add_glyph

MFC r349100: vtfontcvt: improve BDF and hex font parsing

Support larger font sizes.

Submitted by: Dmitry Wagin (original version)

MFC r349101: vtfontcvt: initialize bbwbytes to avoid GCC 4.2.1 warning

MFC r349105: vtfontcvt: initialize another variable to quiet GCC warning

I believe this case could be triggered by a broken .bdf font.

MFC r349107: vtfontcvt: improve .bdf verification

Previously we would crash if the BBX y-offset was outside of the font
bounding box.

Reported by: afl fuzzer

MFC r349108: vtfontcvt: improve .bdf validation

Previously if we had a BBX entry that had invalid values (e.g. bounding
box outside of font bounding box) and failed sscanf (e.g., because it
had fewer than four values) we skipped the BBX value validation and then
triggered an assertion failure.

Reported by: afl fuzzer

MFC r349111: vtfontcvt: correct typo in hex parsing update

Submitted by: Dmitry Wagin

MFC r349333: vtfontcvt: improve .bdf validation

Previously if we had a FONTBOUNDINGBOX or DWIDTH entry that had missing
or invalid values and and failed sscanf, we would proceeded with
partially initialized bounding box / device width variables.

Reported by: afl fuzzer (FONTBOUNDINGBOX)

PR: 205707
Sponsored by: The FreeBSD Foundation

4 years agoMFC r350974:
Andrey V. Elsukov [Fri, 23 Aug 2019 10:11:10 +0000 (10:11 +0000)]
MFC r350974:
  Since ipvoly is used for checksum calculation, part of original IP
  header is zeroed. This part includes ip_ttl field, that can be used
  later in IP_MINTTL socket option handling.

  PR: 239799

4 years agoMFC r350351:
Baptiste Daroussin [Thu, 22 Aug 2019 11:32:03 +0000 (11:32 +0000)]
MFC r350351:

Update mandoc to cvs snapshot 2019-07-23

This snapshot among other things includes a fix for a crash of mandoc with empty
tbl reported by rea@ (his regression test has been incorporated upstream)

4 years agoMFC r351071:
Andrey V. Elsukov [Thu, 22 Aug 2019 08:47:18 +0000 (08:47 +0000)]
MFC r351071:
  Fix rule truncation on external action module unloading.

4 years agoloader: support com.delphix:removing
Toomas Soome [Thu, 22 Aug 2019 07:37:34 +0000 (07:37 +0000)]
loader: support com.delphix:removing

MFC r348353: boot1.efi should also provide Calloc
MFC r350772: loader: support com.delphix:removing
MFC r350825: loader: add error check for vdev_indirect calls

As prerequisite, we need Calloc in boot1 so we would not conflict with libsa.

We should support removing vdev from boot pool. Update loader zfs reader
to support com.delphix:removing.

Relnotes: yes

4 years agoMFC r350894: a stop gap fix for a race between dnode_hold and dnode_sync_free
Andriy Gapon [Thu, 22 Aug 2019 07:17:49 +0000 (07:17 +0000)]
MFC r350894: a stop gap fix for a race between dnode_hold and dnode_sync_free

The race was introduced in r337669, the large dnode feature import from
ZoL.  The problem was debugged by ZoL developers and then,
independently, on FreeBSD.

The fix is an early proposal by Brian Behlendorf:
https://github.com/behlendorf/zfs/commit/50f32ed74e42aa28522e9681fb8ae55239fa33a7
This fix never went into ZoL.  A larger change that was committed later
included a different solution because of the re-worked code.

Ideally, we want to revert this fix and re-synchronize FreeBSD large
dnode code with that in illumos (or newer ZoL).  illumos has a later
import of the feature from ZoL that does not have the bug.

PR: 236480

4 years agoarch.7: add default tool chain table
Ed Maste [Thu, 22 Aug 2019 00:33:22 +0000 (00:33 +0000)]
arch.7: add default tool chain table

MFC r351035: arch.7: add tool chain table
MFC r351036: arch.7: add deprecation notice for GCC 4.2.1
MFC r351037: arch.7: clarify that the table shows the default tool chain
MFC r351063: arch.7: be explicit about the future for unmigrated GCC 4.2.1 archs

4 years agoMFC 350666:
John Baldwin [Wed, 21 Aug 2019 23:44:46 +0000 (23:44 +0000)]
MFC 350666:
Tidy up the list of auth and encryption algorithms for IPsec stats.

- Use keyed-md5 and keyed_sha1 instead of md5 and sha1 to match
  the names accepted by setkey and to also avoid confusion since
  these are not "plain" MD5 or SHA1.
- Remove always-true #ifdef's to make the source a bit easier to
  read.
- Add missing mappings for tcp-md5, camellia-cbc, and aes-gmac.

4 years agoMFC 348970,348974:
John Baldwin [Wed, 21 Aug 2019 22:42:08 +0000 (22:42 +0000)]
MFC 348970,348974:
Make the warning intervals for deprecated crypto algorithms tunable.

348970:
Make the warning intervals for deprecated crypto algorithms tunable.

New sysctl/tunables can now set the interval (in seconds) between
rate-limited crypto warnings.  The new sysctls are:
- kern.cryptodev_warn_interval for /dev/crypto
- net.inet.ipsec.crypto_warn_interval for IPsec
- kern.kgssapi_warn_interval for KGSSAPI

348974:
Move declaration of warninterval out from under COMPAT_FREEBSD32.

This fixes builds of kernels without COMPAT_FREEBSD32.

4 years agoMFC r350421:
Mark Johnston [Wed, 21 Aug 2019 18:28:38 +0000 (18:28 +0000)]
MFC r350421:
Avoid relying on header pollution from sys/refcount.h.

4 years agoMFC r342731:
Mark Johnston [Wed, 21 Aug 2019 16:27:19 +0000 (16:27 +0000)]
MFC r342731:
Configure hz=100 in the QEMU target.

4 years agoMFC r350003:
Mark Johnston [Wed, 21 Aug 2019 16:19:06 +0000 (16:19 +0000)]
MFC r350003:
pmap_clear_modify() needs to clear PTE_W.

4 years agoMFC r350002:
Mark Johnston [Wed, 21 Aug 2019 16:18:32 +0000 (16:18 +0000)]
MFC r350002:
Fix reference counting in pmap_ts_referenced() on RISC-V.

4 years agoMFC r350423:
Mark Johnston [Wed, 21 Aug 2019 16:17:54 +0000 (16:17 +0000)]
MFC r350423:
Remove a duplicate file listing in the libarchive tests.

4 years agoMFC r350782:
Mark Johnston [Wed, 21 Aug 2019 16:17:22 +0000 (16:17 +0000)]
MFC r350782:
Flesh out the STANDARDS and AUTHORS sections in the du(1) man page.

PR: 239722

4 years agoMFC r350781:
Mark Johnston [Wed, 21 Aug 2019 16:16:52 +0000 (16:16 +0000)]
MFC r350781:
Update RFC references in the whois(1) man page.

PR: 239720