]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
9 years agoWorkaround bhyve virtual disks operation on top of GEOM providers.
mav [Sat, 18 Apr 2015 20:10:19 +0000 (20:10 +0000)]
Workaround bhyve virtual disks operation on top of GEOM providers.

GEOM does not support scatter/gather lists in its I/Os.  Such requests
are cut in pieces by physio(), that may be problematic, if those pieces
are not multiple of provider's sector size.  If such case is detected,
move the data through temporary sequential buffer.

MFC after: 2 weeks

9 years agoNo need to delete export from filesystems which are not exported.
sjg [Sat, 18 Apr 2015 19:52:39 +0000 (19:52 +0000)]
No need to delete export from filesystems which are not exported.

9 years agoDo not report stripe size if it is equal to sector size.
mav [Sat, 18 Apr 2015 19:37:37 +0000 (19:37 +0000)]
Do not report stripe size if it is equal to sector size.

MFC after: 1 week

9 years agoTo ensure j formatting string valid, cast uint64_t values to uintmax_t.
takawata [Sat, 18 Apr 2015 17:41:09 +0000 (17:41 +0000)]
To ensure j formatting string valid, cast uint64_t values to uintmax_t.

9 years agoInitialize td_sel in the thread_init(). Struct thread is not zeroed
kib [Sat, 18 Apr 2015 17:21:12 +0000 (17:21 +0000)]
Initialize td_sel in the thread_init().  Struct thread is not zeroed
on the initial allocation, but seltdinit() assumes that td_sel is NULL
or a valid pointer.  Note that thread_fini()/seltdfini() also relies
on this, but correctly resets td_sel to NULL.

Submitted by: luke.tw@gmail.com
PR: 199518
MFC after: 1 week

9 years agoChange ipsec_address() and ipsec_logsastr() functions to take two
ae [Sat, 18 Apr 2015 16:58:33 +0000 (16:58 +0000)]
Change ipsec_address() and ipsec_logsastr() functions to take two
additional arguments - buffer and size of this buffer.

ipsec_address() is used to convert sockaddr structure to presentation
format. The IPv6 part of this function returns pointer to the on-stack
buffer and at the moment when it will be used by caller, it becames
invalid. IPv4 version uses 4 static buffers and returns pointer to
new buffer each time when it called. But anyway it is still possible
to get corrupted data when several threads will use this function.

ipsec_logsastr() is used to format string about SA entry. It also
uses static buffer and has the same problem with concurrent threads.

To fix these problems add the buffer pointer and size of this
buffer to arguments. Now each caller will pass buffer and its size
to these functions. Also convert all places where these functions
are used (except disabled code).

And now ipsec_address() uses inet_ntop() function from libkern.

PR: 185996
Differential Revision: https://reviews.freebsd.org/D2321
Reviewed by: gnn
Sponsored by: Yandex LLC

9 years agoRequeue mbuf via netisr when we use IPSec tunnel mode and IPv6.
ae [Sat, 18 Apr 2015 16:51:24 +0000 (16:51 +0000)]
Requeue mbuf via netisr when we use IPSec tunnel mode and IPv6.

ipsec6_common_input_cb() uses partial copy of ip6_input() to parse
headers. But this isn't correct, when we use tunnel mode IPSec.

When we stripped outer IPv6 header from the decrypted packet, it
can become IPv4 packet and should be handled by ip_input. Also when
we use tunnel mode IPSec with IPv6 traffic, we should pass decrypted
packet with inner IPv6 header to ip6_input, it will correctly handle
it and also can decide to forward it.

The "skip" variable points to offset where payload starts. In tunnel
mode we reset it to zero after stripping the outer header. So, when
it is zero, we should requeue mbuf via netisr.

Differential Revision: https://reviews.freebsd.org/D2306
Reviewed by: adrian, gnn
Sponsored by: Yandex LLC

9 years agoFix handling of scoped IPv6 addresses in IPSec code.
ae [Sat, 18 Apr 2015 16:46:31 +0000 (16:46 +0000)]
Fix handling of scoped IPv6 addresses in IPSec code.

* in ipsec_encap() embed scope zone ids into link-local addresses
  in the new IPv6 header, this helps ip6_output() disambiguate the
  scope;
* teach key_ismyaddr6() use in6_localip(). in6_localip() is less
  strict than key_sockaddrcmp(). It doesn't compare all fileds of
  struct sockaddr_in6, but it is faster and it should be safe,
  because all SA's data was checked for correctness. Also, since
  IPv6 link-local addresses in the &V_in6_ifaddrhead are stored in
  kernel-internal form, we need to embed scope zone id from SA into
  the address before calling in6_localip.
* in ipsec_common_input() take scope zone id embedded in the address
  and use it to initialize sin6_scope_id, then use this sockaddr
  structure to lookup SA, because we keep addresses in the SADB without
  embedded scope zone id.

Differential Revision: https://reviews.freebsd.org/D2304
Reviewed by: gnn
Sponsored by: Yandex LLC

9 years agoRemove xform_ipip.c and code related to XF_IP4.
ae [Sat, 18 Apr 2015 16:38:45 +0000 (16:38 +0000)]
Remove xform_ipip.c and code related to XF_IP4.

