Commit Graph

224414 Commits

Author SHA1 Message Date
Martin Matuska
b86cbbb3ad Fix libarchive mismerge of r320927
MFC after:	1 week
X-MFC-with:	320927
Reported by:	Ngie Cooper <ngie@FreeBSD.org>
2017-07-13 04:42:29 +00:00
Kyle Evans
b5ddde39ac Add some basic tests for hexdump(1)'s various output flags. Formatting
tests are omitted for this initial run as there are still some bugs to work
out there.

This covers -s flag testing on devices and non-devices that would have
caught breakage found in PR 219173 as well as other subtle breakage caused
locally.

Reviewed by:	cem, ngie
Approved by:	cem (acting co-mentor)
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D11279
2017-07-13 03:52:54 +00:00
Ian Lepore
2d5f51fb22 Put an #ifdef notyet wrapper around a function that's not being used yet,
to avoid compile warnings.
2017-07-13 02:20:07 +00:00
Ian Lepore
7164f27ddc Support the "disable-over-current" property for imx ehci controllers.
It turns out that this is more than a power optization.  The OTG port
won't work on boards that have this property unless this setting is honored.

Also ensure that the usb phy device attaches before ehci.
2017-07-13 02:16:15 +00:00
Martin Matuska
8bad9d67f0 MFV r320924:
Bump libarchive to 3.3.2

Vendor changes:
  PR #901: don't depend on stdin in a testcase

MFC after:	1 week
2017-07-13 00:28:36 +00:00
Martin Matuska
f8c95ef815 Update vendor/libarchive to git 98a695399e8e7420635a5448aecde8b0a82fb83a
Release 3.3.2

Vendor changes:
  PR #901: don't depend on stdin in a testcase
2017-07-13 00:16:51 +00:00
Bryan Drewery
f80b8a886d META_MODE: Fix not writing .meta files in the kernel build.
This was a regression in r320220 due to improper porting of the
same logic from share/mk/bsd.dep.mk and having only tested with
-DNO_FILEMON at the time.

Pointyhat to:	bdrewery
Reported by:	Mark Millard, dhw, O. Hartmann
Sponsored by:	Dell EMC Isilon
2017-07-12 19:01:25 +00:00
Mark Johnston
5aaf766710 Add a newline after the version string.
MFC after:	3 days
2017-07-12 18:29:25 +00:00
Sean Bruno
fb6aa95d9f Reset unsupported SFP tuneable back to original entry name.
Reported by:	olivier@
2017-07-12 17:35:32 +00:00
Alan Somers
97ae05e314 Remove an extraneous strlen from t_setdomainname.c
Reported by:	Coverity
CID:		1377568
MFC after:	15 days
X-MFC-With:	320737
Sponsored by:	Spectra Logic Corp
2017-07-12 14:51:32 +00:00
Ryan Libby
808a9c8646 kvprintf %b enhancements
Make the %b formatter accept number formatting flags. It will now accept
alternate form, precision, and length modifiers. It also now partially
supports field width (but forces left justification).

Reviewed by:	markj
Approved by:	markj (mentor)
Sponsored by:	Dell EMC Isilon
Differential Revision:	https://reviews.freebsd.org/D11284
2017-07-12 07:30:14 +00:00
Xin LI
49426905b3 MFV r320905: Import upstream fix for CVE-2017-11103.
In _krb5_extract_ticket() the KDC-REP service name must be obtained from
encrypted version stored in 'enc_part' instead of the unencrypted version
stored in 'ticket'.  Use of the unecrypted version provides an
opportunity for successful server impersonation and other attacks.

Submitted by:	hrs
Obtained from:	Heimdal
Security:	FreeBSD-SA-17:05.heimdal
Security:	CVE-2017-11103
2017-07-12 07:19:06 +00:00
Xin LI
f52d4664e3 Import upstream fix for CVE-2017-11103:
CVE-2017-11103: Orpheus' Lyre KDC-REP service name validation
	In _krb5_extract_ticket() the KDC-REP service name must be obtained from
	encrypted version stored in 'enc_part' instead of the unencrypted version
	stored in 'ticket'.  Use of the unecrypted version provides an
	opportunity for successful server impersonation and other attacks.

	Identified by Jeffrey Altman, Viktor Duchovni and Nico Williams.

	Change-Id: I45ef61e8a46e0f6588d64b5bd572a24c7432547c

