Commit Graph

215867 Commits

Author SHA1 Message Date
Ed Maste
6d9f0e4d70 bspatch: use #define for header size instead of magic number
Reviewed by:	allanjude, kib
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D7861
2016-09-15 01:58:12 +00:00
Ed Maste
b1ca2de9e9 login: clean up errx strings
errx() prefixes the error string with argv[0] so including "login: "
in the string is redundant. Also remove a superfluous newline.

Sponsored by:	The FreeBSD Foundation
2016-09-15 01:55:18 +00:00
Justin Hibbits
410941a7c0 Only define db_show_spr if DDB is enabled.
PR:		212667
Reported by:	Kenneth Salerno <kennethsalerno_AT_yahoo_dot_com>
2016-09-14 23:24:23 +00:00
Martin Matuska
24113d8c17 MFV r305816:
Sync libarchive with vendor including important security fixes.

Issues fixed (FreeBSD):
PR #778: ACL error handling
Issue #745: Symlink check prefix optimization is too aggressive
Issue #746: Hard links with data can evade sandboxing restrictions

This update fixes the vulnerability #3 and vulnerability #4 as reported in
"non-cryptanalytic attacks against FreeBSD update components".
https://gist.github.com/anonymous/e48209b03f1dd9625a992717e7b89c4f

Fix for vulnerability #2 has already been merged in r304989.

MFC after:	1 week
Security: http://gist.github.com/anonymous/e48209b03f1dd9625a992717e7b89c4f
2016-09-14 21:15:01 +00:00
Martin Matuska
282f8bd696 Update vendor/libarchive to git c31379acc9009f5a3bafcfa33d7672a24b3f51f3
Vendor issues fixed (FreeBSD):
PR #778: ACL error handling
Issue #745: Symlink check prefix optimization is too aggressive
Issue #746: Hard links with data can evade sandboxing restrictions

This update fixes the vulnerability #3 and vulnerability #4 as reported in
the "non-cryptanalytic attacks against FreeBSD update components".
https://gist.github.com/anonymous/e48209b03f1dd9625a992717e7b89c4f

Vulnerability #2 has already been fixed in r304866
2016-09-14 20:32:34 +00:00
Ed Maste
9b61efccf7 vtfontcvt: remove superfluous newlines in errx messages 2016-09-14 18:22:12 +00:00
Emmanuel Vadot
62ee0c0a9a ufsread: Do not cast struct direct from void *
This cause alignment problem on ARM (and possibly other archs), instead copy it.

MFC after:	1 week
2016-09-14 17:43:32 +00:00
Pedro F. Giffuni
be4391a2d5 localedef(1): make better use of calloc(3) arguments.
The first argument of calloc(3) should be an ordinal type, and the
second a size: split a multiplication to make better use of calloc(3)
and detect overflows.

Do some other re-ordering and style fixes while here.

MFC after:	3 weeks
2016-09-14 16:47:17 +00:00
Pedro F. Giffuni
60e600c8fc fifolog(1): invert order of calloc(3) arguments.
The second argment to calloc(3) should be the size, make it so.

While here be a little bit more cautious in fifolog_reader_open()
to protect in the unlikely event of an overflowed allocation.

MFC after:	3 weeks
2016-09-14 16:34:52 +00:00
Bjoern A. Zeeb
fce7ff68f3 Try to fix LINT builds after r305807. Seems to be a simple s&r error
I missed while reading through the 1st time as well.
2016-09-14 16:08:23 +00:00
Michael Tuexen
5a17b6ad98 Ensure that the IPPROTO_TCP level socket options
* TCP_KEEPINIT
* TCP_KEEPINTVL
* TCP_KEEPIDLE
* TCP_KEEPCNT
always always report the values currently used when getsockopt()
is used. This wasn't the case when the sysctl-inherited default
values where used.
Ensure that the IPPROTO_TCP level socket option TCP_INFO has the
TCPI_OPT_ECN flag set in the tcpi_options field when ECN support
has been negotiated successfully.