The only thing is used from this code is ipip_output() function, that does
IPIP encapsulation. Other parts of XF_IP4 code were removed in r275133.
Also it isn't possible to configure the use of XF_IP4, nor from userland
via setkey(8), nor from the kernel.

Simplify the ipip_output() function and rename it to ipsec_encap().
* move IP_DF handling from ipsec4_process_packet() into ipsec_encap();
* since ipsec_encap() called from ipsec[64]_process_packet(), it
  is safe to assume that mbuf is contiguous at least to IP header
  for used IP version. Remove all unneeded m_pullup(), m_copydata
  and related checks.
* use V_ip_defttl and V_ip6_defhlim for outer headers;
* use V_ip4_ipsec_ecn and V_ip6_ipsec_ecn for outer headers;
* move all diagnostic messages to the ipsec_encap() callers;
* simplify handling of ipsec_encap() results: if it returns non zero
  value, print diagnostic message and free mbuf.
* some style(9) fixes.

Differential Revision: https://reviews.freebsd.org/D2303
Reviewed by: glebius
Sponsored by: Yandex LLC

9 years agoRemove some oldnfs remnants.
trasz [Sat, 18 Apr 2015 16:08:06 +0000 (16:08 +0000)]
Remove some oldnfs remnants.

Differential Revision: https://reviews.freebsd.org/D2287
Reviewed by: rmacklem@
Sponsored by: The FreeBSD Foundation

9 years agoChange printf formatting to unbroke i386 arch.
takawata [Sat, 18 Apr 2015 16:04:32 +0000 (16:04 +0000)]
Change printf formatting to unbroke i386 arch.

Submitted by:david@catwhisker.org

9 years agoRemove unused code from linux_mount(), and make it possible to mount
trasz [Sat, 18 Apr 2015 09:49:09 +0000 (09:49 +0000)]
Remove unused code from linux_mount(), and make it possible to mount
any kind of filesystem instead of harcoded three.

MFC after: 1 month
Sponsored by: The FreeBSD Foundation

9 years agoFix Typo.
takawata [Sat, 18 Apr 2015 09:08:47 +0000 (09:08 +0000)]
Fix Typo.

9 years agoFix French typos in etherswitch.
rpaulo [Sat, 18 Apr 2015 07:34:39 +0000 (07:34 +0000)]
Fix French typos in etherswitch.

9 years agoFix misspelling.
araujo [Sat, 18 Apr 2015 06:53:13 +0000 (06:53 +0000)]
Fix misspelling.

9 years agoImprove code style(9), no functional changes.
araujo [Sat, 18 Apr 2015 06:48:03 +0000 (06:48 +0000)]
Improve code style(9), no functional changes.

Differential Revision: D2320
Reviewed by: takawata

9 years agoForgot to add default event mask definition.
takawata [Sat, 18 Apr 2015 06:16:33 +0000 (06:16 +0000)]
Forgot to add  default event mask definition.

9 years agoAdd LE related HCI control command to hccontrol(1).
takawata [Sat, 18 Apr 2015 04:53:17 +0000 (04:53 +0000)]
Add LE related HCI control command to hccontrol(1).

9 years agoMove the items common to all SoCs to a single file.
loos [Sat, 18 Apr 2015 03:07:01 +0000 (03:07 +0000)]
Move the items common to all SoCs to a single file.

9 years agoFix the style(9) and adds two missing parentheses on the licence.
loos [Sat, 18 Apr 2015 01:01:39 +0000 (01:01 +0000)]
Fix the style(9) and adds two missing parentheses on the licence.

Reduce the differences to bring in the MMC/SD driver.

Approved by: ganbold (licence change)

9 years agoMore accurately collect name-cache statistics in sysctl functions
mckusick [Sat, 18 Apr 2015 00:59:03 +0000 (00:59 +0000)]
More accurately collect name-cache statistics in sysctl functions
sysctl_debug_hashstat_nchash() and sysctl_debug_hashstat_rawnchash().
These changes are in preparation for allowing changes in the size
of the vnode hash tables driven by increases and decreases in the
maximum number of vnodes in the system.

Reviewed by: kib@
Phabric:     D2265

9 years agoSimplify the receiver code a bit.
loos [Sat, 18 Apr 2015 00:35:00 +0000 (00:35 +0000)]
Simplify the receiver code a bit.

Drain the RX FIFO and continue on failure.

9 years agocrunchide: always include both 32- and 64-bit ELF support
emaste [Sat, 18 Apr 2015 00:30:36 +0000 (00:30 +0000)]
crunchide: always include both 32- and 64-bit ELF support

This avoids the need to build a target-specific crunchide for cross-
uilds.

Differential Revision: https://reviews.freebsd.org/D2314
Sponsored by: The FreeBSD Foundation

9 years agoAdd the necessary support to use both TX queues available on if_emac.
loos [Fri, 17 Apr 2015 23:49:43 +0000 (23:49 +0000)]
Add the necessary support to use both TX queues available on if_emac.

Each TX queue can hold one packet (yes, if_emac can send only two(!)
packets at a time).

