Commit Graph

220398 Commits

Author SHA1 Message Date
Alexander Motin
3b63a91d6d Do not blindly free completed ATIOs/INOTs on invalidation.
When LUN is disabled, SIM starts returning queued ATIOs/INOTs.  But at the
same time there can be some ATIOs/INOTs still carrying real new requests.
If we free those, SIM may leak some resources, forever expecting for any
response from us.  So try to be careful, separating ATIOs/INOTs carrying
requests which still must be processed, from ATIOs/INOTs completed with
errors which can be freed.

MFC after:	2 weeks
2017-02-21 06:10:11 +00:00
Justin Hibbits
27da2007da Correct the return value for pmap_change_attr()
pmap_change_attr() returns an error code, not a paddr.  This function is
currently unused for powerpc.

MFC after:	2 weeks
2017-02-21 05:08:07 +00:00
Bryan Drewery
7ad0d03d2b Make it more clear that -k sends SIGKILL, not the -s signal.
MFC after:	1 week
2017-02-21 01:11:18 +00:00
Mariusz Zaborski
7b13366373 Capsicumize traceroute.
PR:		 193973
Submitted by:	 Mikhail <mp39590@gmail.com>
Reviewed by:	 pjd, bapt, emaste, AllanJude
Differential Revision:	https://reviews.freebsd.org/D9303
2017-02-20 23:48:50 +00:00
John Baldwin
150599be12 Consolidate statements to initialize files.
Previously, the first lines of various generated files from system call
tables were generated in two sections.  Some of the initialization was
done in BEGIN, and the rest was done when the first line was encountered.
The main reason for this split before r313564 was that most of the
initialization done in the second section depended on the $FreeBSD$ tag
extracted from the system call table.  Now that the $FreeBSD$ tag is no
longer used, consolidate all of the file initialization in the BEGIN
section.

This change was tested by confirming that the content of generated files
did not change.
2017-02-20 20:37:25 +00:00
Mateusz Guzik
13d2ef0f3a mtx: fix spin mutexes interaction with failed fcmpset
While doing so move recursion support down to the fallback routine.
2017-02-20 19:08:36 +00:00
Edward Tomasz Napierala
15cbcf4bab Add /proc/self/mounts to linprocfs; some linux binaries need it.
MFC after:	2 weeks
Sponsored by:	DARPA, AFRL
2017-02-20 17:33:25 +00:00
Edward Tomasz Napierala
1a2dbd1aa3 Simplify devfs_fsync() by removing it. This might also be a minor
optimization, as vn_isdisk() needs to lock a global mutex.

Reviewed by:	imp
Tested by:	pho
MFC after:	2 weeks
Sponsored by:	DARPA, AFRL
Differential Revision:	https://reviews.freebsd.org/D9628
2017-02-20 16:18:33 +00:00
Edward Tomasz Napierala
5a49cd0099 Reimplement linux_arch_prctl() as a wrapper around sysarch(2).
This also adds support for LINUX_ARCH_SET_GS.

Reviewed by:	dchagin
MFC after:	2 weeks
Sponsored by:	DARPA, AFRL
Differential Revision:	https://reviews.freebsd.org/D9372
2017-02-20 16:13:40 +00:00
Eric Badger
82a4538f31 Defer ptracestop() signals that cannot be delivered immediately
When a thread is stopped in ptracestop(), the ptrace(2) user may request
a signal be delivered upon resumption of the thread. Heretofore, those signals
were discarded unless ptracestop()'s caller was issignal(). Fix this by
modifying ptracestop() to queue up signals requested by the ptrace user that
will be delivered when possible. Take special care when the signal is SIGKILL
(usually generated from a PT_KILL request); no new stop events should be
triggered after a PT_KILL.

Add a number of tests for the new functionality. Several tests were authored
by jhb.

PR:		212607
Reviewed by:	kib
Approved by:	kib (mentor)
MFC after:	2 weeks
Sponsored by:	Dell EMC
In collaboration with:	jhb
Differential Revision:	https://reviews.freebsd.org/D9260
2017-02-20 15:53:16 +00:00
Stanislav Galabov
31735ccf8a etherswitch: Fix RT305x vlan group operation
Fix an issue which prevents proper operation (addition/removal of members)
of RT305x vlan groups.

Tested by:	yamori813@yahoo.co.jp