Submitted by:	hrs
Obtained from:	6dd3eb836b
Security:	CVE-2017-11103
Security:	FreeBSD-SA-17:05.heimdal
2017-07-12 07:13:56 +00:00
Ian Lepore
a8d7b9d3bb Support multiple realtime clocks, and remove locking/sleeping restrictions
on clock drivers.

This tracks multiple concurrent realtime clock drivers in a list sorted by
clock resolution.  When system time changes (and periodically) the
clock_settime() methods of all registered clocks are invoked.

To initialize system time, each driver is tried in turn from best to worst
resolution, until one succesfully returns a valid time.

The code no longer holds a mutex while calling the clock_settime() and
clock_gettime() methods of the registered clocks. This allows clock drivers
to do whatever kind of locking or sleeping is necessary (this is especially
important for i2c clock chips since i2c drivers often need to sleep).

A new clock_register_flags() function allows the clock driver to pass
flags. The flags currently defined help support drivers that use their own
techniques to avoid roundoff errors (prevents the 4/5 rounding done by the
subr_rtc code). A driver which may need to wait for resources (such as bus
ownership) may pass a flag to indicate that it will obtain system time for
itself after waiting for resources; this is merely an optimization to avoid
the common code retrieving a timespec that will never get used.

Relnotes:	yes
Differential Revision:	https://reviews.freebsd.org/D11484
2017-07-12 02:53:54 +00:00
Ian Lepore
b524a31593 Protect access to the AT realtime clock with its own mutex.
The mutex protecting access to the registered realtime clock should not be
overloaded to protect access to the atrtc hardware, which might not even be
the registered rtc. More importantly, the resettodr mutex needs to be
eliminated to remove locking/sleeping restrictions on clock drivers, and
that can't happen if MD code for amd64 depends on it. This change moves the
protection into what's really being protected: access to the atrtc date and
time registers.

This change also adds protection when the clock is accessed from
xentimer_settime(), which bypasses the resettodr locking.

Differential Revision:	https://reviews.freebsd.org/D11483
2017-07-12 02:42:57 +00:00
John Baldwin
15a88f8158 Consistently use vop_stdpathconf() for default pathconf values.
Update filesystems not currently using vop_stdpathconf() in pathconf
VOPs to use vop_stdpathconf() for any configuration variables that do
not have filesystem-specific values.  vop_stdpathconf() is used for
variables that have system-wide settings as well as providing default
values for some values based on system limits.  Filesystems can still
explicitly override individual settings.

PR:		219851
Reported by:	cem
Reviewed by:	cem, kib, ngie
MFC after:	1 month
Sponsored by:	Chelsio Communications
Differential Revision:	https://reviews.freebsd.org/D11541
2017-07-11 21:55:20 +00:00
Mark Johnston
4e287bd860 Add a subroutine for comparing kerneldump identifiers.
MFC after:	2 weeks
2017-07-11 18:24:05 +00:00
Mark Johnston
7f48d6a486 Don't dlclose NSS modules from nss_atexit().
As hinted in the commit log message for r259042, this is unnecessary.
Moreover, as a result of that change we may invoke a DSO's atexit handler
after it has been unmapped.

Reviewed by:	bdrewery, cem
MFC after:	1 week
Sponsored by:	Dell EMC Isilon
2017-07-11 17:59:15 +00:00
Andrew Turner
75f48c23ea Add external PLATFORM access on arm, and use it in the pl310 driver.
This allows multiple instances of SoCs that use the pl310 driver to be
built within the same kernel:

 * Add access to the platform_t object from outside platform.c
 * Use this with the pl310 driver

There is a new platform_pl310 interface to replace the existing code. SoCs
need to implement the init method, and if they have special requirements to
write to the two registers we care about will also need to implement the
write_ctrl and write_debug methods.

Differential Revision:	https://reviews.freebsd.org/D11546
2017-07-11 16:30:16 +00:00
Konstantin Belousov
f08b46d9da Fix BIT_FLS().
The iteration index is unsigned, so testing for larger than or equal
to zero makes little sense.

