Commit Graph

207286 Commits

Author SHA1 Message Date
Warner Losh
3e972f4409 Try a little harder to remove firstboot and firstboot-reboot files in
case they accidentally get created as directories or with flags that
prevent their removal. While I wouldn't normally go the extra mile
here and let the normal unix rules prevail, the effects of failure are
large enough that extra care is warranted.
2016-01-06 17:13:40 +00:00
Ed Maste
353e5e6e30 Enable the beastie menu for the UEFI console
As of r293233 the UEFI console includes basic terminal emulator support.

MFC after:	2 weeks
Relnotes:	Yes
2016-01-06 15:50:21 +00:00
Ed Maste
a93236cfcc loader.efi: add terminal emulation support
This is based on the vidconsole implementation.

Submitted by:	Toomas Soome <tsoome@me.com>
Reviewed by:	adrian
MFC after:	2 weeks
Relnotes:	Yes
Differential Revision:	https://reviews.freebsd.org/D4797
2016-01-06 15:38:39 +00:00
Glen Barber
fdbd473ce5 Add a new target to touch the ${.OBJDIR}/release file, which
indicates the 'release' target has run (in order to prevent
subsequent invocations that may clobber original build output).

As is, the 'release' target is a dummy target that does nothing
more than depend on subsequent targets.  Unless 'make obj' is
invoked prior to 'make release', .OBJDIR and .CURDIR will always
be '/usr/src/release' (or wherever /usr/src is located).

When 'make release' invokes 'make real-release' (and subsequent
targets), .OBJDIR is not updated, which still leads to src/ tree
pollution.

While arguably a hack, 'make release' will invoke the original
dummy targets as originally intended, but instead of touching an
empty file (or returing @true), will call a 'release-done' target
that will trigger the behavior that was intended to prevent
a subsequent invocation.

Discussed with:	hrs
MFC after:	3 days
X-MFC-With:	r293173
Sponsored by:	The FreeBSD Foundation
2016-01-06 05:23:25 +00:00
Alan Somers
a85f12322c "source routing" in rpcbind
Fix a bug in rpcbind for multihomed hosts. If the server had interfaces on
two separate subnets, and a client on the first subnet contacted rpcbind at
the address on the second subnet, rpcbind would advertise addresses on the
first subnet. This is a bug, because it should prefer to advertise the
address where it was contacted. The requested service might be firewalled
off from the address on the first subnet, for example.

usr.sbin/rpcbind/check_bound.c
	If the address on which a request was received is known, pass that
	to addrmerge as the clnt_uaddr parameter. That is what addrmerge's
	comment indicates the parameter is supposed to mean. The previous
	behavior is that clnt_uaddr would contain the address from which the
	client sent the request.

usr.sbin/rpcbind/util.c
	Modify addrmerge to prefer to use an IP that is equal to clnt_uaddr,
	if one is found. Refactor the relevant portion of the function for
	clarity, and to reduce the number of ifdefs.

etc/mtree/BSD.tests.dist
usr.sbin/rpcbind/tests/Makefile
usr.sbin/rpcbind/tests/addrmerge_test.c
	Add unit tests for usr.sbin/rpcbind/util.c:addrmerge.

usr.sbin/rpcbind/check_bound.c
usr.sbin/rpcbind/rpcbind.h
usr.sbin/rpcbind/util.c
	Constify some function arguments

Reviewed by:	imp
MFC after:	4 weeks
Sponsored by:	Spectra Logic Corp
Differential Revision:	https://reviews.freebsd.org/D4690
2016-01-06 00:00:11 +00:00
Warner Losh
71b902050d Use the more proper -f. Leave /bin/rm in place since that's what
other rc scripts have, though it isn't strictly necessary.
2016-01-05 21:20:47 +00:00
Warner Losh
11cf751df2 Disable abi variant hook until strangeness with packages can be sorted
out.
2016-01-05 21:20:46 +00:00
Glen Barber
8834318685 Merge ^/projects/release-install-debug:
- Rework MANIFEST generation and parsing via bsdinstall(8).
- Allow selecting debugging distribution sets during install.
- Rework bsdinstall(8) to fetch remote debug distribution sets
  when they are not available on the local install medium.
- Allow selecting additional non-GENERIC kernels during install.
  At present, GENERIC is still required, and installed by default.

Tested with:	head@r293203
Sponsored by:	The FreeBSD Foundation
2016-01-05 21:05:17 +00:00
Conrad Meyer
bd81fe68ee ioat(4): Add ioat_get_max_io_size() KPI
Consumers need to know the permitted IO size to send maximally sized
chunks to the hardware.

