Commit Graph

229533 Commits

Author SHA1 Message Date
Ruslan Bukin
11e11bd6d8 Add basic driver for Qualcomm USB 2.0 EHCI controller.
This driver relies on system initialization in u-boot.

Tested on DragonBoard 410c.

Sponsored by:	DARPA, AFRL
2018-01-25 16:58:23 +00:00
Warner Losh
d3de39bff0 Bump .Dd date for c99 change 2018-01-25 15:55:58 +00:00
Warner Losh
88c53cfda1 Add info about c99 designationed initializers.
Differential Revision: https://reviews.freebsd.org/D13975
2018-01-25 15:42:21 +00:00
Mark Johnston
5557762b72 Use tcpinfoh_t for TCP headers in the tcp:::debug-{drop,input} probes.
The header passed to these probes has some fields converted to host
order by tcp_fields_to_host(), so the tcpinfo_t translator doesn't do
what we want.

Submitted by:	Hannes Mehnert
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D12647
2018-01-25 15:35:34 +00:00
Mark Johnston
3ddcfe1e46 Remove uneeded parentheses.
MFC after:	1 week
2018-01-25 15:31:56 +00:00
Ed Maste
5bb40331f6 uefi.8: describe architecture-specific default path
Sponsored by:	The FreeBSD Foundation
2018-01-25 14:36:47 +00:00
Ed Maste
084f772fb4 Install uefi.8 also on arm64
Our standard boot method for arm64 is via UEFI, so install the man page
that describes the boot process.

MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
2018-01-25 13:51:20 +00:00
Wojciech Macek
74549d4b0f BPF: Switch to 32 bit compatible mode only when thread is 32 bit
Sometimes 32 bit and 64 bit ioctls are represented by the same number.
It causes unnecessary switch to 32 bit commpatible mode.

This patch prevents switching when we are dealing with 64 bit executable.
It fixes issue mentioned here

Authored by:           Patryk Duda <pdk@semihalf.com>
Submitted by:          Wojciech Macek <wma@semihalf.com>
Reviewed by:           andrew, wma
Obtained from:         Semihalf
Sponsored by:          IBM, QCM Technologies
Differential revision: https://reviews.freebsd.org/D14023
2018-01-25 12:13:41 +00:00
Li-Wen Hsu
af89fcf725 Fix architectures where pointer and u_int have different sizes
Reviewed by:	imp
Differential Revision:	https://reviews.freebsd.org/D14049
2018-01-25 08:36:19 +00:00
Li-Wen Hsu
5a70796a71 Fix build for architectures where size_t is not unsigned long
Reviewed by:	cem
Differential Revision:	https://reviews.freebsd.org/D14045
2018-01-25 06:37:14 +00:00
Michael Zhilin
1b8be09a20 [etherswitch] fix LINT build for rtl8366rb
Build with rtl8366rb has been broken due to incorrect retrieval of pointer
to device_t.

Reported by:	lwhsu
Differential Revision:	https://reviews.freebsd.org/D14044
2018-01-25 05:48:42 +00:00
Li-Wen Hsu
c676c939e2 Fix manual page install on non-amd64
Reviewed by:	emaste, imp
Differential Revision:	https://reviews.freebsd.org/D14038
2018-01-25 05:15:44 +00:00
Warner Losh
8f182e3ff6 Minor whitespace cleanup to remove leading space before tab. No
functional changes.
2018-01-25 02:52:44 +00:00
Kirk McKusick
a6bbdf81b5 More throughly integrate libufs into fsck_ffs by using its cgput()
routine to write out the cylinder groups rather than recreating the
calculation of the cylinder-group check hash in fsck_ffs.

No functional change intended.
2018-01-24 23:57:40 +00:00
Kirk McKusick
4cfb30ed21 Update .Dd missed in -r328304.
Reported by: Bjoern Zeeb (bz)
MFC with:    328304
2018-01-24 22:36:21 +00:00
Dimitry Andric
042b1c2ef5 Upgrade our copies of clang, llvm, lld, lldb, compiler-rt and libc++ to
6.0.0 (branches/release_60 r323338).

