Commit Graph

219199 Commits

Author SHA1 Message Date
Alexander Motin
36289c3336 Add checks for received mode page length.
If our buffer is too small, we may receive part of the page, and should
not try read/write past the end of the buffer.

Reported by:	Coverity
CID:		1368374, 1368375
MFC after:	1 week
2017-01-10 20:52:44 +00:00
Pedro F. Giffuni
990c731f0d Remove unused __gnu_inline() attribute.
This was meant to be used by a future FORTIFY_SOURCE implementation.
Probably for good, FORTIFY_SOURCE and this particular GCCism were never
well supported by clang or other compilers. Furthermore, the technology
has long since been replaced by either static checkers, sanitizers, or
even just the strong stack protector that was enabled by default.

Drop __gnu_inline to avoid cluttering the headers.

MFC after:	5 days
2017-01-10 20:44:31 +00:00
Alan Somers
cdb7a6fc42 Fix memory leaks during "tail -r" of an irregular file
* Rewrite r_buf to use standard tail queues instead of a hand-rolled
  circular linked list. Free dynamic allocations when done.
* Remove an optimization for the case where the file is a multiple of 128KB
  in size and there is a scarcity of memory.
* Add ATF tests for "tail -r" and its variants.

Reported by:	Valgrind
Reviewed by:	ngie
MFC after:	4 weeks
Sponsored by:	Spectra Logic Corp
Differential Revision:	https://reviews.freebsd.org/D9067
2017-01-10 20:43:32 +00:00
Alan Somers
442f47d697 Fix typo from change 310985 in ObsoleteFiles.inc
MFC after:	16 days
X-MFC-With:	310803
Sponsored by:	Spectra Logic Corp
2017-01-10 20:37:44 +00:00
Alan Somers
9a1fe327ae ATFify the geom gate tests.
This ensures their cleanup routines will be run even if they should timeout.

tests/sys/geom/class/gate/ggate_test.sh
tests/sys/geom/class/gate/Makefile
	Add an ATF test with three testcases, one for each TAP test. Use
	ATF-style cleanup functions, and convert sleeps to polling loops.

ObsoleteFiles.inc
tests/sys/geom/class/gate/conf.sh
tests/sys/geom/class/gate/1_test.sh
tests/sys/geom/class/gate/2_test.sh
tests/sys/geom/class/gate/3_test.sh
	Delete TAP test files

Reviewed by:	ngie
MFC after:	4 weeks
Sponsored by:	Spectra Logic Corp
Differential Revision:	https://reviews.freebsd.org/D8891
2017-01-10 20:35:09 +00:00
Alexander Motin
4982dca18d Do not wait for HA thread shutdown if scheduler is stopped.
This wait loop made system hang on panic instead of reboot.

MFC after:	1 week
2017-01-10 20:16:16 +00:00
Oleksandr Tymoshenko
759e131362 [efi] Build EFI bits with -fPIC on ARM
clang 3.9.0 without -fPIC generates absolute jump table for
switch/case statement which trips boot1.efi and loader.efi
on ARM platform.

Reviewed by:	andrew
MFC after:	3 days
Differential Revision:	https://reviews.freebsd.org/D9108
2017-01-10 20:15:24 +00:00
Oleksandr Tymoshenko
546fa3ada3 [efi] Fix .rel.data.* being erroneously merged into .data on ARM
Fix section pattern code to exclude .rel.data.* sections from being
merged into .data. Otherwise relocations in those sections are lost
in final binary

Reviewed by:	andrew
MFC after:	3 days
Differential Revision:	https://reviews.freebsd.org/D9108
2017-01-10 20:12:07 +00:00
Oleksandr Tymoshenko
06212e0467 [efi] Fix off-by-one error in ARM .bss zeroing code in loader's _start
__bss_end should not be included in .bss zeroing code. Otherwise first 4
bytes of the section that follows .bss (in loader's case it's .sdata) are
overwritten by zero.