Submitted by:	Sebastian Huber <sebastian.huber@embedded-brains.de>
MFC after:	3 days
2017-07-11 12:35:44 +00:00
Edward Tomasz Napierala
d43225de5c Make fsck_y_enable default to passing pass -R to fsck_ffs(8) in addition
to -y.  To me, fsck_y_enable means "try as hard as possible", and without
-R, it... well, doesn't.

Reviewed by:	mckusick
Obtained from:	CheriBSD
MFC after:	2 weeks
Sponsored by:	DARPA, AFRL
Differential Revision:	https://reviews.freebsd.org/D11490
2017-07-11 12:32:40 +00:00
Bryan Drewery
1671f70652 DIRDEPS_BUILD: Connect more libraries.
Sponsored by:	Dell EMC Isilon
2017-07-11 00:32:48 +00:00
Bryan Drewery
27f3f39a1d Fix INSTALL_AS_USER after r319020.
Reviewed by:	vangyzen
MFC after:	1 week
Sponsored by:	Dell EMC Isilon
2017-07-10 23:52:07 +00:00
Bryan Drewery
7c2f06da87 DIRDEPS_BUILD: Update dependencies.
Sponsored by:	Dell EMC Isilon
2017-07-10 23:52:04 +00:00
Bryan Drewery
91efb3c969 Follow-up r318881: Disconnect groff documents. 2017-07-10 23:51:51 +00:00
Zbigniew Bodek
516d335588 Fix error check for Rx mbuf allocation in ENA driver
ena_alloc_rx_mbuf() will return positive error code
on failure. Act accordingly.

Submitted by: Krishna Yenduri <kyenduri at brkt.com>
2017-07-10 22:11:30 +00:00
Warner Losh
18b70d6ad3 Bump to FreeBSD_version to 1200038 for MMC CAM 2017-07-10 21:55:24 +00:00
Warner Losh
9f74b6d90a Move mmc_parmas to the end of the structure for better compatability. 2017-07-10 21:55:19 +00:00
Warner Losh
4fccee4f22 Kill some unnecessary noise. 2017-07-10 21:38:26 +00:00
Hans Petter Selasky
7bb7b27fb1 Make sure the mlx4en RX DMA ring gets stamped with software ownership
in order to prevent the flow of QP to error in the firmware once
UPDATE_QP is called.

MFC after:	3 days
Sponsored by:	Mellanox Technologies
2017-07-10 19:26:50 +00:00
Andrew Turner
3185adf0fd Start to move the arm *_mp.h to be names *_machdep.h. These will be used
by the reworked pl310 driver interface in
https://reviews.freebsd.org/D11546
2017-07-10 15:27:53 +00:00
Konstantin Belousov
99ac8154ff Provide libdl.
Create libdl.so.1 as a filter for libc.so.7 which exports public dl*
functions. The functions are resolved from the rtld instead, the goal
of creating library is to avoid errors from the static linker due to
missed libdl. For static binaries, an empty .o is compiled into
libdl.a so that static binaries still get dl stubs from libc.a.

Right now lld cannot create filter objects, disable libdl on arm64
when binutils are not used.

Reviewed by:	bdrewery, dim (previos version); emaste
Exp run:	PR 220525, done by antoine
Sponsored by:	The FreeBSD Foundation
MFC after:	1 month
Differential revision:	https://reviews.freebsd.org/D11504
2017-07-10 14:59:21 +00:00
Bruce Evans
16d02c733f Fix attribute flipping for cut marking in pixel mode. The text-mode
code was used, so the lightness bit was not flipped, so the flipping
was unnecessarily null in some cases.  E.g., the unusal color scheme
of lightwhite on white (white = lightgrey in kernelspeak) is not
completely unusable, except null flipping of it gave no visible marks
for cut marking.  Now flipping it works in pixel mode only.