Even with this change the very limited FIFO buffer (3 KiB for TX and 13 KiB
for RX) fill up too quick to sustain higher throughput.

For the TCP case it turns out that TX isn't the limiting factor, but the RX
side is (the FIFO fill up and starts to discard packets, so the sender has
to slow down).

9 years agoDrop experimental dir_index support.
pfg [Fri, 17 Apr 2015 22:26:01 +0000 (22:26 +0000)]
Drop experimental dir_index support.

The htree directory index is a highly desirable feature for research
purposes and was meant to improve performance in our ext2/3 driver.
Unfortunately our implementation has two problems:

- It never really delivered any performance improvement.
- It appears to corrupt the filesystem in undetermined circumstances.

Strictly speaking dir_index is not required for read/write support in
ext2/3 and our limited ext4 support still works fine without it.

Regain stability in the ext2 driver by removing it. We may need it back
(fixed) if we want to support encrypted ext4 support but thanks to the
wonders of version control we can always revert this change and bring it
back.

PR: 191895
PR: 198731
PR: 199309

MFC after: 5 days

9 years agoRemove unnecessary checks and fix an issue where the interrupt handler
loos [Fri, 17 Apr 2015 22:17:22 +0000 (22:17 +0000)]
Remove unnecessary checks and fix an issue where the interrupt handler
could return with lock held.

9 years agoRemove vfs.zfs.snapshot_list_prefetch, the corresponding code was
delphij [Fri, 17 Apr 2015 21:21:11 +0000 (21:21 +0000)]
Remove vfs.zfs.snapshot_list_prefetch, the corresponding code was
gone in r248571 already.

MFC after: 1 week

9 years agoMake virtual AHCI more careful with I/O lengths.
mav [Fri, 17 Apr 2015 20:20:55 +0000 (20:20 +0000)]
Make virtual AHCI more careful with I/O lengths.

MFC after: 2 weeks

9 years agoBump crunch BOOTSTRAPPING for ELF header offset fix in r277557
emaste [Fri, 17 Apr 2015 16:02:49 +0000 (16:02 +0000)]
Bump crunch BOOTSTRAPPING for ELF header offset fix in r277557

9 years agoRELEASEDIR was removed in FreeBSD 9.x, at the same time /boot/loader
imp [Fri, 17 Apr 2015 15:55:13 +0000 (15:55 +0000)]
RELEASEDIR was removed in FreeBSD 9.x, at the same time /boot/loader
stopped using kgzip in the release process. We no longer need to build
kgzip as a cross tool, and tests for RELEASEDIR are obsolete, so
remove both.

Differential Revision: https://reviews.freebsd.org/D2313

9 years agoFix r281649: don't call in6_clearscope() twice.
glebius [Fri, 17 Apr 2015 15:26:08 +0000 (15:26 +0000)]
Fix r281649: don't call in6_clearscope() twice.

Submitted by: ae

9 years agocrunchide: remove unused a.out and non-functional ECOFF support
emaste [Fri, 17 Apr 2015 15:18:54 +0000 (15:18 +0000)]
crunchide: remove unused a.out and non-functional ECOFF support

Differential Revision: https://reviews.freebsd.org/D2311
Reviewed by: imp
Sponsored by: The FreeBSD Foundation

9 years agoUse the address of fsu_intr_fault, not the first two instructions in it as
andrew [Fri, 17 Apr 2015 12:58:09 +0000 (12:58 +0000)]
Use the address of fsu_intr_fault, not the first two instructions in it as
the address to check if we are handling a trap for fuswintr or suswintr.

Sponsored by: The FreeBSD Foundation

9 years agoProvide functions to determine presence of a given address
glebius [Fri, 17 Apr 2015 11:57:06 +0000 (11:57 +0000)]
Provide functions to determine presence of a given address
configured on a given interface.

Discussed with: np
Sponsored by: Nginx, Inc.

9 years agoRemove support for reading the syscall code in OABI. This is unneeded now
andrew [Fri, 17 Apr 2015 09:17:35 +0000 (09:17 +0000)]
Remove support for reading the syscall code in OABI. This is unneeded now
we can only build for EABI.

9 years agoUse cp15_ifar_get to get the instruction fault address. When using Thumb-2
andrew [Fri, 17 Apr 2015 09:14:58 +0000 (09:14 +0000)]
Use cp15_ifar_get to get the instruction fault address. When using Thumb-2
the instruction may be over two pages so the program counter could point
to the wrong page.

9 years agoBuild the USB DisplayLink driver by default.
hselasky [Fri, 17 Apr 2015 07:11:10 +0000 (07:11 +0000)]
Build the USB DisplayLink driver by default.

9 years agoBuffers which can be memory mapped into userspace should never be
hselasky [Fri, 17 Apr 2015 07:07:06 +0000 (07:07 +0000)]
Buffers which can be memory mapped into userspace should never be
freed. Recycle the buffers instead. This patch also fixes a panic at
reboot issue when an UDL adapter is attached to the system.

9 years agoBring in if_types.h from projects/ifnet, where types are
glebius [Fri, 17 Apr 2015 06:39:15 +0000 (06:39 +0000)]
Bring in if_types.h from projects/ifnet, where types are
defined in enum.