Reviewed by:	andrew
MFC after:	3 days
Differential Revision:	https://reviews.freebsd.org/D9108
2017-01-10 20:08:21 +00:00
Sergey Kandaurov
30007e3fdc Fix build without IEEE80211_DEBUG.
Reported by:	many
2017-01-10 19:28:40 +00:00
Konstantin Belousov
b88a8d3d1d Fix acquisition of nested write compat rtld locks.
Obtaining compat rtld lock in write mode sets process signal mask to
block all signals.  Previous mask is stored in the global variable
oldsigmask.  If a lock is write-locked while another lock is already
write-locked, oldsigmask is overwritten by the total mask and on the
last unlock, all signals except traps appear to be blocked.

Fix this by counting the write-lock nested level, and only storing to
oldsigmask/restoring from it at the outermost level.

Masking signals disables involuntary preemption for libc_r, and there
could be no voluntary context switches in the locked code
(dl_iterate_phdr(3) keeps a lock around user callback, but it was
added long after libc_r was renounced).  Due to this, remembering the
level in the global variable after the lock is obtained should be
safe, because no two libc_r threads can acquire different write locks
in parallel.

PR:	215826
Reported by:	kami
Tested by:	yamagi@yamagi.org (previous version)
To be reviewed by:	kan
Sponsored by:	The FreeBSD Foundation
MFC after:	2 weeks
2017-01-10 19:26:55 +00:00
Li-Wen Hsu
0a50238935 Replace using of objdump with elfdump
In-tree objdump is too old to dump new ELF headers.  But for example if we
use: `make CROSS_TOOLCHAIN=riscv64-gcc TARGET_ARCH=riscv64` and do not specify
CROSS_BINUTILS_PREFIX in env, embed_mfs.sh cannot find the correct objdump.
This patch just replaces using of objdump with elfdump to collect needed
information.

Later we may also put an ELFDUMP in CROSSENV and use it in embed_mfs.sh .

Reviewed by:	emaste, br
MFC after:	3 days
Differential Revision:	https://reviews.freebsd.org/D9062
2017-01-10 18:46:40 +00:00
Navdeep Parhar
c70c4d71de The iw_cxgb and iw_cxgbe drivers should not use a FreeBSD device_t where
a linuxkpi style device is expected.  If OFED/linuxkpi actually starts
using this field then we'll have to figure out whether to create fake
devices for these drivers or have linuxkpi deal with NULL device.

This mismatch was first reported as part of D6585.
2017-01-10 18:39:53 +00:00
Konstantin Belousov
e7bfd34bdf Use ANSI C definitions, update comment.
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
2017-01-10 17:05:34 +00:00
Andrew Rybchenko
e3ef7bb216 sfxge(4): avoid unnecessary mbuf data prefetch
Unnecessary prefetch just loads HW prefetcher and displaces other
cache entries (which could be really useful).

If we parse mbuf for TSO early and use firmware-assisted TSO, we do not
expect mbuf data access when we compose firmware-assisted TSO (v1 or v2)
option descriptors.  If packet header needs to be linearized or finally
FATSO cannot be used because of, for example, too big header, we do not
care about a bit more performance degradation because of prefetch
absence (it is better to optimize more common case).

Reviewed by:    gnn
Sponsored by:   Solarflare Communications, Inc.
MFC after:      2 days
Differential Revision:  https://reviews.freebsd.org/D9120
2017-01-10 16:25:39 +00:00
Bjoern A. Zeeb
4a6768e64c Teach crunchide about EM_S390 to make bootstrapping from future
releases easier unless someone will fix the PR properly.

MFC after:	3 days
PR:		215940
2017-01-10 14:40:30 +00:00
Andrew Turner
ce790c9008 Add acpi_if.h to SRCS so we have it when building ahci_generic.c with ACPI.
Obtained from:	ABT Systems Ltd
Sponsored by:	The FreeBSD Foundation
2017-01-10 13:36:33 +00:00
Andrew Turner
2647410d05 Add an ACPI attachment to the existing ahci_generic driver. This is used
in some arm64 hardware, for example the AMD Opteron A1100.