Sponsored by:	EMC / Isilon Storage Division
2016-01-05 20:42:19 +00:00
Andriy Voskoboinyk
430384523d iwm: revert r293178
This optimization is not proper (and causes kernel panic),
since driver checks fw_status to optimize away parsing stage
if it was already done.

Reported by:	dchagin
2016-01-05 20:09:26 +00:00
Jilles Tjoelker
43d53dba8f Add sbin and /usr/local directories to _PATH_DEFPATH.
Set _PATH_DEFPATH to
/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin. This is the
path in the default class in the default /etc/login.conf,
excluding ~/bin which would not be expanded properly in a string
constant.

For normal logins, _PATH_DEFPATH is overridden by /etc/login.conf,
~/.login_conf or shell startup files. _PATH_DEFPATH is still used as a
default by execlp(), execvp(), posix_spawnp() and sh if PATH is not set, and
by cron. Especially the latter is a common trap (most recently in PR
204813).

PR:		204813
Reviewed by:	secteam (delphij), alfred
2016-01-05 16:21:20 +00:00
Ed Maste
16ef2e1a9b rtld: populate DT_DEBUG iff DYNAMIC segment is writable
rtld.h was accidentally missed in r293201
2016-01-05 15:55:45 +00:00
Ed Maste
7a2ff73d68 rtld: populate DT_DEBUG iff DYNAMIC segment is writable
MIPS has/had a read-only DYNAMIC segment, and uses an extra level of
indirection (through MIPS_RLD_MAP) to locate the debugger rendezvous
data.