Fix text cursor attribute adjustment over cut marking in text mode for
the usual cursor type (non-blinking full block).  Apply the flipping
for cut marking first and adjust that instead of vice versa.  This
gives a uniform color scheme for the usual text cursor type in text
mode: a white block background with no change to the character
foreground except for variations to avoid collisions.  The old order
gave a white character fg with no change in the bg in non-colliding
cases.  Versions before r316636 changed the bg to the non-cut-marked
one about half the time using a saveunder bug; this accidentally gave
something resembling a block cursor half the time.
2017-07-10 09:00:35 +00:00
Konstantin Belousov
7bd5b9f365 Fix warnings, adjust style.
Reviewed by:	bdrewery, dim, emaste (as part of D11504)
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
2017-07-10 08:10:45 +00:00
Alexander Motin
ae77193109 "Port Type not registered" is not a real error for GIT_PT. 2017-07-10 06:25:30 +00:00
Enji Cooper
32b7e40e69 Fix whitespace bugs
- Delete trailing whitespace.
- Replace 8 single column spaces with hard tabs.
- Delete lines with consisting purely of blank space.
- Add space between `return` and `(`, per style(9).

Special care was taken to not blindly replace 8 single column spaces
with tabs; doing so could break tools that do strict string comparisons
with camcontrol output.
2017-07-10 05:16:07 +00:00
Warner Losh
4e38d89520 Include opt files in the kernel with "" instead of <>. 2017-07-10 05:08:01 +00:00
Enji Cooper
db9d4c3972 Fix -Wuninitialized warning with gcc
Initialize mmc_data_byte to 0, as it could be used uninitialized
later on.

MFC with:	r320846
Reported by:	Jenkins (powerpc jobs)
2017-07-10 04:28:28 +00:00
Warner Losh
15c440e1a6 Better contain MMCCAM parts of this file
Remove some useless to the general user debugs
Put debugs under sdhci_debug.
Fix some style(9) regressions

Submitted by: marius@
2017-07-10 03:38:17 +00:00
Warner Losh
6df06cd671 Opt files are included with single quotes. 2017-07-10 03:38:12 +00:00
Warner Losh
b805794525 Add dependency on opt_cam.h and opt_mmccam.h 2017-07-10 03:38:07 +00:00
Mark Johnston
70bb2cdb04 Add some functions to math64.h in the LinuxKPI, and fix nearby style.
Reviewed by:	hselasky
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D11535
2017-07-09 23:14:51 +00:00
Mark Johnston
7a2553d9d7 Add a few functions to ktime.h in the LinuxKPI, and fix nearby style.
Reviewed by:	hselasky
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D11534
2017-07-09 23:13:08 +00:00
Mark Johnston
abf5c031bb Free existing per-thread task structs when unloading linuxkpi.ko.
They are otherwise leaked.

Reported and tested by:	ae
MFC after:		1 week
2017-07-09 22:57:00 +00:00
Mark Johnston
8ee96d1452 Add a helper function to agp(4) which installs a single GTT entry.
Submitted by:	dumbbell
MFC after:	1 week
2017-07-09 22:53:24 +00:00
Warner Losh
3685b3988d Back out enabling the card interrupt detection bit. It is not ready to
commit.

Noticed by: marius@
2017-07-09 20:49:02 +00:00
Warner Losh
1a97aaeba7 Reconnect mmc and mmcsd disconnected unintentioanlly in mmccam commit. 2017-07-09 20:42:11 +00:00
Kristof Provost
b7ae43552b pf: Fix vnet purging
pf_purge_thread() breaks up the work of iterating all states (in
pf_purge_expired_states()) and tracks progress in the idx variable.

If multiple vnets exist this results in pf_purge_thread() only calling
pf_purge_expired_states() for part of the states (the first part of the
first vnet, second part of the second vnet and so on).
Combined with the mark-and-sweep approach to cleaning up old rules (in
V_pf_unlinked_rules) that resulted in pf freeing rules that were still
referenced by states. This in turn caused panics when pf_state_expires()
encounters that state and attempts to access the rule.

We need to track the progress per vnet, not globally, so idx is moved
into a per-vnet V_pf_purge_idx.

PR:		219251
Sponsored by:	Hackathon Essen 2017
2017-07-09 17:56:39 +00:00
Warner Losh
14bcf3e185 Added new tool for doing experiments with SDIO card.
Due to its experimental nature, it's not yet connected to the build.

Submitted by: Ilya Babulin
2017-07-09 17:05:48 +00:00
Warner Losh
d55c777cdf New command 'mmcsdcmd' for camcontrol, to allow interacting with SD cards
Submitted by: Ilya Babulin
2017-07-09 17:02:52 +00:00