Commit Graph

206748 Commits

Author SHA1 Message Date
Jilles Tjoelker
d41b2be159 sh: Fix use-after-free when attempting to modify a read-only variable.
Reported by:	bapt
MFC after:	1 week
2015-12-16 20:33:47 +00:00
Ed Maste
a2acf60284 Remove lldb(1) files if WITHOUT_LLDB is set
Sponsored by:	The FreeBSD Foundation
2015-12-16 19:48:03 +00:00
Ed Maste
d0ba16f775 Enable LLDB by default on amd64 and arm64
LLDB is usable for userland core file and live debugging on amd64, and
for userland core file debugging on arm64. In general it works at least
as well on FreeBSD as our in-tree gdb version, so enable it by default
to allow for broader use and testing.

An LLDB tutorial is available at http://lldb.llvm.org/tutorial.html, and
a table mapping GDB commands to LLDB commands can be found at
http://lldb.llvm.org/lldb-gdb.html .

LLDB also has some level of support for FreeBSD on arm, mips, i386,
and powerpc, but is not yet ready to have them enabled by default.

Reviewed by:	gnn
Relnotes:	Yes
2015-12-16 19:23:10 +00:00
Baptiste Daroussin
35fad84fec Use human readable representation of ip for the pxeboot.ip kenv
While here use colon as a separator for pxeboot.hwaddr kenv

Sponsored by:	Gandi.net
2015-12-16 17:45:03 +00:00
Baptiste Daroussin
4d6ab32f99 pxeboot: make the tftp loader use the option root-path directive
pxeboot in tftp loader mode (when built with LOADER_TFTP_SUPPORT) now
prefix all the path to open with the path obtained via the option 'root-path'
directive.

This allows to be able to use the traditional content /boot out of box. Meaning
it now works pretty much like all other loaders. It simplifies hosting hosting
multiple version of FreeBSD on a tftp server.

As a consequence, pxeboot does not look anymore for a pxeboot.4th (which was
never provided)

Note: that pxeboot in tftp loader mode is not built by default.

Reviewed by:	rpokala
Relnotes:	yes
Sponsored by:	Gandi.net
Differential Revision:	https://reviews.freebsd.org/D4590
2015-12-16 17:13:09 +00:00
Ed Maste
54f97d1eef UEFI: combine GetMemoryMap and ExitBootServices and retry on error
The EFI memory map may change before or during the first
ExitBootServices call. In that case ExitBootServices returns an error,
and GetMemoryMap and ExitBootServices must be retried.

Glue together calls to GetMemoryMap(), ExitBootServices() and storage of
(now up-to-date) MODINFOMD_EFI_MAP metadata within a single function.

That new function - bi_add_efi_data_and_exit() - uses space previously
allocated in bi_load_efi_data() to store the memory map (it will fail if
that space is too short). It handles re-calling GetMemoryMap() once to
update the map key if necessary. Finally, if ExitBootServices() is
successful, it stores the memory map and its header as MODINFOMD_EFI_MAP
metadata.

ExitBootServices() calls are now done earlier, from within arch-
independent bi_load() code.

PR:		202455
Submitted by:	Ganael LAPLANCHE
Reviewed by:	kib
MFC after:	2 weeks
Relnotes:	Yes
Differential Revision:	https://reviews.freebsd.org/D4296
2015-12-16 16:19:18 +00:00
Ian Lepore
7f84b7b298 Build mount_smbfs for arm. Also sort the subdirs. 2015-12-16 15:26:31 +00:00
Randall Stewart
f4e476c893 Remove redundant extern's that make the ppc compile fail.
Thanks Ed Maste for the heads up.
2015-12-16 15:16:44 +00:00
Svatopluk Kraus
4729bd79cb Adopt assert from amd64 in pmap_remove_pages().
Suggested by:	kib
Approved by:	kib (mentor)
2015-12-16 10:55:19 +00:00
Alexander V. Chernikov
427c2f4ef0 Provide additional lle data in IPv6 lltable dump used by ndp(8).
Before the change, things like lle state were queried via
  SIOCGNBRINFO_IN6 by ndp(8) for _each_ lle entry in dump.
This ioctl was added in 1999, probably to avoid touching rtsock code.

This change maps SIOCGNBRINFO_IN6 data to standard rtsock dump the
 following way:
  expire (already) maps to rtm_rmx.rmx_expire
  isrouter -> rtm_flags & RTF_GATEWAY
  asked -> rtm_rmx.rmx_pksent
  state -> rtm_rmx.rmx_state (maps to rmx_weight via define)