Some linkers (e.g. LLVM's lld) may produce MIPS binaries with a writable
DYNAMIC segment, which would allow us to eventually drop a special case.

Therefore, instead of hardcoding knowledge that DYNAMIC is not writable
on MIPS just check the permissions on the segment.

Reviewed by:	kib
MFC after:	2 weeks
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D4791
2016-01-05 15:52:16 +00:00
Konstantin Belousov
1041e09089 Two fixes for excessive iterations after r292326.
Advance the logical block number to the lblkno of the found block plus
one, instead of incrementing the block number which was used for
lookup.  This change skips sparcely populated buffer ranges, similar
to r292325, instead of doing useless lookups.

Do not restart the bnoreuselist() from the start of the range if
buffer lock cannot be obtained without sleep.  Only retry lookup and
lock for the same queue and same logical block number.

Reported by:	benno
Tested by:	pho
Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
2016-01-05 14:48:40 +00:00
Hans Petter Selasky
e10c4cc0a4 Implement RCU mechanism using shared exclusive locks.
MFC after:	1 week
Sponsored by:	Mellanox Technologies
2016-01-05 12:22:45 +00:00
Ulrich Spörlein
623534d683 Fix undefined behavior when using asmc_fan_getstring()
It was returning a pointer to stack-allocated memory, so make the
allocation at the caller instead.

Found by:	clang static analyzer
Coverity:	CID 1245774
Reviewed by:	ed, rpaulo
Review URL:	https://reviews.freebsd.org/D4740
2016-01-05 10:25:22 +00:00
Hans Petter Selasky
076daeda4f Fix for directly connected FULL or LOW speed USB devices.
Found by:	Sebastian Huber <sebastian.huber@embedded-brains.de>
MFC after:	1 week
2016-01-05 09:18:43 +00:00
Xin LI
a15691bf11 MFV r293125: less v481.
MFC after:	1 month
Relnotes:	yes
2016-01-05 05:25:16 +00:00
Glen Barber
10c40dfa68 Prevent memstick installation medium from attempting to mount
the root filesystem read-write.  This causes problems booting
the memstick installation medium from write-protected USB flash
drives.

Submitted by:	A.J. Kehoe IV [1], Oliver Jones [2]
PR:		187161 [1], 205886 [2]
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
2016-01-05 03:20:45 +00:00
Ed Maste
d88def534e rtld: wrap a comment to 80 columns 2016-01-05 02:21:57 +00:00
Navdeep Parhar
4562e76cc6 Have krping use IB_ACCESS_LOCAL_WRITE because it's required for remote
write or remote atomic operations.

Submitted by:	Krishnamraju Eraparaju @ Chelsio
2016-01-05 01:58:30 +00:00
Navdeep Parhar
9f6b62e791 iw_cxgbe: Shut down the socket but do not close the fd in case of error.
The fd is closed later in this case.  This fixes a "SS_NOFDREF on enter"
panic.

Submitted by:	Krishnamraju Eraparaju @ Chelsio
Reviewed by:	Steve Wise @ Open Grid Computing
2016-01-05 01:32:40 +00:00
Ed Maste
b8c23099c6 Merge LLVM libunwind revision 256779 2016-01-04 21:41:02 +00:00
Andriy Voskoboinyk
60e9dd4e56 urtwn: add bits for R92C_HWSEQ_CTRL and R92C_TXPAUSE registers
Reviewed by:	kevlo
Approved by:	adrian (mentor)
Differential Revision:	https://reviews.freebsd.org/D4770
2016-01-04 21:16:49 +00:00
Andriy Voskoboinyk
55d352400f iwn: reduce code duplication in iwn_read_firmware()
- Separate 'firmware_put(sc->fw_fp, FIRMWARE_UNLOAD); sc->fw_fp = NULL;'
into iwn_unload_firmware().
- Move error handling to the end of iwn_read_firmware().

No functional changes.

Approved by:	adrian (mentor)
Differential Revision:	https://reviews.freebsd.org/D4768
2016-01-04 21:11:27 +00:00
Andriy Voskoboinyk
e8d24c2011 iwm: free firmware related resources after uploading it to the hardware
iwn(4) / wpi(4) works in the same way
(read_firmware() -> hw_init() -> firmware_put())

Approved by:	adrian (mentor)
Differential Revision:	https://reviews.freebsd.org/D4766
2016-01-04 21:07:08 +00:00
Andriy Voskoboinyk
1b3ae3ba63 iwm: store pointer for 'struct firmware' instead of
'size_t' and 'void *' pair.

Approved by:	adrian (mentor)
Obtained from:	DragonFlyBSD
Differential Revision:	https://reviews.freebsd.org/D4765
2016-01-04 21:03:01 +00:00
Michael Tuexen
79cadff48d Get struct sctp_net_route in sync with struct route again. 2016-01-04 20:34:40 +00:00
Glen Barber
b9d8dd0006 Fix path to include .OBJDIR to avoid polluting the source
tree during 'make release'.

MFC after:	3 days
Sponsored by:	The FreeBSD Foundation
2016-01-04 19:38:44 +00:00
Christian Brueffer
783da31477 Don't build rtwnfw if building without binary blobs.
rtwnfw got added in r293009 and depends on source-less and
non-free microcode in sys/contrib/dev/rtwn.

PR:		205874
Submitted by:	Fabian Keil
Obtained from:	ElectroBSD
2016-01-04 19:04:33 +00:00
Christian Brueffer
2418fd040b Add rtwn(4) to the hardware list. 2016-01-04 18:34:27 +00:00
Alexander V. Chernikov
bacf668430 Finish r293098: make ip6_getpmtu() and ip6_getpmtu_ctl() use new routing API 2016-01-04 18:32:24 +00:00
Doug Rabson
4c3117aa02 Fix a memory leak in gss_release_oid_set 2016-01-04 17:42:12 +00:00
Alexander V. Chernikov
e971a31425 Fix route lookup condition: do IPv6 route lookup for source based on
NG_NETFLOW_CONF_NOSRCLOOKUP instead of NG_NETFLOW_CONF_NODSTLOOKUP.
2016-01-04 17:25:32 +00:00
Alexander V. Chernikov
45a8de88c6 Maintain consistent behavior: make fib4_lookup_nh_ext() return
rt_ifp pointer by default, as done by other fib lookup functions.
2016-01-04 17:23:10 +00:00
Ed Maste
1d3b741492 loader.efi: support non-contiguous console modes
Submitted by:	Toomas Soome <tsoome@me.com>
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D4760
2016-01-04 17:22:06 +00:00
Adrian Chadd
098b3fe173 [net80211] fix duration field; it's unsigned, but not long.
Submitted by:	Imre Vadasz <imre@vdsz.com>
Obtained from:	DragonflyBSD
2016-01-04 17:17:06 +00:00
Alexander V. Chernikov
9a1b64d5a0 Add rib_lookup_info() to provide API for retrieving individual route
entries data in unified format.

There are control plane functions that require information other than
  just next-hop data (e.g. individual rtentry fields like flags or
  prefix/mask). Given that the goal is to avoid rte reference/refcounting,
  re-use rt_addrinfo structure to store most rte fields. If caller wants
  to retrieve key/mask or gateway (which are sockaddrs and are allocated
  separately), it needs to provide sufficient-sized sockaddrs structures
  w/ ther pointers saved in passed rt_addrinfo.

Convert:
  * lltable new records checks (in_lltable_rtcheck(),
    nd6_is_new_addr_neighbor().
  * rtsock pre-add/change route check.
  * IPv6 NS ND-proxy check (RADIX_MPATH code was eliminated because
     1) we don't support RTF_ANNOUNCE ND-proxy for networks and there should
       not be multiple host routes for such hosts 2) if we have multiple
       routes we should inspect them (which is not done). 3) the entire idea
       of abusing KRT as storage for ND proxy seems odd. Userland programs
       should be used for that purpose).