Reviewed by:	rrs, jtl, hiren
MFC after:	1 month
Differential Revision:	7833
2016-09-14 14:48:00 +00:00
Bruce Evans
701ac88055 Use the MI macro TRAPF_USERMODE() instead of open-coded checks for
SEL_UPL and sometimes PSL_VM.  This is just a style change on amd64,
but on i386 it fixes 1 unimportant place where the PSL_VM check was
missing and starts fixing 1 important place where the PSL_VM check
had a logic error.

Fix logic errors in treating vm86 bioscall mode as kernel mode.  The
main place checked all the necessary flags, but put the necessary
parentheses for the PSL_VM and PCB_VM86CALL checks in the wrong
place.  The broken case is only reached if a vm86 bioscall uses a
%cs which is nonzero mod 4, but that is unusual -- most bios calls
start with %cs = 0xc000 or 0xf000 and rarely change it.  Another
place was missing the check for PCB_VM86CALL, but was only reachable
if there are bugs virtualizing PSL_I.

Add a macro TF_HAS_STACKREGS() and use this instead of converting
open-coded checks of SEL_UPL, etc. to TRAPF_USERMODE() when we only
care about whether the frame has stack registers.  This fixes 3
places in my recent fix for register variables in vm86 mode where I
messed up the PSL_VM check and cleans up other places.
2016-09-14 12:57:40 +00:00
Hans Petter Selasky
0eb8d46232 Improve USB polling mode by not locking any mutexes, asserting any
mutexes or using any callouts when active.

Trying to lock a mutex when KDB is active or the scheduler is stopped
can result in infinite wait loops. The same goes for calling callout
related functions which in turn lock mutexes.

If the USB controller at which a USB keyboard is connected is idle
when KDB is entered, polling the USB keyboard via USB will always
succeed. Else polling may fail depending on which state the USB
subsystem and USB interrupt handler is in. This is unavoidable unless
KDB can wait for USB interrupt threads to complete before stalling the
CPU(s).

Tested by:	Bruce Evans <bde@freebsd.org>
MFC after:	4 weeks
2016-09-14 12:07:34 +00:00
Edward Tomasz Napierala
275253770b Use proper argument order for calloc(3).
MFC after:	1 month
2016-09-14 11:20:58 +00:00
Hans Petter Selasky
8393643c27 Make the callout structure in the boot loader's kernel shim more
similar to the kernel one.

MFC after:	1 week
2016-09-14 11:16:00 +00:00
Sepherosa Ziehau
276c74b29a hyperv/hn: Fix some ifnet settings
- ifnet.if_mtu does not require explicit setting.
- ifnet.if_hdrlen must be set after ether_ifattach().

MFC after:	1 week
Sponsored by:	Microsoft
Differential Revision:	https://reviews.freebsd.org/D7873
2016-09-14 09:17:00 +00:00
Sepherosa Ziehau
2b9577d34f hyperv/hn: Remove the FreeBSD_version check for TSO configuration
It is available on both stable/10 and stable/11. This eases future MFCs
to stable/10.

MFC after:	1 week
Sponsored by:	Microsoft
Differential Revision:	https://reviews.freebsd.org/D7872
2016-09-14 08:59:13 +00:00
Sepherosa Ziehau
69c127b6e5 hyperv/hn: Bring in shims from stable/10
This eases future MFCs to stable/10.

MFC after:	1 week
Sponsored by:	Microsoft
Differential Revision:	https://reviews.freebsd.org/D7871
2016-09-14 08:48:08 +00:00
Sepherosa Ziehau
8b7bba155c hyperv/hn: Use sx for the main lock.
MFC after:	1 week
Sponsored by:	Microsoft
Differential Revision:	https://reviews.freebsd.org/D7870
2016-09-14 08:33:08 +00:00
Sepherosa Ziehau
af7799b26d hyperv/hn: Cleanup hn_ioctl.
MFC after:	1 week
Sponsored by:	Microsoft
Differential Revision:	https://reviews.freebsd.org/D7869
2016-09-14 08:24:01 +00:00
Sepherosa Ziehau
23d0fe6357 hyperv/hn: Function renaming: hn_ifinit -> hn_init
No functional changes.