9 years ago- Format copyright notices, VCS ids.
glebius [Fri, 17 Apr 2015 06:38:31 +0000 (06:38 +0000)]
- Format copyright notices, VCS ids.
- Run through unifdef(1).

9 years agoFix the 'wrong packet header' errors for if_emac.
loos [Fri, 17 Apr 2015 03:56:50 +0000 (03:56 +0000)]
Fix the 'wrong packet header' errors for if_emac.

Do not strip the ethernet CRC until we read all data from FIFO, otherwise
the CRC bytes would be left in FIFO causing the failure of next packet
(wrong packet header).

When this error happens the receiver has to be disabled and the RX FIFO
flushed, discarding valid packets.

With this fix if_emac behaves a lot better.

9 years agoRelax the check on which vectors can be delivered through the APIC. According
neel [Thu, 16 Apr 2015 22:44:51 +0000 (22:44 +0000)]
Relax the check on which vectors can be delivered through the APIC. According
to the Intel SDM vectors 16 through 255 are allowed to be delivered via the
local APIC.

Reported by: Leon Dang (ldang@nahannisys.com)
MFC after: 2 weeks

9 years agoAdd arm64 to universe if binutils is available.
emaste [Thu, 16 Apr 2015 22:35:19 +0000 (22:35 +0000)]
Add arm64 to universe if binutils is available.

arm64 relies on an external binutils port or package right now, because
the in-tree linker from binutils 2.17.50 does not support arm64. Add
arm64 to universe if the linker is available. If not output a message
that arm64 is skipped.

buildworld and buildkernel use the external binutils automatically, so
it's sufficient to run 'pkg install aarch64-binutils' to build
FreeBSD/arm64.

Differential Revision: https://reviews.freebsd.org/D2302
Reviewed by: andrew, imp
Sponsored by: The FreeBSD Foundation

9 years agomav@ has found that NFS servers exporting ZFS file systems
rmacklem [Thu, 16 Apr 2015 22:35:15 +0000 (22:35 +0000)]
mav@ has found that NFS servers exporting ZFS file systems
can perform better when using a 128K read/write data size.
This patch changes NFS_MAXDATA from 64K to 128K so that
clients can use 128K for NFS mounts to allow this.
The patch also renames NFS_MAXDATA to NFS_SRVMAXIO so
that it is clear that it applies to the NFS server side
only. It also avoids a name conflict with the NFS_MAXDATA
defined in rpcsvc/nfs_prot.h, that is used for userland RPC.

Tested by: mav
Reviewed by: mav
MFC after: 2 weeks

9 years agoFix kernel build ${MACHINE} path
emaste [Thu, 16 Apr 2015 22:34:10 +0000 (22:34 +0000)]
Fix kernel build ${MACHINE} path

$M should be the kernel machine src directory, ${MACHINE}. In most cases
${MACHINE} and ${MACHINE_CPUARCH} are the same, but this is not true for
pc98 and arm64.

It appears we previously set M=${MACHINE_CPUARCH} as a workaround to
accommodate pc98, where MACHINE_CPUARCH is pc98 but it uses
sys/i386/i386/genassym.c.

arm64 relies on this being set correctly, so update $M and add explicit
workarounds for pc98.

Differential Revision: https://reviews.freebsd.org/D2307
Reviewed by: andrew, imp
Sponsored by: The FreeBSD Foundation

9 years agor281540 was upstreamed as NetBSD r1.108 of gzip.c, note it as merged.
delphij [Thu, 16 Apr 2015 22:30:57 +0000 (22:30 +0000)]
r281540 was upstreamed as NetBSD r1.108 of gzip.c, note it as merged.

9 years agoFix libxo output from uptime command
allanjude [Thu, 16 Apr 2015 22:09:37 +0000 (22:09 +0000)]
Fix libxo output from uptime command

the libxo output for uptime returned multiple 'uptime' keys, one each for number of days, hours, and minutes of uptime.
This is invalid JSON.
This patch makes the output the raw number of seconds, as well as adding keys for the individual unit values
A string of the original output from the plain-text uptime command is also added

Differential Revision: https://reviews.freebsd.org/D2063
Reviewed by: jmg
Approved by: marcel
Sponsored by: ScaleEngine Inc.

9 years agoDefeat race with MK_KERBEROS == yes introduced with bootstrap-tools
ngie [Thu, 16 Apr 2015 21:45:07 +0000 (21:45 +0000)]
Defeat race with MK_KERBEROS == yes introduced with bootstrap-tools
parallelization work done in r279197

- kerberos5/lib/libroken requires kerberos5/tools/make-roken to build
- kerberos5/tools/asn1_compile, kerberos5/tools/slc, and usr.bin/compile_et
  require kerberos5/lib/libroken and kerberos5/lib/libvers

This race is incredibly evident when cross-building sparc64 on
ref10-amd64.freebsd.org

MFC after: 1 week
Pointyhat to: ngie

9 years agoFix SIGINFO race causing final results to be lost to stderr.
bdrewery [Thu, 16 Apr 2015 21:44:35 +0000 (21:44 +0000)]
Fix SIGINFO race causing final results to be lost to stderr.