Reviewed by:	mav
Obtained from:	ABT Systems Ltd
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D8852
2017-01-10 10:56:33 +00:00
Alexander Motin
7c07ea9aa2 Fix malloc(M_WAITOK) under mutex, introduced at r311787.
MFC after:	13 days
2017-01-10 10:33:36 +00:00
Enji Cooper
7931520d40 Diff reduce with upstream by removing signal.h #include
MFC after:	3 days
2017-01-10 10:27:09 +00:00
Enji Cooper
b6a72c5dbe Merge ^/vendor/NetBSD/tests/dist@r311868
This is the vendor accepted version of ^/head@r311245

MFC after:	3 days
2017-01-10 10:16:59 +00:00
Enji Cooper
2bbc0fe246 Merge the grammar fix for lib/libc/gen/raise_test:raise_stress
MFC after:	3 days
2017-01-10 10:12:36 +00:00
Enji Cooper
4023a42882 Import lib/libc/ttyio/t_ttyio.c,1.3 2017-01-10 10:06:15 +00:00
Enji Cooper
887eb0f8da t_raise: import a minor grammar error fix to diff reduce with NetBSD 2017-01-10 10:02:44 +00:00
Adrian Chadd
0c67d389f4 [net80211] add VHT mediatype initialisation and update helper functions. 2017-01-10 07:50:21 +00:00
Adrian Chadd
930dc01620 [net80211] Add default parameters for 11ac.
I doubt TDMA code will ever work for 11ac, but you never know, someone
may one day make it happen.
2017-01-10 07:24:29 +00:00
Adrian Chadd
86fee26330 [net80211] add VHT action frame placeholders for when it's time to implement. 2017-01-10 07:21:07 +00:00
Larry Rosenman
33740d0754 Add my birthday to calendar.freebsd
Approved by:	adamw (Mentor)
Differential Revision:	https://reviews.freebsd.org/D9119
2017-01-10 05:37:53 +00:00
Adrian Chadd
5fd74bfae8 [net80211] add missing VHTCAP declaration changes.
These are required for the recent ieee80211_vht.[ch] changes -
they make things start to work with MS() / SM() macros.
2017-01-10 05:33:34 +00:00
Adrian Chadd
94338935ee [net80211] add CHAN_VHT2G/CHAN_VHT5G macros. 2017-01-10 05:32:30 +00:00
Adrian Chadd
8fde59a7da [net80211] add VHT EDCA parameters for WME/QoS mode. 2017-01-10 05:32:02 +00:00
Adrian Chadd
791be271f1 [net80211] create a helper function to calculate the station facing VHT capabilities.
This is needed for two reasons:

* Drivers will need to know what the negotiated set of VHT capabilities
  and rates are in order to configure (and reconfigure for opmode/chanwidth
  changes) how to speak to a given peer; and
* Because some vendors are "special", we should be careful in what we announce
  to them during peer association.

This isn't the complete solution, as I still need to make sure that when
sending out probe requests before we know what we want, we don't limit
the capabilities being announced.  This is important for IBSS/mesh work
later on as probe request/response exchanges are the first hint at what
a peer supports.  I'll look at adding that to the API soon.
2017-01-10 05:30:15 +00:00
Sean Bruno
d37cece2b0 Add copywrite notices, 2-clause BSD.
Reported by:	jmallett
2017-01-10 04:50:26 +00:00
Adam Weinberger
994df66b4c As much as I've enjoyed being listed as emeritus for the last 10+ years,
it's probably time to admit that I am an active committer.
2017-01-10 04:49:59 +00:00
Larry Rosenman
b088abafd5 Add myself to committers-ports.dot
Approved by:	adamw (mentor)
Differential Revision:	https://reviews.freebsd.org/D9117
2017-01-10 04:31:56 +00:00
Mateusz Guzik
bedd46202f cd9660: fix up compilation on sparc after r311665
Reported by:	linimon
2017-01-10 04:17:53 +00:00
Ian Lepore
cfed2e639e Use the post-reset hook to force the controller to host mode. This will
make both usb ports work on imx6 systems (the OTG port of course will only
work in host mode).
2017-01-10 03:53:38 +00:00
Sean Bruno
f2d6ace4a6 Migrate e1000 to the IFLIB framework:
- em(4) igb(4) and lem(4)
- deprecate the igb device from kernel configurations
- create a symbolic link in /boot/kernel from if_em.ko to if_igb.ko