MFC after:	3 months
X-MFC-With:	r327952
PR:		224669
2018-01-24 22:35:00 +00:00
Emmanuel Vadot
09ac343759 arm: lpc: Remove support
Code hasn't been touch this it's original commit in 2012 beside api changes.

Reviewed by:	ian
Differential Revision:	https://reviews.freebsd.org/D13625
Discussed with:		freebsd-arm@freebsd.org (no reply)
2018-01-24 22:04:16 +00:00
Ed Maste
88df3117b3 Add efi.8 as a man page link to uefi.8
FreeBSD and industry has been inconsistent in the use of UEFI and EFI.
They are essentially just different versions of the same specification
and are often used interchangeably.  Make it easier for users to find
information by making efi(8) an alias for uefi(8).

Reported by:	imp, jhb
2018-01-24 21:39:40 +00:00
Michael Zhilin
0774131e27 [etherswitch] check if_alloc returns NULL
This patch is cosmetic. It checks if allocation of ifnet structure failed.
It's better to have this check rather than assume positive scenario.

Submitted by:	Dmitry Luhtionov <dmitryluhtionov@gmail.com>
Reported by:	Dmitry Luhtionov <dmitryluhtionov@gmail.com>
2018-01-24 21:33:18 +00:00
Ed Maste
9f747dc6dc uefi.8: add .Xr cross references to new efi tools 2018-01-24 21:26:01 +00:00
Ed Maste
e30f16baf2 uefi.8: note that UEFI and EFI are used interchangeably 2018-01-24 21:20:24 +00:00
Ed Maste
e20102cdda uefi.8: update HISTORY and remove incomplete AUTHORS
- EFI support appeared in 5.0 for ia64
- arm64 UEFI support added in 11.0

The AUTHORS section included the folks responsible for the bulk of the
work to bring UEFI support to amd64, but missed those who did the
original work on ia64, the initial port to i386, the ports to arm64 and
arm, and have generally maintained and improved general UEFI support
since then.  It's unwieldly to include everyone and would quickly become
outdated again anyhow, so just remove the AUTHORS section.

Reviewed by:	manu
Discussed with:	jhb
Differential Revision:	https://reviews.freebsd.org/D14033
2018-01-24 21:11:35 +00:00
Dimitry Andric
a2cf70158c Vendor import of lldb release_60 branch r323338:
https://llvm.org/svn/llvm-project/lldb/branches/release_60@323338
2018-01-24 20:26:12 +00:00
Dimitry Andric
a506d0d6a9 Vendor import of lld release_60 branch r323338:
https://llvm.org/svn/llvm-project/lld/branches/release_60@323338
2018-01-24 20:26:03 +00:00
Dimitry Andric
40e3ad2a19 Vendor import of libc++ release_60 branch r323338:
https://llvm.org/svn/llvm-project/libcxx/branches/release_60@323338
2018-01-24 20:25:56 +00:00
Dimitry Andric
b99ba46cc7 Vendor import of compiler-rt release_60 branch r323338:
https://llvm.org/svn/llvm-project/compiler-rt/branches/release_60@323338
2018-01-24 20:25:48 +00:00
Dimitry Andric
520a89e9d3 Vendor import of clang release_60 branch r323338:
https://llvm.org/svn/llvm-project/cfe/branches/release_60@323338
2018-01-24 20:25:37 +00:00
Dimitry Andric
a096e0bdf6 Vendor import of llvm release_60 branch r323338:
https://llvm.org/svn/llvm-project/llvm/branches/release_60@323338
2018-01-24 20:23:48 +00:00
John Baldwin
c0154062c7 Store IV in output buffer in GCM software fallback when requested.
Properly honor the lack of the CRD_F_IV_PRESENT flag in the GCM
software fallback case for encryption requests.

