Commit Graph

215888 Commits

Author SHA1 Message Date
Marcelo Araujo
e700bef2dc Add an option called "random" that combined with "ether" can generate a
random MAC address for an Ethernet interface.

PR:		211984
Submitted by:	pi@
Reviewed by:	gnn, cem, jhb, lidl, rpokala, wblock
Approved by:	wblock (manpages)
2016-09-16 04:22:21 +00:00
Allan Jude
f1a6b7cb09 sbin/umount/umount.8: Amend HISTORY
umount first appeared in V1, confirmed using TUHS archive
http://minnie.tuhs.org/cgi-bin/utree.pl?file=V1/man/man1/umount.1

PR:		212554
Submitted by:	Sevan Janiyan <venture37@geeklan.co.uk>
2016-09-16 04:12:32 +00:00
Allan Jude
9dd4cc10f9 sbin/reboot/reboot.8: Amend HISTORY
A standalone reboot utility showed up in 4.0BSD, in AT&T UNIX init has a
case for reboot and is present in the version shipped with V5

either way, current entry is incorrect.

PR:		212548
Submitted by:	Sevan Janiyan <venture37@geeklan.co.uk>
2016-09-16 04:11:04 +00:00
Allan Jude
ef0a975fbe sbin/rcorder/rcorder.8: Amend HISTORY
rcorder appeared in FreeBSD 5.0.
Address issues raised by igor.

PR:		212547
Submitted by:	Sevan Janiyan <venture37@geeklan.co.uk>
2016-09-16 04:08:34 +00:00
Mateusz Guzik
dbfe4b2673 linprocfs: garbage collect meminfo fields not present in linux
In particular memshared not only does not exist in linux, it was
extremely expensive to calculate.
2016-09-16 03:36:43 +00:00
Marcel Moolenaar
cb1cb6a2a8 When MAKEOBJDIRPREFIX points to a case-insensitive file system, the
build can break when different source files create the same object
files (case-insensitivity speaking).  This is the case for _Exit.c
and _exit.s.  Compile _Exit.c as C99_Exit.c

Reviewed by:	sjg@
MFC after:	completion
Sponsored by:	Bracket Computing
Differential Revision:	https://reviews.freebsd.org/D7893
2016-09-16 03:04:48 +00:00
Ed Maste
487b46173d Use arch-specific .text padding fill value in EFI loaders
The fill pattern was previously an ia64 instruction sequence. Presumably
ia64's linker script was copied as a starting point.

MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
2016-09-16 01:38:22 +00:00
Navdeep Parhar
e6b81479f9 cxgbe(4): Attach to cards with the Terminator 6 ASIC. T6 cards will
come up as 't6nex' nexus devices with 'cc' ports hanging off them.

The T6 firmware and configuration files will be added as soon as they
are released.  For now the driver will try to work with whatever
firmware and configuration is on the card's flash.

Sponsored by:	Chelsio Communications
2016-09-16 00:08:37 +00:00
Navdeep Parhar
83a202cac5 Whitespace nits. 2016-09-15 22:31:49 +00:00
Andriy Voskoboinyk
5d7c8f2065 net80211: allow to override SWCRYPT/SWMIC bits in the driver
Add IEEE80211_KEY_SWCRYPT / IEEE80211_KEY_SWMIC bits to the
IEEE80211_KEY_DEVICE mask - as a result, those bits will be preserved
during group key handshake.

A driver can override them in iv_key_alloc() for some keys in case
when hardware crypto support is not possible. As an example:
 - multi-vap without multicast key search support;
 - IBSS RSN for devices w/ fixed storage for group keys;

Tested with RTL8188EU (AP, sw crypto) and
RTL8821AU (STA, sw crypto for group keys + hw crypto for pairwise keys)

Reviewed by:	adrian
Differential Revision:	https://reviews.freebsd.org/D7901
2016-09-15 22:27:00 +00:00
Bruce Evans
9680db5e94 Decode some REX prefixes in inst_call(). This makes the 'next' and
'until' commands work in more cases.
2016-09-15 18:30:53 +00:00
Brooks Davis
79816bbe94 The TLS offset is a property of the process ABI.
Move to a per-proc TLS offset rather than incorrectly keying off the
presense of freebsd32 compability in the kernel.

Reviewed by:	adrian, sbruno
Obtained from:	CheriBSD
Sponsored by:	DARPA, AFRL
Differential Revision:	https://reviews.freebsd.org/D7843
2016-09-15 17:25:52 +00:00
Andrey A. Chernov
2aa6b16f74 Implement multibyte encoding support for -v with fallback
MFC after:      7 days
2016-09-15 17:24:39 +00:00
Bruce Evans
bd20334ca0 Abort single stepping in ddb if the trap is not for single-stepping.
This is not very easy to do, since ddb didn't know when traps are
for single-stepping.  It more or less assumed that traps are either
breakpoints or single-step, but even for x86 this became inadequate
with the release of the i386 in ~1986, and FreeBSD passes it other
trap types for NMIs and panics.