Submitted by:	yamori813@yahoo.co.jp (initial version)
Reviewed by:	adrian
Differential Revision:	https://reviews.freebsd.org/D9607
2017-02-20 08:10:41 +00:00
Adrian Chadd
c2863c0a7e [wlanstats] We actually /do/ support per-STA stats! 2017-02-20 08:04:06 +00:00
Adrian Chadd
46788bb1d2 [net80211] validate VHT IEs. 2017-02-20 04:04:59 +00:00
Adrian Chadd
ac0b7d3206 [net80211] teach the probe response routine to add VHT IEs as appropriate. 2017-02-20 04:02:50 +00:00
Adrian Chadd
7f19273c7c [net80211] fix up VHT IE comparison typo
Whilst here, add a comment that I need to validate VHT IEs.
2017-02-20 04:02:29 +00:00
Adrian Chadd
2023566223 [net80211] fix NULL pointer dereference in VHT operation in hostap mode.
The vht IEs are NULL at this point, so we shouldn't upgrade a node to VHT.
I'll fix the upgrade after this!

Tested:

* ath10k, hostap mode
2017-02-20 03:45:41 +00:00
Pedro F. Giffuni
4d24901ac9 sys/dev: Replace zero with NULL for pointers.
Makes things easier to read, plus architectures may set NULL to something
different than zero.

Found with:	devel/coccinelle
MFC after:	3 weeks
2017-02-20 03:43:12 +00:00
Adrian Chadd
85161825cf [ifconfig] fix a memory leak!
Submitted by:	Tom Rix <trix@juniper.net>
Differential Revision:	https://reviews.freebsd.org/D9675
2017-02-20 03:12:46 +00:00
Adrian Chadd
468c50de15 [ifconfig] fix a memory leak.
Submitted by:	Tom Rix <trix@juniper.net>
Differential Revision:	https://reviews.freebsd.org/D9654
2017-02-20 03:10:56 +00:00
Adrian Chadd
617f8b101e [net80211] RX parameter shuffle in net80211 in preparation for 4x4 NICs and 160MHz channels.
* Migrate the rx_params stuff out from ieee80211_freebsd.h where it doesn't belong -
  this isn't freebsd specific anymore.

* Don't use a hard-coded number of chains in the ioctl header; now we can shuffle
  MAX_CHAINS around so it can be used in the right spot.

* Extend the signal/noisefloor levels in the mimo stats struct to userland to include
  the signal and noisefloor levels for each 20MHz slice of a 160MHz channel.

* Bump the number of EVM pilots in preparation for 4x4 and 160MHz channels.

Tested:

* ath(4), STA mode
* iwn(4), STA mode
* local ath10k port, STA mode

TODO:

* 11ax chips will come with 5GHz 8x8 hardware for lots of MU-MIMO - I'll re-bump it
  at that point.

Note:

* This breaks the driver and ifconfig ABI; please recompile  the kernel,
  ifconfig and wpa_supplicant/hostapd.
2017-02-20 02:08:08 +00:00
Enji Cooper
81e8601f58 Remove lib/libpam tests after they were removed from the source tree in r313975
X-MFC with:	r313975
Sponsored by:	Dell EMC Isilon
2017-02-20 01:45:12 +00:00
Dag-Erling Smørgrav
f3b0ac3409 Upgrade to OpenPAM Radula. 2017-02-20 00:56:46 +00:00
Baptiste Daroussin
d8713bf361 Add a file descriptor in struct url for netrc
When using libfetch in an application that drops privileges when fetching
like pkg(8) then user complain because the application does not read anymore
${HOME}/.netrc. Now a caller can prepare a fd to the said file and manually
assign it to the structure.

It is also a first step to allow to capsicumize libfetch applications

Reviewed by:	allanjude, des
Approved by:	des
Differential Revision:	https://reviews.freebsd.org/D9678
2017-02-20 00:14:31 +00:00
Enji Cooper
d893c36a35 A forced commit to note other portion of the Makefile change accidentally
committed in r313972

The code committed in r313962 implicitly relies on python 2.x to generate
testvect.h . There are a handful of issues with this approach:

- python is not an explicit build dependency for FreeBSD
- python 2.x is deprecated and will be removed sometime in the future
  (potentially before 11.x's EOL), and the script does not function with
  python 3.5 (it uses deprecated idioms and incompatible function calls).
- python(1) (by default) lives in /usr/local/bin (${LOCALBASE}/bin) and
  gentestvect.py is a dependency of testvect.h (prior to r313972) which
  means that if the mtime of the generator script was newer than the
  mtime of the test vector, it could cause a spurious build failure in
  build time or at install time.

A better solution using C/C++ should be devised.

Discussed with:	allanjude
MFC after:	2 weeks
X-MFC with:	r313962, r313972
Sponsored by:	Dell EMC Isilon
2017-02-19 22:00:11 +00:00
Enji Cooper
bc030e5c3f Unbreak the build when "make obj" is executed beforehand
Using relative paths imply working directory (in this case .OBJDIR), whereas the
sources live in the .CURDIR-relative path.

MFC after:	2 weeks
X-MFC with:	r313962
Pointyhat to:	allanjude
Sponsored by:	Dell EMC Isilon
2017-02-19 21:19:44 +00:00
Dag-Erling Smørgrav
04e3065217 Vendor import of OpenPAM Radula. 2017-02-19 21:00:46 +00:00
Konstantin Belousov
ecc6c515ab Apply noexec mount option for mmap(PROT_EXEC).
Right now the noexec mount option disallows image activators to try
execve the files on the mount point.  Also, after r127187, noexec
also limits max_prot map entries permissions for mappings of files
from such mounts, but not the actual mapping permissions.

As result, the API behaviour is inconsistent.  The files from noexec
mount can be mapped with PROT_EXEC, but if mprotect(2) drops execution
permission, it cannot be re-enabled later.  Make this consistent
logically and aligned with behaviour of other systems, by disallowing
PROT_EXEC for mmap(2).

Note that this change only ensures aligned results from mmap(2) and
mprotect(2), it does not prevent actual code execution from files
coming from noexec mount.  Such files can always be read into
anonymous executable memory and executed from there.

Reported by:	shamaz.mazum@gmail.com
PR:	217062
Reviewed by:	alc
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
2017-02-19 20:51:04 +00:00
Konstantin Belousov
901b55218f MFamd64 r313933: microoptimize pmap_protect_pte1().
Noted by:	alc
Tested by:	mmel
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
2017-02-19 20:40:07 +00:00
Kurt Lidl
5057f65606 Only notify blacklistd for successful logins in auth.c
Reported by:	Rick Adams
Reviewed by:	des
MFC after:	3 days
Sponsored by:	The FreeBSD Foundation
2017-02-19 20:35:39 +00:00
Justin Hibbits
d9720179fd Add a driver for the RouterBoard RB800 User LED
This may work on other RouterBoard PPC platforms, but I don't have any to test
with.
2017-02-19 19:56:12 +00:00
Alexander Motin
95cf040df5 Document r313854 (kern.cam.ctl.iscsi.maxtags).
MFC after:	12 days
2017-02-19 19:46:47 +00:00
Allan Jude
85c15ab853 improve PBKDF2 performance
The PBKDF2 in sys/geom/eli/pkcs5v2.c is around half the speed it could be

GELI's PBKDF2 uses a simple benchmark to determine a number of iterations
that will takes approximately 2 seconds. The security provided is actually
half what is expected, because an attacker could use the optimized
algorithm to brute force the key in half the expected time.

With this change, all newly generated GELI keys will be approximately 2x
as strong. Previously generated keys will talk half as long to calculate,
resulting in faster mounting of encrypted volumes. Users may choose to
rekey, to generate a new key with the larger default number of iterations
using the geli(8) setkey command.

Security of existing data is not compromised, as ~1 second per brute force
attempt is still a very high threshold.

PR:		202365
Original Research:	https://jbp.io/2015/08/11/pbkdf2-performance-matters/
Submitted by:	Joe Pixton <jpixton@gmail.com> (Original Version), jmg (Later Version)
Reviewed by:	ed, pjd, delphij
Approved by:	secteam, pjd (maintainer)
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D8236
2017-02-19 19:30:31 +00:00
Baptiste Daroussin
d7aee58a78 Update pci_vendors to 2017.02.15
MFC after:	3 days
2017-02-19 18:16:47 +00:00
Alan Cox
4b4c84cfc3 In pmap_enter(), set the PG_MANAGED flag on the new PTE in one place,
rather two places, and do so before the pmap lock is acquired.

Submitted by:	Yufeng Zhou <yz70@rice.edu>
Reviewed by:	kib
MFC after:	1 week
2017-02-19 18:00:57 +00:00
Edward Tomasz Napierala
cc5bbcb275 Add USB Mass Storage CTL frontend. This makes it possible
for USB OTG-capable hardware to implement device side of USB
Mass Storage, ie pretend it's a flash drive.  It's configured
in the same way as other CTL frontends, using ctladm(8)
or ctld(8).  Differently from usfs(4), all the configuration
can be done without rebuilding the kernel.

Testing and review is welcome.  Right now I'm still moving,
and I don't have access to my test environment, so I'm somewhat
reluctant to making larger changes to this code; on the other
hand I don't want to let it sit on Phab until my testing setup
is back, because I want to get it into 11.1-RELEASE.

Reviewed by:	emaste (cursory), wblock (man page)
MFC after:	2 weeks
Relnotes:	yes
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D8787
2017-02-19 17:47:43 +00:00
Baptiste Daroussin
1f87cafa31 Import mandoc 1.4.1rc2 2017-02-19 17:46:37 +00:00
Baptiste Daroussin
696a89ee8d Import mandoc 1.4.1rc2 2017-02-19 17:41:20 +00:00
Ed Maste
6b91f51703 bsdgrep: document ignored option -u
MSDOS and Windows GNU grep uses -u to mean "print byte offsets as if
running on an UNIX system." The option has no effect on systems that
do not use CRLF line endings.

PR:		171200
Submitted by:	deeptech71@gmail.com, Anders Jensen-Waud
MFC after:	1 month
2017-02-19 17:40:24 +00:00
Warner Losh
adc8145e6f Remove obsolete comment after prior rev. 2017-02-19 17:38:17 +00:00
Baptiste Daroussin
11dd9ed664 Import libucl 20170219
MFC after:	3 days
2017-02-19 17:37:16 +00:00
Baptiste Daroussin
8392e70f8a Import libucl snapshot 20170219 2017-02-19 17:31:53 +00:00
Alexander Motin
950c5aca4a Remove dead mentions of CAM target mode APIs from drivers.
This makes grepping kernel for target mode implementation much easier.
2017-02-19 17:27:58 +00:00
Ed Maste
5dff7be120 bsdgrep: fix EOF handling with --mmap
Rework part of the loop in grep_fgetln to return the rest of the line
and ensure that we still advance the buffer by the length of the rest
of the line.

PR:		165471
Submitted by:	Kyle Evans <kevans91@ksu.edu>
MFC after:	1 month
2017-02-19 17:23:27 +00:00
Edward Tomasz Napierala
c6d57d3073 There are some Linux binaries that expect the system to obey the "addr"
parameter to mmap(2), even if MAP_FIXED is not explicitly specified.
Android ART is one example.  Implement bug compatibility for this case
in linuxulator.

Reviewed by:	dchagin@
MFC after:	2 weeks
Sponsored by:	DARPA, AFRL
Differential Revision:	https://reviews.freebsd.org/D9373
2017-02-19 17:17:06 +00:00
Edward Tomasz Napierala
6f03f3d85c Make savecore(8) output nicer by specifying the maximum field width
instead of minimum one (precision instead of width).

MFC after:	2 weeks
Sponsored by:	DARPA, AFRL
2017-02-19 16:59:00 +00:00
Alexander Motin
91d226ca26 Remove broken remnants of obsolete INOT API.
MFC after:	2 weeks
2017-02-19 16:40:03 +00:00
Mateusz Guzik
b247fd395d locks: make trylock routines check for 'unowned' value
Since fcmpset can fail without lock contention e.g. on arm, it was possible
to get spurious failures when the caller was expecting the primitive to succeed.

Reported by:	mmel
2017-02-19 16:28:46 +00:00
Edward Tomasz Napierala
30545786bb Make mdconfig(8) not segfault when the kernel returns garbage data.
MFC after:	2 weeks
Sponsored by:	DARPA, AFRL
2017-02-19 16:08:58 +00:00
Hans Petter Selasky
316e092a77 Make sure the thread constructor and destructor eventhandlers are
called for all threads belonging to a procedure. Currently the first
thread in a procedure is kept around as an optimisation step and is
never freed. Because the first thread in a procedure is never freed
nor allocated, its destructor and constructor callbacks are never
called which means per thread structures allocated by dtrace and the
Linux emulation layers for example, might be present for threads which
don't need these structures.

This patch adds a thread construction and destruction call for the
first thread in a procedure.

Tested:			dtrace, linux emulation
Reviewed by:		kib @
MFC after:		1 week
Sponsored by:		Mellanox Technologies
2017-02-19 13:15:33 +00:00
Dmitry Chagin
486a06bdf0 Implement rt_tgsigqueueinfo system call used by glibc for pthread_sigqueue(3).
MFC after:	2 week
2017-02-19 07:38:11 +00:00