If a SIGINFO comes in after the file is read then the 'siginfo' flag is set to
1 and the next call to show_cnt() (at exit) would print the data to stderr
rather than the expected stdout.

This was found with spamming Poudriere with SIGINFO which caused a 'wc -l'
execution to return no data rather than an expected number.

MFC after: 2 weeks

9 years agoAdd "GELI Passphrase:" prompt to boot loader.
dteske [Thu, 16 Apr 2015 20:53:15 +0000 (20:53 +0000)]
Add "GELI Passphrase:" prompt to boot loader.

A new loader.conf(5) option of geom_eli_passphrase_prompt="YES" will now
allow you to enter your geli(8) root-mount credentials prior to invoking
the kernel.

See check-password.4th(8) for details.

Differential Revision: https://reviews.freebsd.org/D2105
Reviewed by: imp, kmoore
Discussed on: -current
MFC after: 3 days
X-MFC-to: stable/10
Relnotes: yes

9 years agoPeople are still getting burned by the byacc upgraded, switch to
imp [Thu, 16 Apr 2015 20:50:37 +0000 (20:50 +0000)]
People are still getting burned by the byacc upgraded, switch to
always doing byacc until someone figures out the more nuanced version
to switch off of.

9 years agoRemove empty now directory.
glebius [Thu, 16 Apr 2015 20:23:50 +0000 (20:23 +0000)]
Remove empty now directory.

9 years agoMove ALTQ from contrib to net/altq. The ALTQ code is for many years
glebius [Thu, 16 Apr 2015 20:22:40 +0000 (20:22 +0000)]
Move ALTQ from contrib to net/altq. The ALTQ code is for many years
discontinued by its initial authors. In FreeBSD the code was already
slightly edited during the pf(4) SMP project. It is about to be edited
more in the projects/ifnet. Moving out of contrib also allows to remove
several hacks to the make glue.

Reviewed by: net@

9 years agoPrefer 'vcpu_should_yield()' over checking 'curthread->td_flags' directly.
neel [Thu, 16 Apr 2015 20:15:47 +0000 (20:15 +0000)]
Prefer 'vcpu_should_yield()' over checking 'curthread->td_flags' directly.

MFC after: 1 week

9 years agoIf the number of guest vcpus is less than '1' then flag it as an error.
neel [Thu, 16 Apr 2015 20:11:49 +0000 (20:11 +0000)]
If the number of guest vcpus is less than '1' then flag it as an error.

MFC after: 1 week

9 years agoSet MACHINE_ARCH to aarch64 for arm64
emaste [Thu, 16 Apr 2015 19:23:08 +0000 (19:23 +0000)]
Set MACHINE_ARCH to aarch64 for arm64

Reviewed by: imp
Sponsored by: The FreeBSD Foundation

9 years agoIn the version of gcc in the FreeBSD tree, this modification was made to
rodrigc [Thu, 16 Apr 2015 17:42:52 +0000 (17:42 +0000)]
In the version of gcc in the FreeBSD tree, this modification was made to
the compiler in svn r242182:

#if STDC_HOSTED
#include <mm_malloc.h>
#endif

A similar change was done to clang in the FreeBSD tree in svn r218893:

However, for external gcc toolchains, this patch is not in the compiler's header
file.

This patch to FreeBSD's aesni code allows compilation with an external
gcc toolchain.

Differential Revision: https://reviews.freebsd.org/D2285
Reviewed by:  jmg, dim
Approved by:  dim

9 years agoFix a minor function definition inconsistancy.
brooks [Thu, 16 Apr 2015 15:35:17 +0000 (15:35 +0000)]
Fix a minor function definition inconsistancy.

MFC after: 3 days

9 years agoMake it harder to specify invalid LIBADD by causing values without
brooks [Thu, 16 Apr 2015 15:34:22 +0000 (15:34 +0000)]
Make it harder to specify invalid LIBADD by causing values without
corresponding DPADD_<lib> variables to produce a useful error message.

Differential Revision: https://reviews.freebsd.org/D2295
Reviewed by: bapt
Sponsored by: DARPA, AFRL

9 years agoRemove THRMISC_VERSION. The thrmisc structure doesn't include a version
jhb [Thu, 16 Apr 2015 12:58:51 +0000 (12:58 +0000)]
Remove THRMISC_VERSION.  The thrmisc structure doesn't include a version
number, so this wasn't used (and can't easily be added).  If at some point
we want to extend thrmisc, we will probably need to just add a new note
type and ensure that the new type includes a version number.

Discussed with: kib
MFC after: 2 weeks

9 years agocompiler_rt: add floatunsitf for arm64
emaste [Thu, 16 Apr 2015 12:54:28 +0000 (12:54 +0000)]
compiler_rt: add floatunsitf for arm64

It provides unsigned integer to quad-precision conversion.

Sponsored by: The FreeBSD Foundation

9 years agoFix an old and well-documented use-after-free race condition in
jch [Thu, 16 Apr 2015 10:00:06 +0000 (10:00 +0000)]
Fix an old and well-documented use-after-free race condition in
TCP timers:
 - Add a reference from tcpcb to its inpcb
 - Defer tcpcb deletion until TCP timers have finished