MFC after:	1 week
Sponsored by:	Microsoft
Differential Revision:	https://reviews.freebsd.org/D7868
2016-09-14 08:08:45 +00:00
Sepherosa Ziehau
555e179833 hyperv/hn: Deprecate hn_softc_t
MFC after:	1 week
Sponsored by:	Microsoft
Differential Revision:	https://reviews.freebsd.org/D7867
2016-09-14 08:00:30 +00:00
Sepherosa Ziehau
06100f2e8c hyperv/hn: Remove unused softc field
MFC after:	1 week
Sponsored by:	Microsoft
Differential Revision:	https://reviews.freebsd.org/D7866
2016-09-14 06:47:25 +00:00
Sepherosa Ziehau
67e44048f0 hyperv/vmbus: Make sure that the sub-channel count is valid.
MFC after:	1 week
Sponsored by:	Microsoft
Differential Revision:	https://reviews.freebsd.org/D7865
2016-09-14 06:30:14 +00:00
Sepherosa Ziehau
098ab4a242 hyperv/hn: Pull RSS key and indirect table setup up.
This paves the way for the dynamic RSS key and indirect table setting.

MFC after:	1 week
Sponsored by:	Microsoft
Differential Revision:	https://reviews.freebsd.org/D7864
2016-09-14 06:15:45 +00:00
Cy Schubert
3dd30bd184 Switch from .CURDIR to the simpler, more legible SRCTOP.
Suggested by:	emaste
X-MFC-with:	upcoming amd upgrade
2016-09-14 01:47:01 +00:00
Andriy Voskoboinyk
95d9a127b2 net80211: improve error checking in ieee80211_parse_{wpa,rsn}()
- Add few checks for group/pairwise ciphers into
ieee80211_parse_{wpa,rsn}().
- Split error code and cipher value in wpa_cipher() / rsn_cipher(); current
hack with (1 << 32) does not work - it's 1, not 0 (detected by CSA).
- Return IEEE80211_REASON_UNSUPP_RSN_IE_VERSION instead of
IEEE80211_REASON_IE_INVALID when version field is not equal to RSN_VERSION.

Tested with wpi(4) / urtwn(4) (HOSTAP mode).