Submitted by:	Harsh Jain @ Chelsio
Sponsored by:	Chelsio Communications
2018-01-24 20:16:48 +00:00
John Baldwin
2bc40b6ca9 Don't read or generate an IV until all error checking is complete.
In particular, this avoids edge cases where a generated IV might be
written into the output buffer even though the request is failed with
an error.

Sponsored by:	Chelsio Communications
2018-01-24 20:15:49 +00:00
John Baldwin
04043b3dcd Expand the software fallback for GCM to cover more cases.
- Extend ccr_gcm_soft() to handle requests with a non-empty payload.
  While here, switch to allocating the GMAC context instead of placing
  it on the stack since it is over 1KB in size.
- Allow ccr_gcm() to return a special error value (EMSGSIZE) which
  triggers a fallback to ccr_gcm_soft().  Move the existing empty
  payload check into ccr_gcm() and change a few other cases
  (e.g. large AAD) to fallback to software via EMSGSIZE as well.
- Add a new 'sw_fallback' stat to count the number of requests
  processed via the software fallback.

Submitted by:	Harsh Jain @ Chelsio (original version)
Sponsored by:	Chelsio Communications
2018-01-24 20:14:57 +00:00
John Baldwin
bf5b662033 Clamp DSGL entries to a length of 2KB.
This works around an issue in the T6 that can result in DMA engine
stalls if an error occurs while processing a DSGL entry with a length
larger than 2KB.

Submitted by:	Harsh Jain @ Chelsio
Sponsored by:	Chelsio Communications
2018-01-24 20:13:07 +00:00
John Baldwin
f7b61e2fcc Fail crypto requests when the resulting work request is too large.
Most crypto requests will not trigger this condition, but a request
with a highly-fragmented data buffer (and a resulting "large" S/G
list) could trigger it.

Sponsored by:	Chelsio Communications
2018-01-24 20:12:00 +00:00
John Baldwin
5929c9fb13 Don't discard AAD and IV output data for AEAD requests.
The T6 can hang when processing certain AEAD requests if the request
sets a flag asking the crypto engine to discard the input IV and AAD
rather than copying them into the output buffer.  The existing driver
always discards the IV and AAD as we do not need it.  As a workaround,
allocate a single "dummy" buffer when the ccr driver attaches and
change all AEAD requests to write the IV and AAD to this scratch
buffer.  The contents of the scratch buffer are never used (similar to
"bogus_page"), and it is ok for multiple in-flight requests to share
this dummy buffer.

Submitted by:	Harsh Jain @ Chelsio (original version)
Sponsored by:	Chelsio Communications
2018-01-24 20:11:00 +00:00
John Baldwin
acaabdbbee Reject requests with AAD and IV larger than 511 bytes.
The T6 crypto engine's control messages only support a total AAD
length (including the prefixed IV) of 511 bytes.  Reject requests with
large AAD rather than returning incorrect results.

Sponsored by:	Chelsio Communications
2018-01-24 20:08:10 +00:00
John Baldwin
020ce53af3 Always set the IV location to IV_NOP.
The firmware ignores this field in the FW_CRYPTO_LOOKASIDE_WR work
request.

Submitted by:	Harsh Jain @ Chelsio
Sponsored by:	Chelsio Communications
2018-01-24 20:06:02 +00:00
John Baldwin
d3f25aa152 Always store the IV in the immediate portion of a work request.
Combined authentication-encryption and GCM requests already stored the
IV in the immediate explicitly.  This extends this behavior to block
cipher requests to work around a firmware bug.  While here, simplify
the AEAD and GCM handlers to not include always-true conditions.