Differential Revision: https://reviews.freebsd.org/D2079
Submitted by: jch, Marc De La Gueronniere <mdelagueronniere@verisign.com>
Reviewed by: imp, rrs, adrian, jhb, bz
Approved by: jhb
Sponsored by: Verisign, Inc.

9 years agoEnable LDO to 2.5V before efuse r/w action in order to prevent
kevlo [Thu, 16 Apr 2015 07:40:01 +0000 (07:40 +0000)]
Enable LDO to 2.5V before efuse r/w action in order to prevent
incorrect mac address read from efuse.

Reported by: swills
Tested by: rpaulo and myself on RPi

9 years agoFix build after r281550 when WITHOUT_ICONV is defined.
tijl [Thu, 16 Apr 2015 07:17:00 +0000 (07:17 +0000)]
Fix build after r281550 when WITHOUT_ICONV is defined.

Reported by: adrian
MFC after: 2 weeks

9 years agoFix race when testing for ETXTBSY writing to ${n0} (process image) by making
ngie [Thu, 16 Apr 2015 03:35:47 +0000 (03:35 +0000)]
Fix race when testing for ETXTBSY writing to ${n0} (process image) by making
sure the process has been started beforehand with pgrep

pkill the process afterwards to make sure it's dead when the unlink is run
(not strictly required, but I was being conservative)

MFC after: 1 week
Reviewed by: Darius O'Conner, mjohnston
Sponsored by: EMC / Isilon Storage Division

9 years agoRemove duplicate header entry.
araujo [Thu, 16 Apr 2015 02:44:37 +0000 (02:44 +0000)]
Remove duplicate header entry.

9 years agoRemove extra flags from r250462.
bdrewery [Thu, 16 Apr 2015 02:24:40 +0000 (02:24 +0000)]
Remove extra flags from r250462.

MFC after: 1 week

9 years agovidcontrol: make size argument optional again for syscons
emaste [Thu, 16 Apr 2015 01:47:05 +0000 (01:47 +0000)]
vidcontrol: make size argument optional again for syscons

r273544 changed the -f option allow no arguments in vt mode (used to
reset the font back to the default), but broke the optionality of the
size argument for syscons. Drop the required argument from syscons'
optstring for -f so the optional argument handler works the same way
for both syscons and vt.

Reported by: bde
Sponsored by: The FreeBSD Foundation

9 years agoVerify if the saved hostid is still the same and update if
delphij [Wed, 15 Apr 2015 21:48:06 +0000 (21:48 +0000)]
Verify if the saved hostid is still the same and update if
it was changed.

Sponsored by: iXsystems, Inc.
Obtained from: FreeNAS (trueos commit 0abb740)

9 years agoFix syntax errors in conditions for new features in freebsd-update
allanjude [Wed, 15 Apr 2015 20:55:43 +0000 (20:55 +0000)]
Fix syntax errors in conditions for new features in freebsd-update

Differential Revision: https://reviews.freebsd.org/D1550
Submitted by: kmoore
Approved by: delphij
Obtained from: PCBSD
MFC after: 1 week
X-MFC-With: 279571
Sponsored by: ScaleEngine Inc.

9 years agoFile systems that do not use the buffer cache (such as ZFS) must
rmacklem [Wed, 15 Apr 2015 20:16:31 +0000 (20:16 +0000)]
File systems that do not use the buffer cache (such as ZFS) must
use VOP_FSYNC() to perform the NFS server's Commit operation.
This patch adds a mnt_kern_flag called MNTK_USES_BCACHE which
is set by file systems that use the buffer cache. If this flag
is not set, the NFS server always does a VOP_FSYNC().
This should be ok for old file system modules that do not set
MNTK_USES_BCACHE, since calling VOP_FSYNC() is correct, although
it might not be optimal for file systems that use the buffer cache.

Reviewed by: kib
MFC after: 2 weeks

9 years agoPrior to aborting due to an ioport error, it is always interesting to
tychon [Wed, 15 Apr 2015 18:49:03 +0000 (18:49 +0000)]
Prior to aborting due to an ioport error, it is always interesting to
see what the guest's %rip is.

Reviewed by: grehan

9 years agoFix handling of BUS_PROBE_NOWILDCARD in 'device_probe_child()'.
neel [Wed, 15 Apr 2015 16:22:05 +0000 (16:22 +0000)]
Fix handling of BUS_PROBE_NOWILDCARD in 'device_probe_child()'.

Device probe value of BUS_PROBE_NOWILDCARD should be treated specially only
if the device has a fixed devclass. Otherwise it should be interpreted just
as if the driver doesn't want to claim the device.

Prior to this change a device that was not claimed explicitly by its driver
would remain "attached" to the driver that returned BUS_PROBE_NOWILDCARD.
This would bump up the reference on 'driver->refs' and its 'dev->ops' would
point to the 'driver->ops'. When the driver is subsequently unloaded the
'dev->ops->cls' is left pointing to freed memory.