Reviewed by:	adrian
Differential Revision:	https://reviews.freebsd.org/D7887
2016-09-13 22:59:38 +00:00
Simon J. Gerraty
462b35ac65 Avoid clobbering existing value of META_COOKIE_TOUCH 2016-09-13 22:17:25 +00:00
Andrey V. Elsukov
70c1466dad Fix swap tables between sets when this functional is enabled.
We have 6 opcode rewriters for table opcodes. When `set swap' command
invoked, it is called for each rewriter, so at the end we get the same
result, because opcode rewriter uses ETLV type to match opcode. And all
tables opcodes have the same ETLV type. To solve this problem, use
separate sets handler for one opcode rewriter. Use it to handle TEST_ALL,
SWAP_ALL and MOVE_ALL commands.

PR:		212630
MFC after:	1 week
2016-09-13 18:16:15 +00:00
Andrew Turner
6de3c41534 Add a missing opt_ddb.h include from places that include debug_moditor.h
to fix the build.

Obtained from:	ABT Systems Ltd
X-MFC with:	r305771
Sponsored by:	The FreeBSD Foundation
2016-09-13 16:20:31 +00:00
Andrew Turner
5ed824174b Fix the arm64 kernel build when DDB is disabled, debug_monitor.c depends on
DDB, and is unused when it's disabled.

Obtained from:	ABT Systems Ltd
MFC after:	3 days
Sponsored by:	The FreeBSD Foundation
2016-09-13 15:45:22 +00:00
Baptiste Daroussin
d600e95429 Add a comment on the #endif related to the guards
Reported by:	tsoome
2016-09-13 15:41:05 +00:00
Baptiste Daroussin
db3d647a40 Remove code that crept in r305125 by accident
Reported by:	tsoome
2016-09-13 15:37:23 +00:00
Andrew Turner
8b52054063 Add a warning about a known erratum we have observed on ThunderX pass 1.1.
As this is evaluation hardware with only a few users, and there is a lack
of information add a warning when booting on this hardware.

Reported by:	cognet
Obtained from:	ABT Systems Ltd
MFC after:	Instant
Sponsored by:	The FreeBSD Foundation
2016-09-13 14:10:49 +00:00
Sepherosa Ziehau
5e61a96882 hyperv/hn: Reorganize synthetic parts attach code.
MFC after:	1 week
Sponsored by:	Microsoft
Differential Revision:	https://reviews.freebsd.org/D7860
2016-09-13 05:54:31 +00:00
Sepherosa Ziehau
ec10046102 hyperv/hn: Regroup synthetic parts attach code.
MFC after:	1 week
Sponsored by:	Microsoft
Differential Revision:	https://reviews.freebsd.org/D7859
2016-09-13 05:41:13 +00:00
Sepherosa Ziehau
1f7866a48e hyperv/hn: Reorganize channel attach/detach code.
This paves the way for further attach/detach code reorganization.

MFC after:	1 week
Sponsored by:	Microsoft
Differential Revision:	https://reviews.freebsd.org/D7858
2016-09-13 05:27:36 +00:00
Warren Block
bb00e5490b Add another badly-needed simple example to the pw(8) man page. 2016-09-13 02:18:29 +00:00
Andriy Voskoboinyk
04a5c73b30 net80211: fix possible panic in adhoc mode (INIT -> RUN state transition).
In case if there is already running interface, a second non-sta
interface will omit scanning, going directly to RUN state. Handle
this case for adhoc mode appropriately.

Tested with RTL8821AU, 2 vaps in IBSS mode.
2016-09-12 23:00:31 +00:00
Mariusz Zaborski
6e70b4f058 fd: add fget_cap and fget_cap_locked primitives
They can be used to obtain capabilities along with a referenced fp.

Reviewed by:	mjg@
2016-09-12 22:46:19 +00:00
Cy Schubert
8825d8e38d Fixup whitespace, repace space with a tab.
X-MFC-with:	Upcoming amd update.
2016-09-12 19:31:14 +00:00
John Baldwin
1fedfdd5c1 Remove explicit device_verbose() from the t4iov driver detach routine
now that this case is handled generically.
2016-09-12 18:07:06 +00:00
John Baldwin
71499f6a2d Make device_quiet() an attachment property.
In particular, reset the DF_QUIET flag when detaching from a device so
that a driver that marks a device quiet doesn't dictate policy for a
different driver that may claim the device in the future.

Reviewed by:	rpokala, wblock
MFC after:	2 weeks
Sponsored by:	Chelsio Communications
Differential Revision:	https://reviews.freebsd.org/D7803
2016-09-12 18:06:42 +00:00
Oleksandr Tymoshenko
e0cfa1bc82 Remove semicolon from the end of the macro definition
Reported by: hans
2016-09-12 17:29:20 +00:00
Andriy Voskoboinyk
bf5e39f7a7 urtwn: fix possible driver hang when beacon miss is detected. 2016-09-12 16:46:14 +00:00
Konstantin Belousov
1a9ded46bd Fix typo in comment.
MFC after:	3 days
2016-09-12 16:44:21 +00:00
Ruslan Bukin
693b6aeede Add SMP support for MTI Malta 34kf CPU.
Sponsored by:	DARPA, AFRL
Sponsored by:	HEIF5
2016-09-12 16:38:51 +00:00
Emmanuel Vadot
d853a418ed Remove CUBIEBOARD kernel config file.
Every Allwinner board should either use ALLWINNER (SMP) or ALLWINER_UP kernel
config files.

MFC after:	2 week
2016-09-12 16:13:27 +00:00
Emmanuel Vadot
240e565c89 Use "generic" ALLWINNER_UP kernel config for Cubieboard release.
Reviewed by:	gjb
MFC after:	2 week
2016-09-12 16:10:47 +00:00
Ed Maste
04708d25e0 bspatch: remove superfluous newlines from errx strings 2016-09-12 14:28:38 +00:00