Reviewed by:	ae
2015-12-16 10:14:16 +00:00
Dag-Erling Smørgrav
adc1aa7a29 As a followup to r292330, standardize on size_t and add a few comments. 2015-12-16 09:20:45 +00:00
Alexander V. Chernikov
0792bcbb54 Convert if_stf(4) to new routing api. 2015-12-16 09:18:20 +00:00
Dag-Erling Smørgrav
a568844c67 Reset bufpos to 0 immediately after refilling the buffer. Otherwise, we
risk leaving the connection in an indeterminate state if the server fails
to send a chunk delimiter.  Depending on the application and on the sizes
of the preceding chunks, the result can be anything from missing data to a
segfault.  With this patch, it will be reported as a protocol error.

PR:		204771
MFC after:	1 week
2015-12-16 09:17:07 +00:00
Alexander V. Chernikov
942e4b4b79 Fix ARP reply handling changed in r286955.
If source of ARP request didn't pass the routing check
(e.g. not in directly connected network), be polite and
still answer the request instead of dropping frame.

Reported by:	quadro at irc@rusnet
2015-12-16 09:16:06 +00:00
Enji Cooper
4dc607e7f2 Integrate a number of testcases from tools/regression/lib/msun
into the FreeBSD test suite

There's no functional change with these testcases; they're purposely
being left in TAP format for the time being