This fixes an easily reproducible #GP fault caused by loading and unloading
vmm.ko multiple times.

Differential Revision: https://reviews.freebsd.org/D2294
Reviewed by: imp, jhb
Discussed with: rstone
Reported by: Leon Dang (ldang@nahannisys.com)
MFC after: 2 weeks

9 years agoMinor change to the macros to make sure that if an AF is passed that is neither AF_IN...
gnn [Wed, 15 Apr 2015 14:46:45 +0000 (14:46 +0000)]
Minor change to the macros to make sure that if an AF is passed that is neither AF_INET6 nor AF_INET that we don't touch random bits of memory.

Differential Revision: https://reviews.freebsd.org/D2291

9 years agoEnter a critical section when storing the vfp registers, we don't want to
andrew [Wed, 15 Apr 2015 14:30:07 +0000 (14:30 +0000)]
Enter a critical section when storing the vfp registers, we don't want to
be preempted here as this will enter back into this function, but the
hardware could be in an inconsistant state, and the vfp unit will be off
when switced back to this function.

Sponsored by: The FreeBSD Foundation

9 years agoUse the correct value to get the offset of the objects tls data.
andrew [Wed, 15 Apr 2015 14:20:12 +0000 (14:20 +0000)]
Use the correct value to get the offset of the objects tls data.

Sponsored by: The FreeBSD Foundation

9 years agoEnsure the userland thread and floating-point state has been saved before
andrew [Wed, 15 Apr 2015 14:18:25 +0000 (14:18 +0000)]
Ensure the userland thread and floating-point state has been saved before
copying the pcb. These values may have been changed just before the call
to fork and without a call to cpu_switch, where they would have been saved.

Sponsored by: The FreeBSD Foundation

9 years agoPoint to the right location where __FreeBSD_version numbers are documented.
tijl [Wed, 15 Apr 2015 09:39:52 +0000 (09:39 +0000)]
Point to the right location where __FreeBSD_version numbers are documented.

9 years agoRewrite linprocfs_domtab() as a wrapper around kern_getfsstat(). This
trasz [Wed, 15 Apr 2015 09:13:11 +0000 (09:13 +0000)]
Rewrite linprocfs_domtab() as a wrapper around kern_getfsstat(). This
adds missing jail and MAC checks.

Differential Revision: https://reviews.freebsd.org/D2193
Reviewed by: kib@
MFC after: 1 month
Sponsored by: The FreeBSD Foundation

9 years agoRemove the const qualifier from iconv(3) to comply with POSIX:
tijl [Wed, 15 Apr 2015 09:09:20 +0000 (09:09 +0000)]
Remove the const qualifier from iconv(3) to comply with POSIX:
http://pubs.opengroup.org/onlinepubs/9699919799/functions/iconv.html

Adjust all code that calls iconv.

PR: 199099
Exp-run by: antoine
MFC after: 2 weeks

9 years agoImplement support -z global linker option. It marks the shared object
kib [Wed, 15 Apr 2015 08:16:34 +0000 (08:16 +0000)]
Implement support -z global linker option.  It marks the shared object
as always participating in the global symbols namespace, regardless of
the way the object was brought into the process address space.

Sponsored by: The FreeBSD Foundation
MFC after: 1 week

9 years agoImplement support for binary to requesting specific stack size for the
kib [Wed, 15 Apr 2015 08:13:53 +0000 (08:13 +0000)]
Implement support for binary to requesting specific stack size for the
initial thread.  It is read by the ELF image activator as the virtual
size of the PT_GNU_STACK program header entry, and can be specified by
the linker option -z stack-size in newer binutils.

The soft RLIMIT_STACK is auto-increased if possible, to satisfy the
binary' request.

Sponsored by: The FreeBSD Foundation
MFC after: 1 week

9 years agoCorrectly set LC_COLLATE into setenv
bapt [Wed, 15 Apr 2015 06:57:47 +0000 (06:57 +0000)]
Correctly set LC_COLLATE into setenv

Submitted by: jbeich

9 years agosnd_hda: add support for the Lenovo X1 20BS model.
rpaulo [Wed, 15 Apr 2015 05:24:39 +0000 (05:24 +0000)]
snd_hda: add support for the Lenovo X1 20BS model.

This requires a patch to redirect the output to a separate DAC when
the headphones are used.  While there, add device strings for Intel
Broadwell HDA controllers and Realtek ALC292 codecs.

MFC after: 1 week

9 years agoInitialize 'error' before use.
neel [Wed, 15 Apr 2015 05:04:42 +0000 (05:04 +0000)]
Initialize 'error' before use.

Reported by: Coverity Scan
CID: 1249748124974712497511249749
MFC after: 1 week

9 years agoFix RSS build - netisr input / NETISR_IP_DIRECT is used here.
adrian [Wed, 15 Apr 2015 00:57:21 +0000 (00:57 +0000)]
Fix RSS build - netisr input / NETISR_IP_DIRECT is used here.