Devices tested:
- 82574L
- I218-LM
- 82546GB
- 82579LM
- I350
- I217

Please report problems to freebsd-net@freebsd.org

Partial review from jhb and suggestions on how to *not* brick folks who
originally would have lost their igbX device.

Submitted by:	mmacy@nextbsd.org
MFC after:	2 weeks
Relnotes:	yes
Sponsored by:	Limelight Networks and Dell EMC Isilon
Differential Revision:	https://reviews.freebsd.org/D8299
2017-01-10 03:23:22 +00:00
Navdeep Parhar
e8257dbe43 cxgbe(4): Attach to the 2x25 debug card. This is for internal use only.
MFC after:	3 days
2017-01-10 01:36:50 +00:00
Bruce M Simpson
ae9fd9cccd Allow udbp(4) to claim Belkin "Windows Easy Transfer Cable" for Netgraph use.
These have been tested back-to-back with Linux 3.x and a similar attachment
at the other end; a CDC EEM-like encapsulation can be used for emulated
Ethernet over udbp(4) with ng_ether.
2017-01-10 01:31:26 +00:00
Navdeep Parhar
b91f227f60 cxgbe(4): Refresh t4_msg.h, mainly for definitions related to the crypto
engine.

Obtained from:	Chelsio Communications
MFC after:	2 weeks
Sponsored by:	Chelsio Communications
2017-01-10 01:30:41 +00:00
Andriy Voskoboinyk
ae60d856a3 rtwn_pci(4): fix possible race while accessing 'matched_chip' variable. 2017-01-10 01:09:39 +00:00
Bruce M Simpson
5ca4ae8bb7 Add PID for Belkin F5U258 "Windows Easy Transfer Cable", a udbp-like device. 2017-01-10 00:28:01 +00:00
Conrad Meyer
cc2166783b Adjust ACPI_EXPORT_SYMBOL for AcpiGetTableWithSize
Suggested by:	jbeich@
2017-01-10 00:03:43 +00:00
Conrad Meyer
f7da1444fd cd9660: typedef cd_ino_t in preference to #define
Suggested by:	kib@
2017-01-09 23:56:45 +00:00
Conrad Meyer
d5fadb019e cd9660: Add a prototype for cd9660_vfs_hash_cmp
GCC warns (and errors, with -Werror) about it otherwise.  Clang doesn't care.

Introduced in r311665.

Reported by:	np@
2017-01-09 23:51:31 +00:00
Sean Bruno
46aa753364 White space cleanup from an cut-n-paste.
Submitted by:	mmacy@nextbsd.org
2017-01-09 23:45:40 +00:00
Andriy Voskoboinyk
5c06728ccb rtwn_usb(4): do not try to modify global static structure.
Use a local copy for modifications instead.

Tested with RTL8821AU (AP) + RTL8188EU (STA).

Reported by:	hselasky
2017-01-09 23:42:02 +00:00
Sean Bruno
5b51fcfc7a Remove unused mtx_held() macro. 2017-01-09 23:41:10 +00:00
Navdeep Parhar
87b027ba69 cxgbe(4): Enable automatic cidx flush for all control queues.
MFC after:	3 days
2017-01-09 22:20:09 +00:00