Submitted by:	Harsh Jain @ Chelsio
Sponsored by:	Chelsio Communications
2018-01-24 20:04:08 +00:00
Andrey V. Elsukov
055679e67e Adopt revision 1.76 and 1.77 from NetBSD:
Fix a vulnerability in IPsec-IPv6-AH, that allows an attacker to remotely
  crash the kernel with a single packet.

  In this loop we need to increment 'ad' by two, because the length field
  of the option header does not count the size of the option header itself.

  If the length is zero, then 'count' is incremented by zero, and there's
  an infinite loop. Beyond that, this code was written with the assumption
  that since the IPv6 packet already went through the generic IPv6 option
  parser, several fields are guaranteed to be valid; but this assumption
  does not hold because of the missing '+2', and there's as a result a
  triggerable buffer overflow (write zeros after the end of the mbuf,
  potentially to the next mbuf in memory since it's a pool).

  Add the missing '+2', this place will be reinforced in separate commits.

Reported by:	Maxime Villard <maxv at NetBSD.org>
MFC after:	1 week
2018-01-24 19:48:25 +00:00
Conrad Meyer
bd555da94b malloc(9): Change nominal size to size_t to match standard C
No functional change -- size_t matches unsigned long on all platforms.

Reported by:	bde
Discussed with:	jhb
Sponsored by:	Dell EMC Isilon
2018-01-24 19:37:18 +00:00
Andrey V. Elsukov
b12a7532e3 Merge revision 1.35 from NetBSD:
fix pointer/offset mistakes in handling of IPv4 options

Reported by:	Maxime Villard <maxv at NetBSD.org>
MFC after:	1 week
2018-01-24 19:06:44 +00:00
Ian Lepore
1f23f8b0fe Make the trivial imx_soc_family() function an inline in imx_machdep.h.
The imx_machdep.c file is on the fast path to non-existance and this would
be the only thing left in it after some watchdog changes are completed.
2018-01-24 18:10:11 +00:00
Bryan Drewery
553b3bb89d test-system-compiler: Display X_ variants for compiler/linker.
Sponsored by:	Dell EMC
2018-01-24 18:09:44 +00:00
Bryan Drewery
1c0cac23cf X_COMPILER_* may not be defined.
Sponsored by:	Dell EMC
2018-01-24 18:08:37 +00:00
Pedro F. Giffuni
a94a2945be ext2fs|ufs:Unsign some values related to allocation.
When allocating memory through malloc(9), we always expect the amount of
memory requested to be unsigned as a negative value would either stand for
an error or an overflow.
Unsign some values, found when considering the use of mallocarray(9), to
avoid unnecessary casting. Also consider that indexes should be of
at least the same size/type as the upper limit they pretend to index.

MFC after:	2 weeks
2018-01-24 17:58:48 +00:00
Ian Lepore
2128fefb75 Reformat indentation to match other imx5/6 register definition headers, and
tweak some comments.  No functional changes.
2018-01-24 17:52:06 +00:00
John Baldwin
e0a40f3045 Mark the unused argument to continue_thread() as such.
clang in HEAD and 11 does not warn about this, but clang in 10 does.
2018-01-24 17:46:20 +00:00
Alan Somers
cb938d95e2 time(1): use clock_gettime(2) instead of gettimeofday(2)
This is a prerequisite to adding support for the monotonic clock

Reviewed by:	ken, imp
MFC after:	3 weeks
Sponsored by:	Spectra Logic Corp
Differential Revision:	https://reviews.freebsd.org/D14030
2018-01-24 17:12:34 +00:00
Edward Tomasz Napierala
28f3d8b2c2 Add SPDX identifiers to linux_ptrace.c and cfumass.c.
MFC after:	2 weeks
2018-01-24 17:04:01 +00:00
Edward Tomasz Napierala
43ee6e9d7b Add SPDX tags to iscsi(4).
MFC after:	2 weeks
2018-01-24 16:58:26 +00:00
Pedro F. Giffuni
f9834d101a Revert r327781, r328093, r328056:
ufs|ext2fs: Revert uses of mallocarray(9).

These aren't really useful: drop them.
Variable unsigning will be brought again later.
2018-01-24 16:44:57 +00:00