9 years agoWhen reading in the original file name from gzip header, we read
delphij [Wed, 15 Apr 2015 00:07:21 +0000 (00:07 +0000)]
When reading in the original file name from gzip header, we read
in PATH_MAX + 1 bytes from the file.  In r281500, strrchr() is
used to strip possible path portion of the file name to mitigate
a possible attack.  Unfortunately, strrchr() expects a buffer
that is NUL-terminated, and since we are processing potentially
untrusted data, we can not assert that be always true.

Solve this by reading in one less byte (now PATH_MAX) and
explicitly terminate the buffer after the read size with NUL.

Reported by: Coverity
CID: 1264915
X-MFC-with: 281500
MFC after: 13 days

9 years agoIncrease vt font limits to allow use of GNU Unifont
emaste [Tue, 14 Apr 2015 19:18:34 +0000 (19:18 +0000)]
Increase vt font limits to allow use of GNU Unifont

PR: 199438
Submitted by: Ting-Wei Lan <lantw44@gmail.com>
MFC after: 1 week
Sponsored by: The FreeBSD Foundation

9 years agopf: Fix forwarding detection
kp [Tue, 14 Apr 2015 19:07:37 +0000 (19:07 +0000)]
pf: Fix forwarding detection

If the direction is not PF_OUT we can never be forwarding. Some input packets
have rcvif != ifp (looped back packets), which lead us to ip6_forward() inbound
packets, causing panics.

Equally, we need to ensure that packets were really received and not locally
generated before trying to ip6_forward() them.

Differential Revision: https://reviews.freebsd.org/D2286
Approved by: gnn(mentor)

9 years agoEliminate unused headers.
delphij [Tue, 14 Apr 2015 18:13:55 +0000 (18:13 +0000)]
Eliminate unused headers.

9 years agoInitialize async_arg_ptr in xpt_async when called with async_code
asomers [Tue, 14 Apr 2015 16:33:33 +0000 (16:33 +0000)]
Initialize async_arg_ptr in xpt_async when called with async_code
AC_ADVINFO_CHANGED.

Without this change, newly inserted hard disks won't always have their
physical path device nodes created.  The problem reproduces most readily
when attaching a large number of disks at once.

Differential Revision: https://reviews.freebsd.org/D2290
Reviewed by: mav, imp
MFC after: 2 weeks
Sponsored by: Spectra Logic

9 years agoDocument internal interface types which are specific to FreeBSD.
gnn [Tue, 14 Apr 2015 15:21:20 +0000 (15:21 +0000)]
Document internal interface types which are specific to FreeBSD.

9 years agoI can find no reason to allow packets with both SYN and FIN bits
gnn [Tue, 14 Apr 2015 14:43:42 +0000 (14:43 +0000)]
I can find no reason to allow packets with both SYN and FIN bits
set past this point in the code. The packet should be dropped and
not massaged as it is here.

Differential Revision:  https://reviews.freebsd.org/D2266
Submitted by: eri
Sponsored by: Rubicon Communications (Netgate)

9 years agoWhen a kernel has DEVICE_POLLING turned on but no drivers have
gnn [Tue, 14 Apr 2015 14:22:34 +0000 (14:22 +0000)]
When a kernel has DEVICE_POLLING turned on but no drivers have
the capability do not try to take the mutex at all.

Replaces misbegotten attempt from reverted commit 281276

Pointed out by: glebius
Sponsored by: Rubicon Communications (Netgate)
Differential Revision: https://reviews.freebsd.org/D2262

9 years ago* Remove the wfi when the efi loader returns, it's unneeded and is not
andrew [Tue, 14 Apr 2015 14:15:14 +0000 (14:15 +0000)]
* Remove the wfi when the efi loader returns, it's unneeded and is not
  available on older designs.
* Enable the efi loader on arm

9 years agoAdd support for arm64 to loader.efi and boot1.efi
andrew [Tue, 14 Apr 2015 13:55:01 +0000 (13:55 +0000)]
Add support for arm64 to loader.efi and boot1.efi

Reviewed by: emaste
Sponsored by: The FreeBSD Foundation

9 years agoFix the arm64 MACHINE_CPUARCH value in the efi fdt glue code.
andrew [Tue, 14 Apr 2015 10:41:57 +0000 (10:41 +0000)]
Fix the arm64 MACHINE_CPUARCH value in the efi fdt glue code.

Sponsored by: The FreeBSD Foundation

9 years agoUse MACHINE in the efi loader when it is what we mean, it may not be the
andrew [Tue, 14 Apr 2015 10:40:37 +0000 (10:40 +0000)]
Use MACHINE in the efi loader when it is what we mean, it may not be the
same as MACHINE_CPUARCH, it just happened to be the case the architectures
this code currently supports.

Sponsored by: The FreeBSD Foundation

9 years agoDisable truss, gprof, and lint on arm64, they don't build.
andrew [Tue, 14 Apr 2015 10:15:58 +0000 (10:15 +0000)]
Disable truss, gprof, and lint on arm64, they don't build.

Sponsored by: The FreeBSD Foundation

9 years agoipcs: fix builds that use gcc
eadler [Tue, 14 Apr 2015 04:52:52 +0000 (04:52 +0000)]
ipcs: fix builds that use gcc
gcc gets annoyed by duplicate declarations

Reported by: sbruno
Reviewed by: sbruno