On x86, teach ddb when a trap is for single stepping using the %dr6
register.  Unknown traps are now treated almost the same as breakpoints
instead of as the same as single-steps.  Previously, the classification
of breakpoints was almost correct and everything else was unknown so
had to be treated as a single-step.  Now the classification of single-
steps is precise, the classification of breakpoints is almost correct
(as before) and everything else is unknown and treated like a
breakpoint.

This fixes:
- breakpoints not set by ddb, including the main one in kdb_enter(),
  were treated as single-steps and not stopped on when stepping
  (except for the usual, simple case of a step with residual count 1).
  As special cases, kdb_enter() didn't stop for fatal traps or panics
- similarly for "hardware breakpoints".

Use a new MD macro IS_SSTEP_TRAP(type, code) to code to classify
single-steps.  This is excessively complicated for bug-for-bug and
backwards compatibilty.  Design errors apparently started in Mach
in ~1990 or perhaps in the FreeBSD interface in ~1993.  Common trap
types like single steps should have a unique MI code (like the TRAP*
codes for user SIGTRAP) so that debuggers don't need macros like
IS_SSTEP_TRAP() to decode them.  But 'type' is actually an ambiguous
MD trap number, and code was always 0 (now it is (int)%dr6 on x86).
So it was impossible to determine the trap type from the args.
Global variables had to be used.

There is already a classification macro db_pc_is_single_step(), but
this just gets in the way.  It is only used to recover from bugs in
IS_BREAKPOINT_TRAP().  On some arches, IS_BREAKPOINT_TRAP() just
duplicates the ambiguity in 'type' and misclassifies single-steps as
breakpoints.  It defaults to 'false', which is the opposite of what is
needed for bug-for-bug compatibility.

When this is cleaned up, MI classification bits should be passed in
'code'.  This could be done now for positive-logic bits, since 'code'
was always 0, but some negative logic is needed for compatibility so
a simple MI classificition is not usable yet.

After reading %dr6, clear the single-step bit in it so that the type
of the next debugger trap can be decoded.  This is a little
ddb-specific.  ddb doesn't understand the need to clear this bit and
doing it before calling kdb is easiest.  gdb would need to reverse
this to support hardware breakpoints, but it just doesn't support
them now since gdbstub doesn't support %dr*.

Fix a bug involving %dr6: when emulating a single-step trap for vm86,
set the bit for it in %dr6.  Userland debuggers need this.  ddb now
needs this for vm86 bios calls.  The bit gets copied to 'code' then
cleared again.

Fix related style bugs:
- when clearing bits for hardware breakpoints in %dr6, spell the mask
  as ~0xf on both amd64 and i386 to get the correct number of bits
  using sign extension and not need a comment about using the wrong
  mask on amd64 (amd64 traps for invalid results but clearing the
  reserved top bits didn't trap since they are 0).
- rewrite my old wrong comments about using %dr6 for ddb watchpoints.
2016-09-15 17:24:23 +00:00
John Baldwin
38605d7312 Remove 'cpu' and 'cpu_class' on amd64.
The 'cpu' and 'cpu_class' variables were always set to the same value
on amd64 and are legacy holdovers from i386.  Remove them entirely on
amd64.

Reviewed by:	imp, kib (older version)
Differential Revision:	https://reviews.freebsd.org/D7888
2016-09-15 17:05:54 +00:00
Edward Tomasz Napierala
e583d99909 Change the getnewvnode(9) tag for nullfs from "null" to "nullfs".
It's more consistent, and besides, the "null" alone looks weird.

MFC after:	1 month
2016-09-15 13:57:37 +00:00
Kevin Lo
e3e7995c5b Bump __FreeBSD_version for r305824.
Suggested by:	ngie
2016-09-15 13:40:36 +00:00
Ed Maste
69a2875821 Renumber license clauses in sys/kern to avoid skipping #3 2016-09-15 13:16:20 +00:00
Navdeep Parhar
97f2919d54 cxgbe(4): Use the interface's viid to calculate the PF/VF/VFValid fields
to use in tx work requests.
2016-09-15 08:30:47 +00:00
Kevin Lo
c3bef61e58 Remove the 4.3BSD compatible macro m_copy(), use m_copym() instead.
Reviewed by:	gnn
Differential Revision:	https://reviews.freebsd.org/D7878
2016-09-15 07:41:48 +00:00
Ed Maste
6c6e388929 sdiff: improve errx string
errx() appends a newline so \n is superfluous. Also switch to lower case
with no period for consistency with other errx strings.
2016-09-15 02:48:56 +00:00
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