2016-01-04 15:03:20 +00:00
Enji Cooper
db61e6ef45 Remove free'ing of an uninitialized variable
Just remove it completely from the test as it's initialized but unused apart
from the free(3) call

Differential Revision: https://reviews.freebsd.org/D4769 (part of larger diff)
MFC after: 5 days
Reported by: cppcheck
Reviewed by: oshogbo
Sponsored by: EMC / Isilon Storage Division
2016-01-04 03:34:22 +00:00
Enji Cooper
e02f530ebb Use nitems(x) macro instead of using hardcoded numbers for indices into
the nvlists

Convert some of the variables from int to unsigned int to squelch -Wsign-compare
warnings when converting hardcoded values to nitems(..)

Differential Revision: https://reviews.freebsd.org/D4769 (part of larger diff)
MFC after: 5 days
Reviewed by: oshogbo
Sponsored by: EMC / Isilon Storage Division
2016-01-04 03:26:36 +00:00
Enji Cooper
bd7f70daa5 Convert another string variable to string_arr missed in r293130
Differential Revision: https://reviews.freebsd.org/D4769 (part of larger diff)
MFC after: 5 days
Reviewed by: oshogbo
Sponsored by: EMC / Isilon Storage Division
2016-01-04 03:12:18 +00:00
Enji Cooper
8d86e318ea Rename nitems and string variables to avoid collisions
Rename the `nitems` variable to `num_items` to avoid collisions with the
macro in sys/param.h for counting elements in an array

Similarly, rename `string` to `string_arr` to avoid future collisions with
potential keywords, as well as make it clear that `string_arr` isn't a char*
value, but instead a char** value.

Differential Revision: https://reviews.freebsd.org/D4769 (part of larger diff)
MFC after: 5 days
Reviewed by: oshogbo
Sponsored by: EMC / Isilon Storage Division
2016-01-04 03:02:44 +00:00
Justin Hibbits
4717ada9cd Make arguments for booke_init() u_long, to match register width.
On powerpc64, pointers are 64 bits, so casting from uint32_t changes the integer
width.

The alternative was to use register_t, but I didn't see register_t used as
argument type for any other functions, though didn't look too closely.  u_long
was an acceptable alternative.  On 64-bit it's 64 bits, on 32-bit it's 32 bits.
2016-01-04 02:20:14 +00:00
Justin Hibbits
a917f636a2 Set the cacheline size before calling powerpc_init()
powerpc_init() initializes the mmu.  Since this may clear pages via
pmap_zero_page(), set the cacheline size before calling into it, so
pmap_zero_page() has the right cacheline size.  This isn't completely
necessary now, but will be when 64-bit book-e is completed.
2016-01-04 01:33:07 +00:00
Xin LI
59d1fa4298 Vendor import of less v481. 2016-01-04 00:22:34 +00:00
Jilles Tjoelker
ac4ecc78c1 sh: Link tests/builtins/getopts9.0 to the build.
This was forgotten in r273700.
2016-01-03 22:16:27 +00:00
Andriy Voskoboinyk
dd693ac6da iwm: use m_collapse() to defragment a mbuf chain
- Simplify defragmentation code.
- Use proper number of dma segments for data.

Approved by:	adrian (mentor)
Obtained from:	DragonFlyBSD (mostly)
Differential Revision:	https://reviews.freebsd.org/D4754
2016-01-03 21:32:47 +00:00
Jilles Tjoelker
d3fa2c78f2 sh: Reduce size of builtins table. 2016-01-03 21:30:22 +00:00
Warner Losh
d3e4bc1271 Use /bin/rm to remove /firstboot*. Otherwise rm -i alias is picked
up and can cause issues on boot with the prompts. Fix the read-only
root case with horrible kludge of mounting rw removing the files, then
mounting ro. But since that's no more horrible than the kludge of
using marker files in /. With this change, NanoBSD configs can safely
use /firstboot + growfs to produce minimal images that grow to the
size of the card.
2016-01-03 19:18:48 +00:00
Enji Cooper
1c66ead7d6 Fix ixl(4) compilation with PCI_IOV pre-r266974
stable/10 doesn't have the if_getdrvflags(9) KPI. Reference the field in the
structure directly if the __FreeBSD_version is < 1100022, so the driver can
be built with PCI_IOV support on stable/10, without backporting all of
r266974 (which requires additional changes due to projects/ifnet, etc)

Differential Revision: https://reviews.freebsd.org/D4759
Reviewed by: erj, sbruno
Sponsored by: EMC / Isilon Storage Division
2016-01-03 18:09:46 +00:00