Other testcases which crash on amd64/i386 as-is have not been
integrated yet (they need to be retested on a later version of
CURRENT, as I haven't used i386 in some time)

MFC after: 3 weeks
Sponsored by: EMC / Isilon Storage Division
2015-12-16 09:11:11 +00:00
Enji Cooper
9cb2010158 Use fabsl instead of fabs to mute -Wabsolute-value warnings from clang
because `nums[]` is an array of long doubles

MFC after: 1 week
Sponsored by: EMC / Isilon Storage Division
2015-12-16 08:53:24 +00:00
Konstantin Belousov
106ebb761a Optimize vop_stdadvise(POSIX_FADV_DONTNEED). Instead of looking up a
buffer for each block number in the range with gbincore(), look up the
next instantiated buffer with the logical block number which is
greater or equal to the next lblkno.  This significantly speeds up the
iteration for sparce-populated range.

Move the iteration into new helper bnoreuselist(), which is structured
similarly to flushbuflist().

Reported and tested by:	pho
Reviewed by:	markj
Sponsored by:	The FreeBSD Foundation
2015-12-16 08:48:37 +00:00
Konstantin Belousov
8549b4b9fe Simplify the loop step in the flushbuflist() and make it independed on
the type stability of the buffers memory.  Instead of memoizing
pointer to the next buffer and validating it, remember the next
logical block number in the bo list and re-lookup.

Reviewed by:	markj
Tested by:	pho
Sponsored by:	The FreeBSD Foundation
2015-12-16 08:39:51 +00:00
Enji Cooper
7d5b6ed91d Iterate down lib/libc/tests/nss...
MFC after: 1 week
X-MFC with: r292323
Sponsored by: EMC / Isilon Storage Division
2015-12-16 08:25:12 +00:00
Enji Cooper
08ca345cfd Integrate tools/regression/lib/libc/nss into the FreeBSD test suite as
lib/libc/tests/nss

- Convert the testcases to ATF
- Do some style(9) cleanups:
-- Sort headers
-- Apply indentation fixes
-- Remove superfluous parentheses
- Explicitly print out debug printfs for use with `kyua {debug,report}`; for
  items that were overly noisy, they've been put behind #ifdef DEBUG
  conditionals
- Fix some format strings

MFC after: 1 week
Sponsored by: EMC / Isilon Storage Division
2015-12-16 08:09:03 +00:00
Enji Cooper
11b249f99e Add ATF_REQUIRE_FEATURE and PLAIN_REQUIRE_FEATURE macros for
testing for kernel features via the feature_present(3) libcall

The semantics are similar to the other macros in the header (skip
testcase with ATF macro; exit with appropriate exit code with the
PLAIN macro)

MFC after: 1 week
Sponsored by: EMC / Isilon Storage Division
2015-12-16 05:44:53 +00:00
Enji Cooper
6971646f3e Add Makefile accidentally missed in r292317
MFC after: 1 week
X-MFC with: r292317
Sponsored by: EMC / Isilon Storage Division
2015-12-16 05:19:07 +00:00
Enji Cooper
9ada6f3369 Integrate tools/regression/lib/libc/resolv into the FreeBSD test suite as
lib/libc/tests/resolv

Convert the testcases to ATF

MFC after: 1 week
Sponsored by: EMC / Isilon Storage Division
2015-12-16 05:11:57 +00:00
Enji Cooper
fe20e444f3 Remove hosts that don't resolve properly with the nss and resolv tests
MFC after: 1 week
Sponsored by: EMC / Isilon Storage Division
2015-12-16 04:59:30 +00:00
Kurt Lidl
1c34f9114e Skip unavailable pools when running zfs pool scrubs
Approved by:	rpaulo (mentor)
Differential Revision:	https://reviews.freebsd.org/D4588
2015-12-16 04:32:33 +00:00
Ed Maste
ef3c018198 lldb(1): Document core file option -c / -core 2015-12-16 03:59:54 +00:00
Pawel Jakub Dawidek
31d4f144b3 Keep maintainance of GELI and make it clear which directories I'm interested in. 2015-12-16 01:05:50 +00:00
Randall Stewart
55bceb1e2b First cut of the modularization of our TCP stack. Still
to do is to clean up the timer handling using the async-drain.
Other optimizations may be coming to go with this. Whats here
will allow differnet tcp implementations (one included).
Reviewed by:	jtl, hiren, transports
Sponsored by:	Netflix Inc.
Differential Revision:	D4055
2015-12-16 00:56:45 +00:00
Glen Barber
2c97ae6939 Err on the side of caution, and assume *env(3) should require
secteam@ review for changes.  so@ can remove this entry, if
necessary.

Submitted by:	jhb (via secteam@)
Sponsored by:	The FreeBSD Foundation
2015-12-16 00:21:21 +00:00
Adrian Chadd
45130aa12e Don't call wakeup if we're just returning reserved space; just
return the reservation and wait for more space to appear.

Submitted by:	jeff
Reviewed by:	kib
2015-12-16 00:13:16 +00:00
John Baldwin
d921a4eb9c Keep the entries for NFS and the PCI bus code. 2015-12-15 23:06:15 +00:00
Alexander Motin
1e6a6c096e Set DS flag, required for LPB log page by spec.
MFC after:	1 week
2015-12-15 21:19:32 +00:00
Steven Hartland
25080ac4d4 Prevent g_access calls to bad multipath members
When a multipath member is orphaned its access members are zeroed before its
removed if marked for wither, so prevent any future calls to g_access on
such members.

This prevents a panic on debug kernels which validates the resultant values
aren't negative.

Reviewed by:	mav
MFC after:	2 weeks
Sponsored by:	Multiplay
Differential Revision:	https://reviews.freebsd.org/D4416
2015-12-15 21:11:41 +00:00
Bryan Drewery
c7006ec555 Build engines in parallel.
Sponsored by:	EMC / Isilon Storage Division
2015-12-15 19:57:56 +00:00
Bryan Drewery
7df4050d19 Regenerate after r292283. 2015-12-15 18:44:28 +00:00
Bryan Drewery
5d111a9744 Correct comment about MAKEOBJDIRPREFIX in src-env.conf.
It may only be used with WITH_AUTO_OBJ, which the WITH_DIRDEPS_BUILD does.  We
could support this in the normal build as well if we forced creating the directory
and setting .OBJDIR.

Sponsored by:	EMC / Isilon Storage Division
2015-12-15 18:42:30 +00:00
Andriy Voskoboinyk
64febdf2e2 urtwn: fix off-by-one error.
Reported by:	adrian
2015-12-15 17:59:13 +00:00
Jamie Gritton
6ab6058ec4 Fix jail name checking that disallowed anything that starts with '0'.
The intention was to just limit leading zeroes on numeric names.  That
check is now improved to also catch the leading spaces and '+' that
strtoul can pass through.

PR:		204897
MFC after:	3 days
2015-12-15 17:25:00 +00:00
Svatopluk Kraus
b500ef0907 Local TLB flush is sufficient in pmap_remove_pages().
(1) The pmap argument passed to the function must be current pmap only.
(2) The process must be single threaded as the function is called either
when a process is exiting or from exec_new_vmspace().

Remove pmap_tlb_flush_ng() which is not used anywhere now.

Approved by:	kib (mentor)
2015-12-15 16:04:45 +00:00
Steven Hartland
52e53e2de0 Fix lagg failover due to missing notifications
When using lagg failover mode neither Gratuitous ARP (IPv4) or Unsolicited
Neighbour Advertisements (IPv6) are sent to notify other nodes that the
address may have moved.

This results is slow failover, dropped packets and network outages for the
lagg interface when the primary link goes down.

We now use the new if_link_state_change_cond with the force param set to
allow lagg to force through link state changes and hence fire a
ifnet_link_event which are now monitored by rip and nd6.

Upon receiving these events each protocol trigger the relevant
notifications:
* inet4 => Gratuitous ARP
* inet6 => Unsolicited Neighbour Announce

This also fixes the carp IPv6 NA's that stopped working after r251584 which
added the ipv6_route__llma route.

The new behavour can be controlled using the sysctls:
* net.link.ether.inet.arp_on_link
* net.inet6.icmp6.nd6_on_link

Also removed unused param from lagg_port_state and added descriptions for the
sysctls while here.

PR:		156226
MFC after:	1 month
Sponsored by:	Multiplay
Differential Revision:	https://reviews.freebsd.org/D4111
2015-12-15 16:02:11 +00:00
Marcelo Araujo
6d652b139e Remove a garbage printf used for debug.
Approved by:	bapt (mentor implicit)
2015-12-15 15:46:14 +00:00
Marcelo Araujo
84e29f233a Remove the null checker before free.
Approved by:	bapt (mentor)
Obtained from:	OpenBSD
Differential Revision:	https://reviews.freebsd.org/D4549
2015-12-15 15:42:42 +00:00
Marcelo Araujo
474fa6a744 Remove wrong header and the NULL check before free().
Approved by:	bapt (mentor)
Obtained from:	OpenBSD
Differential Revision:	https://reviews.freebsd.org/D4548
2015-12-15 15:41:09 +00:00
Marcelo Araujo
7433efffe3 EAGAIN handling for imsg_read.
Approved by:	bapt (mentor)
Obtained from:	OpenBSD
Differential Revision:	https://reviews.freebsd.org/D4547
2015-12-15 15:37:58 +00:00
Svatopluk Kraus
28dff94844 Replace all postponed TLB flushes by immediate ones except the one
in pmap_remove_pages().

Some points were considered:
(1) There is no range TLB flush cp15 function.
(2) There is no target selection for hardware TLB flush broadcasting.
(3) Some memory ranges could be mapped sparsely.
(4) Some memory ranges could be quite large.

Tested by buildworld on RPi2 and Jetson TK1, i.e. 4 core platforms.
It turned out that the buildworld time is faster. On the other hand,
when the postponed TLB flush was also removed from pmap_remove_pages(),
the result was worse. But pmap_remove_pages() is called for removing
all user mapping from a process, thus it's quite expected.

Note that the postponed TLB flushes came here from i386 pmap where
hardware TLB flush broadcasting is not available.

Approved by:	kib (mentor)
2015-12-15 15:22:33 +00:00
Kevin Lo
d0ec8fd065 Remove sys/types.h due to STANDARDS and unistd.h also includes sys/types.h. 2015-12-15 15:19:06 +00:00
Kevin Lo
13230220de Remove sys/types.h due to STANDARDS and unistd.h also includes sys/types.h.
Reviewed by:	bde
2015-12-15 15:08:29 +00:00
Steven Hartland
6237ce0841 Add flag to disable inital reboot(8) userland sync
Add -N flag to reboot(8) which bypasses the userland sync(2) during
reboot(8) while still allow the kernel sync during the reboot(2) syscall
to occur.

An example use of this is when rebooting with disconnected iSCSI sessions
which would otherwise cause the reboot to hang on BIOs that will never
complete.

Reviewed by:	bjk
MFC after:	2 weeks
Sponsored by:	Multiplay
Differential Revision:	https://reviews.freebsd.org/D4449
2015-12-15 14:17:07 +00:00
Christian Brueffer
af1e9f5a46 Fix example code rendering, \n needs escaping to show up.
PR:		203536
Submitted by:	Fabian Keil
2015-12-15 13:29:05 +00:00
Svatopluk Kraus
acf4dc71d6 Flush intermediate TLB cache when L2 page table is unlinked.
This fixes an issue observed on Cortex A7 (RPi2) and on Cortex A15
(Jetson TK1) causing various memory corruptions. It turned out that
even L2 page table with no valid mapping might be a subject of such
caching.

Note that not all platforms have intermediate TLB caching implemented.
An open question is if this fix is sufficient for all platforms with
this feature.

Approved by:	kib (mentor)
2015-12-15 13:17:40 +00:00