]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
9 years agoAdd support for a netisr polling tunable, which allows run time switching of
gnn [Wed, 8 Apr 2015 20:25:51 +0000 (20:25 +0000)]
Add support for a netisr polling tunable, which allows run time switching of
device polling rather than having it only be controlled by the compile
time option.

Summary: Rubicon Communications (Netgate)

Reviewers: #network, hiren

Reviewed By: #network, hiren

Subscribers: hiren

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

9 years agoRe-do proper mode-endings. Antithesis of r281176-281179 which reverted
dteske [Wed, 8 Apr 2015 20:10:42 +0000 (20:10 +0000)]
Re-do proper mode-endings. Antithesis of r281176-281179 which reverted
earlier migration away from sloppy mode-endings (r280925,280974-280976)
due to a red-herring in diagnosing HardenedBSD boot lockup.

Thanks to: lattera (shawn.webb@hardenedbsd<dot>org)
MFC after: 3 days
X-MFC-to: stable/10
X-MFC-with: r280925,280974-280976,281176-281179

9 years agoExplain that vm_page_array is mapped to describe the memory, not the
kib [Wed, 8 Apr 2015 19:46:13 +0000 (19:46 +0000)]
Explain that vm_page_array is mapped to describe the memory, not the
memory itself.  Provide the formula to calculate the number of
required page tables.  Correct the size of the struct vm_page for
non-PAE case.

Reviewed by: alc, jhb (previous version)
Sponsored by: The FreeBSD Foundation
MFC after: 1 week

9 years agoFix a bootlock condition if/when loader_logo is set in loader.conf(5)
dteske [Wed, 8 Apr 2015 19:12:38 +0000 (19:12 +0000)]
Fix a bootlock condition if/when loader_logo is set in loader.conf(5)
NB: This deeply effected HardenedBSD which had a default value set.

Embarassingly, I allowed the `type' primitive to be passed -1/-1 for
c-addr/u stack input (the effect of which is to pull INT_MAX bytes
from character address negative one in which hilarity ensues over a
black screen in full-on bootlock). Much thanks to Shawn Webb [lattera]
for helping me diagnose.

NB: The mode-ending revisions were initially suspected (and reverted)
but proved to be a red-herring. Proper mode endings will be returning.

Thanks to: lattera (@HardenedBSD [<dot><com>])
Reported by: lattera
MFC after: 3 days
X-MFC-to: stable/10

9 years agocompiler-rt: include 128-bit quad precision fp support only on arm64
emaste [Wed, 8 Apr 2015 19:07:06 +0000 (19:07 +0000)]
compiler-rt: include 128-bit quad precision fp support only on arm64

Other architectures do not use quad precision long double and don't need
these runtime support routines.

Differential Revision: https://reviews.freebsd.org/D2252
Reviewed by: dim
Sponsored by: The FreeBSD Foundation

9 years agoMove the 32-bit compatible procfs types from freebsd32.h to <sys/procfs.h>
jhb [Wed, 8 Apr 2015 16:30:45 +0000 (16:30 +0000)]
Move the 32-bit compatible procfs types from freebsd32.h to <sys/procfs.h>
and export them to userland.
- Define __HAVE_REG32 on platforms that define a reg32 structure and check
  for this in <sys/procfs.h> to control when to export prstatus32, etc.
- Add prstatus32_t and prpsinfo32_t typedefs for the 32-bit structures.
  libbfd looks for these types, and having them fixes 'gcore' in gdb of a
  32-bit process on a 64-bit platform.
- Use the structure definitions from <sys/procfs.h> in gcore's elf32 core
  dump code instead of duplicating the definitions.

Differential Revision: https://reviews.freebsd.org/D2142
Reviewed by: kib, nathanw (powerpc bits)
MFC after: 1 week

9 years agoAdd a hint that "device ctl" kind of depends on "device iscsi".
trasz [Wed, 8 Apr 2015 11:59:00 +0000 (11:59 +0000)]
Add a hint that "device ctl" kind of depends on "device iscsi".

It actually doesn't - "device ctl" automatically pulls in ICL, which
would normally be a part of iscsi.ko.  However, doing it that way makes
iscsi.ko unloadable, and building ctl.ko without iscsi.ko (using
MODULES_OVERRIDE) results in ctl.ko that is unloadable, due to missing
symbols that would be resolved to iscsi.ko.  And since the symbols
are named "icl_whatever", it's not obvious that it's iscsi.ko that's
required.

If there is a better way - let me know.

MFC after: 1 month
Sponsored by: The FreeBSD Foundation

9 years agoClean up printtrap a little.
jhibbits [Wed, 8 Apr 2015 04:37:11 +0000 (04:37 +0000)]
Clean up printtrap a little.

* Sort exceptions
* Add printing of ESR on book-e, and only print DSISR on AIM

9 years agoAdd DTrace support for Book-E PowerPC.
jhibbits [Wed, 8 Apr 2015 04:35:26 +0000 (04:35 +0000)]
Add DTrace support for Book-E PowerPC.

Book-E got DTrace support for free with r281096&related.  This adds the bits to
the db_trap_glue() to support FBT.

Relnotes: Yes

9 years agonewvers.sh: remove 'X' hack from shell script
eadler [Wed, 8 Apr 2015 04:01:02 +0000 (04:01 +0000)]
newvers.sh: remove 'X' hack from shell script

Reviewed by: allanjude,  Daniel O'Connor

9 years agoAdd a DTRACEFLAGS variable, which can be used to pass additional variables
markj [Wed, 8 Apr 2015 02:43:05 +0000 (02:43 +0000)]
Add a DTRACEFLAGS variable, which can be used to pass additional variables
to dtrace(1) invocations during a build. This change includes -C in the
default flags, which has dtrace(1) run input scripts through the
preprocessor. While here, sort the definitions of CP and CPP in sys.mk.

Differential Revision: https://reviews.freebsd.org/D2204
Reviewed by: imp, rpaulo (previous revision)

9 years agolibdtrace: add support for lazyload mode.
markj [Wed, 8 Apr 2015 02:36:37 +0000 (02:36 +0000)]
libdtrace: add support for lazyload mode.

Passing "-x lazyload" to dtrace -G during compilation causes dtrace(1) to
not link drti.o into the output object file, so the USDT probes are not created
during process startup. Instead, dtrace(1) will automatically discover and
create probes on the process' behalf when attaching.

Differential Revision: https://reviews.freebsd.org/D2203
Reviewed by: rpaulo
MFC after: 1 month

9 years agoAccount for the offset of the page run when allocating the
kib [Wed, 8 Apr 2015 01:55:22 +0000 (01:55 +0000)]
Account for the offset of the page run when allocating the
dmar_map_entry.  Non-zero offset both increases the required mapping
size, which is handled in dmar_bus_dmamap_load_something1(), and makes
it possible that allocated range crosses boundary, which needs a check
in dmar_gas_match_one().

Reported and tested by: jimharris
Sponsored by: The FreeBSD Foundation
MFC after: 1 week

9 years agoFix powerpc setjmp FPR saving/restoring.
jhibbits [Wed, 8 Apr 2015 00:32:39 +0000 (00:32 +0000)]
Fix powerpc setjmp FPR saving/restoring.

X-MFC-With: r279784

9 years agoUnbreak book-e, broken by the trap.c merge (missed this file).
jhibbits [Wed, 8 Apr 2015 00:31:33 +0000 (00:31 +0000)]
Unbreak book-e, broken by the trap.c merge (missed this file).

9 years agoMove the IPv4 reassembly queue locking from a single lock to be per-bucket (global).
adrian [Tue, 7 Apr 2015 23:09:34 +0000 (23:09 +0000)]
Move the IPv4 reassembly queue locking from a single lock to be per-bucket (global).

This significantly improves performance on multi-core servers where there
is any kind of IPv4 reassembly going on.

glebius@ would like to see the locking moved to be attached to the reassembly
bucket, which would make it per-bucket + per-VNET, instead of being global.
I decided to keep it global for now as it's the minimal useful change;
if people agree / wish to migrate it to be per-bucket / per-VNET then please
do feel free to do so.  I won't complain.

Thanks to Norse Corp for giving me access to much larger servers
to test this at across the 4 core boxes I have at home.

Differential Revision: https://reviews.freebsd.org/D2095
Reviewed by: glebius (initial comments incorporated into this patch)
MFC after: 2 weeks
Sponsored by: Norse Corp, Inc (hardware)

9 years agoAdd EFI boot1 for i386
emaste [Tue, 7 Apr 2015 21:41:26 +0000 (21:41 +0000)]
Add EFI boot1 for i386

loader.efi still needs work, but boot1.efi now builds.

Differential Revision: https://reviews.freebsd.org/D2244
Reviewed by: rpaulo
Sponsored by: The FreeBSD Foundation

9 years agoEFI: use common reloc.c for all architectures
emaste [Tue, 7 Apr 2015 21:34:49 +0000 (21:34 +0000)]
EFI: use common reloc.c for all architectures

Much of this file is common to the architectures we support, so share
an implementation by adding a little #ifdef-ery.

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

9 years agoifmedia changes:
erj [Tue, 7 Apr 2015 21:31:17 +0000 (21:31 +0000)]
ifmedia changes:

- Extend the number of available subtypes for Ethernet media by using some
of the ifmedia word's option bits to help denote subtypes. As a result, the
number of possible Ethernet subtype values increases from 31 to 511.

- Use some of those new values to define new media types.

- lacp_compose_key() recgonizes the new Ethernet media types added.
  (Change made as required by a comment in if_media.h)

- New ioctl, SIOGIFXMEDIA, to handle getting the new extended media types.
  SIOCGIFMEDIA is retained for backwards compatibility.

- Changes to ifconfig to allow it to handle the new extended media types.

Submitted by: mike@karels.net (original), hselasky
Reviewed by: jfvogel, gnn, hselasky
Approved by: jfvogel (mentor), gnn (mentor)
Differential Revision: http://reviews.freebsd.org/D1965

9 years agoEvaluate packet size after the firewall had its chance
kp [Tue, 7 Apr 2015 20:29:03 +0000 (20:29 +0000)]
Evaluate packet size after the firewall had its chance

Defer the packet size check until after the firewall has had a look at it. This
means that the firewall now has the opportunity to (re-)fragment an oversized
packet.

Differential Revision: https://reviews.freebsd.org/D1815
Reviewed by: ae
Approved by: gnn (mentor)

9 years agoMitigate Local Denial of Service with IPv6 Router Advertisements
delphij [Tue, 7 Apr 2015 20:20:09 +0000 (20:20 +0000)]
Mitigate Local Denial of Service with IPv6 Router Advertisements
and log attack attempts.

Submitted by: hrs
Security: FreeBSD-SA-15:09.nd6
Security: CVE-2015-2923

9 years agoImprove patch for SA-15:04.igmp to solve a potential buffer overflow.
delphij [Tue, 7 Apr 2015 20:20:03 +0000 (20:20 +0000)]
Improve patch for SA-15:04.igmp to solve a potential buffer overflow.

Reported by: bde
Submitted by: oshogbo

9 years agoRevert r281220 and r281024, so that the new content added and its
hselasky [Tue, 7 Apr 2015 19:39:23 +0000 (19:39 +0000)]
Revert r281220 and r281024, so that the new content added and its
wording can be more properly discussed. Spelling fix made is kept.

Suggested by: gleb @
MFC after: 1 week

9 years agoAdd B_KVAALLOC and B_UNMAPPED to the buf flag name list.
markj [Tue, 7 Apr 2015 19:37:49 +0000 (19:37 +0000)]
Add B_KVAALLOC and B_UNMAPPED to the buf flag name list.

Differential Revision: https://reviews.freebsd.org/D1895
Submitted by: Conrad Meyer
MFC after: 1 week

9 years agocompiler-rt: add floatditf and floatunditf
emaste [Tue, 7 Apr 2015 19:31:29 +0000 (19:31 +0000)]
compiler-rt: add floatditf and floatunditf

These are long integer (di_int/du_int) to quad precision floating point
conversions. They may be reworked based on upstream discussion. These
versions are here to support arm64 world builds.

Reviewed by: ed
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D2174

9 years agocompiler-rt: Implement multc3 - quad-precision complex multiplication
emaste [Tue, 7 Apr 2015 19:28:53 +0000 (19:28 +0000)]
compiler-rt: Implement multc3 - quad-precision complex multiplication

This may be reworked based on upstream discussion. This version is here
to support arm64 world builds.

Reviewed by: ed
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D2173

9 years agoJust briefly mention about the dangers of non-random IP IDs.
hselasky [Tue, 7 Apr 2015 18:52:00 +0000 (18:52 +0000)]
Just briefly mention about the dangers of non-random IP IDs.
A full in depth explanation belongs somewhere else.

Suggested by: gleb @
MFC after: 1 week

9 years agopatch: Bring small updates from OpenBSD
pfg [Tue, 7 Apr 2015 18:06:46 +0000 (18:06 +0000)]
patch: Bring small updates from OpenBSD

Prevent null pointer dereference on empty input files when diff requires
a specific version.

Fix division by zero for files with long lines (> 1024) in Plan B mode
by supporting arbitrarily long lines.

Obtained from: OpenBSD (CVS Rev 1.41, 1.42)
MFC after: 1 week

9 years agoCheck l2cap socket initialisation and define L2CAP_SOCKET_CHECKED
takawata [Tue, 7 Apr 2015 16:48:23 +0000 (16:48 +0000)]
Check l2cap socket initialisation and define L2CAP_SOCKET_CHECKED
This will fix build.

9 years agoFix missing AUTHOR section for jot(1), rs(1), and lam(1)
allanjude [Tue, 7 Apr 2015 15:56:08 +0000 (15:56 +0000)]
Fix missing AUTHOR section for jot(1), rs(1), and lam(1)

PR: 196786
Differential Revision: https://reviews.freebsd.org/D2115
Submitted by: John A. Kunze (Author)
Approved by: wblock (mentor)
MFC after: 1 week
Sponsored by: ScaleEngine Inc.

9 years agoAdd a missing comma.
brueffer [Tue, 7 Apr 2015 15:32:25 +0000 (15:32 +0000)]
Add a missing comma.

Submitted by: danfe

9 years agoGet the fdt uart driver working on arm64, there is no machine/fdt.h, and
andrew [Tue, 7 Apr 2015 15:12:03 +0000 (15:12 +0000)]
Get the fdt uart driver working on arm64, there is no machine/fdt.h, and
the default shift should be 2 for the SoCs we support.

Sponsored by: The FreeBSD Foundation

9 years agoMake use of allocation attributes in system headers.
pfg [Tue, 7 Apr 2015 14:47:27 +0000 (14:47 +0000)]
Make use of allocation attributes in system headers.

Start using 'alloc_size' attribute in the allocator functions.
This is useful as it helps the compiler generate warnings on suspicious
code and can also enable some small optimizations.

This is based on r281130, which brought similar enhnacements
to the standard libc headers.

9 years agoThe code says "or", not "either or". So fix the documentation.
tuexen [Tue, 7 Apr 2015 14:33:03 +0000 (14:33 +0000)]
The code says "or", not "either or". So fix the documentation.

MFC after: 1 week

9 years agoWe will have fueword on arm64, mark as such in machine/param.h.
andrew [Tue, 7 Apr 2015 13:17:28 +0000 (13:17 +0000)]
We will have fueword on arm64, mark as such in machine/param.h.

Sponsored by: The FreeBSD Foundation

9 years agoFix uart_fdt_get_clock. It should have beed using the cell variable passed
andrew [Tue, 7 Apr 2015 12:42:06 +0000 (12:42 +0000)]
Fix uart_fdt_get_clock. It should have beed using the cell variable passed
in, not value on the stack.

9 years agoRemove hard limits on number of accepting NFS connections.
mav [Tue, 7 Apr 2015 10:25:27 +0000 (10:25 +0000)]
Remove hard limits on number of accepting NFS connections.

Limits of 5 connections set long ago creates problems for SPEC benchmark.
Make the NFS follow system-wide maximum.

MFC after: 1 week

9 years agoInitial Bluetooth LE support.
takawata [Tue, 7 Apr 2015 10:22:56 +0000 (10:22 +0000)]
Initial Bluetooth LE support.

Note that sockaddr_l2cap structure is changed , check socket address
to initialize new structure member and define L2CAP_SOCKET_CHECKED
before including ng_btsocket.h

Differential Revision:        https://reviews.freebsd.org/D2021
Reviewed by:emax

9 years agoAdd the start of libc and libstand for arm64. Not all of the machine
andrew [Tue, 7 Apr 2015 09:52:14 +0000 (09:52 +0000)]
Add the start of libc and libstand for arm64. Not all of the machine
dependent functions have been implemented, but this is enough for world.

Differential Revision: https://reviews.freebsd.org/D2132
Reviewed by: emaste
Sponsored by: The FreeBSD Foundation

9 years agoadd the define to properly guard this header..
jmg [Tue, 7 Apr 2015 09:00:03 +0000 (09:00 +0000)]
add the define to properly guard this header..

Sponsored by: Netflix, Inc.

9 years agoIn ipfilter(4) there is the ipftest(1) program, that compiles half of the
glebius [Tue, 7 Apr 2015 06:22:22 +0000 (06:22 +0000)]
In ipfilter(4) there is the ipftest(1) program, that compiles half of the
ipfilter code as userland application. To reduce kernel structure knowledge
include if_var.h only if a file is compiled with _KERNEL defined.
In !_KERNEL case, provide our own definition of struct ifnet, that will
satisfy ipftest(1). This was already done earlier to struct ifaddr in
r279029. Protect the definition with _NET_IF_VAR_H_, since kernel part
of ipfilter may include if_var.h and ip_compat.h.

Sponsored by: Netflix
Sponsored by: Nginx, Inc.

9 years agoLike it was already done for 'netstat -i', drop the kvm(3) support
glebius [Tue, 7 Apr 2015 05:50:45 +0000 (05:50 +0000)]
Like it was already done for 'netstat -i', drop the kvm(3) support
in 'netstat -r'.

The netstat/route.c was the last abuser of struct ifnet and struct
rtentry in the tree. With this change if_var.h can become kernel
only include, _WANT_RTENTRY can go away and projects/ifnet and
projects/routing can go forward.

Differential Revision: https://reviews.freebsd.org/D2242
Reviewed by: melifaro, gnn
Sponsored by: Nginx, Inc.
Sponsored by: Netflix

9 years ago - Simplify vm_pageout_scan() by introducing a new vm_pageout_clean()
jeff [Tue, 7 Apr 2015 02:18:52 +0000 (02:18 +0000)]
 - Simplify vm_pageout_scan() by introducing a new vm_pageout_clean()
   function that does the locking and validation associated with cleaning
   a page.  This moves 150 lines of code into its own function.
 - Rename vm_pageout_clean() to vm_pageout_cluster() to define what it
   really does; clustering nearby pages for pageout optimization.

Reviewd by: alc, kib, kmacy
Tested by: pho (earlier version)
Sponsored by: EMC / Isilon

9 years agoAdd Lenovo ThinkPad OneLink GigaLAN.
kevlo [Tue, 7 Apr 2015 01:47:36 +0000 (01:47 +0000)]
Add Lenovo ThinkPad OneLink GigaLAN.

PR: 199184
Submitted by: Robin Karlsson

9 years agoRemove custom getdelim(3) and fix a small memory leak.
pfg [Tue, 7 Apr 2015 01:17:49 +0000 (01:17 +0000)]
Remove custom getdelim(3) and fix a small memory leak.

Originally from Andre Smagin.

Obtained from: OpenBSD
MFC after: 1 week

9 years agosort(1): Cleanups and a small memory leak.
pfg [Tue, 7 Apr 2015 01:17:29 +0000 (01:17 +0000)]
sort(1): Cleanups and a small memory leak.

Remove useless check for leading blanks in the month name.  The
code didn't adjust len after stripping blanks so even if a month
*did* start with a blank we'd end up copying garbage at the end.
Also convert a malloc + memcpy to strdup and fix a memory leak in
the wide char version if mbstowcs() fails.
Originally from Andre Smagin.

Obtained from:  OpenBSD (CVS rev. 1.2, 1.3)
MFC after: 1 week

9 years agoEliminate literal escape sequences from *.rc
dteske [Mon, 6 Apr 2015 23:37:04 +0000 (23:37 +0000)]
Eliminate literal escape sequences from *.rc

Suggested by: alfred
MFC after: 3 days
X-MFC-to: stable/10
X-MFC-with: r280976, r281179

9 years agoPartially revert r280976: Back to previous mode-endings based on feedback
dteske [Mon, 6 Apr 2015 23:22:54 +0000 (23:22 +0000)]
Partially revert r280976: Back to previous mode-endings based on feedback

Reported by: lattera
MFC after: 3 days
X-MFC-to: stable/10
X-MFC-with: r280976

9 years agoPartially revert r280975: Back to previous mode-endings based on feedback
dteske [Mon, 6 Apr 2015 23:16:03 +0000 (23:16 +0000)]
Partially revert r280975: Back to previous mode-endings based on feedback

Reported by: lattera
MFC after: 3 days
X-MFC-to: stable/10
X-MFC-with: r280975

9 years agoPartially revert r280974: Back to previous mode-endings based on feedback
dteske [Mon, 6 Apr 2015 23:13:16 +0000 (23:13 +0000)]
Partially revert r280974: Back to previous mode-endings based on feedback

MFC after: 3 days
X-MFC-to: stable/10
X-MFC-with: r290974
Reported by: lattera

9 years agoPartially revert r280925: Back to previous mode-endings based on feedback
dteske [Mon, 6 Apr 2015 23:10:47 +0000 (23:10 +0000)]
Partially revert r280925: Back to previous mode-endings based on feedback

MFC after: 3 days
X-MFC-with: r280925
Reported by: lattera

9 years agolockf(1): add a reference to lockf(3).
markj [Mon, 6 Apr 2015 22:53:23 +0000 (22:53 +0000)]
lockf(1): add a reference to lockf(3).

Submitted by: Conrad Meyer
MFC after: 1 week

9 years agoo Make net.inet6.ip6.mif6table return special API structure, that doesn't
glebius [Mon, 6 Apr 2015 22:12:18 +0000 (22:12 +0000)]
o Make net.inet6.ip6.mif6table return special API structure, that doesn't
  contain kernel pointers, and instead has interface index.
  Bump __FreeBSD_version for that change.
o Now, netstat/mroute6.c no longer needs to kvm_read(3) struct ifnet, and
  no longer needs to include if_var.h

Note that this change is far from being a complete move of IPv6 multicast
routing to a proper API. Other structures are still dumped into their
sysctls as is, requiring userland application to #define _KERNEL when
including ip6_mroute.h and then call kvm_read(3) to gather all bits and
pieces. But fixing this is out of scope of the opaque ifnet project.

Sponsored by: Nginx, Inc.
Sponsored by: Netflix

9 years agoTidy up battery status information. Remove a trailing white space.
jkim [Mon, 6 Apr 2015 21:51:55 +0000 (21:51 +0000)]
Tidy up battery status information.  Remove a trailing white space.

PR: 193671

9 years agovfork() first appeared in 3BSD which pre-dates 2.9BSD. Verified via the
jhb [Mon, 6 Apr 2015 20:40:01 +0000 (20:40 +0000)]
vfork() first appeared in 3BSD which pre-dates 2.9BSD.  Verified via the
copy of 3BSD on disc 1 of "The CSRG Archives".

PR: 198612
MFC after: 1 week

9 years agoMake global variabled only used in this file static.
andrew [Mon, 6 Apr 2015 19:58:28 +0000 (19:58 +0000)]
Make global variabled only used in this file static.

9 years agoUnbreak ZFS+GELI install option.
dteske [Mon, 6 Apr 2015 19:26:45 +0000 (19:26 +0000)]
Unbreak ZFS+GELI install option.

Reported by: delphij
Submitted by: delphij
Pointy hat to: dteske (me)
MFC after: 3 days
X-MFC-to: stable/10 stable/9
X-MFC-with: r281160

9 years agoTypo fix in comment
jpaetzel [Mon, 6 Apr 2015 19:23:45 +0000 (19:23 +0000)]
Typo fix in comment

MFC after: 3 days

9 years agoRemove duplicate code
kp [Mon, 6 Apr 2015 19:08:44 +0000 (19:08 +0000)]
Remove duplicate code

We'll just fall into the same local delivery block under the
'if (m->m_flags & M_FASTFWD_OURS)'.

Suggested by: ae
Differential Revision: https://reviews.freebsd.org/D2225
Approved by: gnn (mentor)

9 years agopf: Skip firewall for refragmented ip6 packets
kp [Mon, 6 Apr 2015 19:05:00 +0000 (19:05 +0000)]
pf: Skip firewall for refragmented ip6 packets

In cases where we scrub (fragment reassemble) on both input and output
we risk ending up in infinite loops when forwarding packets.

Fragmented packets come in and get collected until we can defragment. At
that point the defragmented packet is handed back to the ip stack (at
the pfil point in ip6_input(). Normal processing continues.

Eventually we figure out that the packet has to be forwarded and we end
up at the pfil hook in ip6_forward(). After doing the inspection on the
defragmented packet we see that the packet has been defragmented and
because we're forwarding we have to refragment it.

In pf_refragment6() we split the packet up again and then ip6_forward()
the individual fragments.  Those fragments hit the pfil hook on the way
out, so they're collected until we can reconstruct the full packet, at
which point we're right back where we left off and things continue until
we run out of stack.

Break that loop by marking the fragments generated by pf_refragment6()
as M_SKIP_FIREWALL. There's no point in processing those packets in the
firewall anyway. We've already filtered on the full packet.

Differential Revision: https://reviews.freebsd.org/D2197
Reviewed by: glebius, gnn
Approved by: gnn (mentor)

9 years agoMake ctld to not exit on ECONNABORTED on accept().
mav [Mon, 6 Apr 2015 18:56:02 +0000 (18:56 +0000)]
Make ctld to not exit on ECONNABORTED on accept().

That is not really an error for the main process.

MFC after: 1 week
Sponsored by: iXsystems, Inc.

9 years agoProperly calculate "UMA Zones" per cpu cache size. Avoid allocating
dchagin [Mon, 6 Apr 2015 18:45:41 +0000 (18:45 +0000)]
Properly calculate "UMA Zones" per cpu cache size. Avoid allocating
an extra struct uma_cache since the struct uma_zone already has one.

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

9 years agoFix permissions on ZFS root encryption key (644 -> 600).
dteske [Mon, 6 Apr 2015 18:03:35 +0000 (18:03 +0000)]
Fix permissions on ZFS root encryption key (644 -> 600).

MFC after: 3 days
X-MFC-to: stable/10 stable/9
Security: CVE-2015-1415
Reported by: Pierre Kim

9 years agoMove the message complaining about failed system resource allocations
jhb [Mon, 6 Apr 2015 17:39:36 +0000 (17:39 +0000)]
Move the message complaining about failed system resource allocations
under bootverbose.  Every example I've seen to date has been due to
an ACPI system resource device reserving a range that overlaps with
system memory (which ram0 attempts to reserve) or a local or I/O APIC
(which apic0 attempts to reserve).  These are always harmless but look
scary to users.

MFC after: 1 week

9 years agoFix the index for FAULTBUF_R13, missed during merge/cleanup.
jhibbits [Mon, 6 Apr 2015 16:29:45 +0000 (16:29 +0000)]
Fix the index for FAULTBUF_R13, missed during merge/cleanup.

9 years agoSplit out the _acq and _rel functions. These were the same, but there is
andrew [Mon, 6 Apr 2015 16:27:22 +0000 (16:27 +0000)]
Split out the _acq and _rel functions. These were the same, but there is
no need for them to be this strong, we only need to provide one or the
other.

While here replace atomic_load_acq_* and atomic_store_rel_* with a single
instruction version, and fix the definition of atomic_clear_* to point to
the correct functions.

Sponsored by: The FreeBSD Foundation

9 years agoAdd support to the efi boot1 and loader for 32-bit ARM. This will be used
andrew [Mon, 6 Apr 2015 15:50:20 +0000 (15:50 +0000)]
Add support to the efi boot1 and loader for 32-bit ARM. This will be used
by the future qemu virt support.

Differential Revision: https://reviews.freebsd.org/D2238
Reviewed by: emaste

9 years agoAdd sleepable lock to protect at least against two parallel SIOCSVHs.
glebius [Mon, 6 Apr 2015 15:31:19 +0000 (15:31 +0000)]
Add sleepable lock to protect at least against two parallel SIOCSVHs.

Sponsored by: Nginx, Inc.

9 years agoUpdate reported elftoolchain version to 3179
emaste [Mon, 6 Apr 2015 13:55:33 +0000 (13:55 +0000)]
Update reported elftoolchain version to 3179

Missed in r280932

9 years agobthidd: Remove unused macros from hid.c.
rakuco [Mon, 6 Apr 2015 12:36:24 +0000 (12:36 +0000)]
bthidd: Remove unused macros from hid.c.

ASIZE() was never used, and min() stopped being used in r207812.

Differential Revision: https://reviews.freebsd.org/D2230
Reviewed by: emax
Approved by: emax
MFC after: 1 week

9 years agoEnhance the support for Group 1 Extended opcodes:
tychon [Mon, 6 Apr 2015 12:22:41 +0000 (12:22 +0000)]
Enhance the support for Group 1 Extended opcodes:

  * Implemement the 0x81 and 0x83 CMP instructions.
  * Implemement the 0x83 AND instruction.
  * Implemement the 0x81 OR instruction.

Reviewed by: neel

9 years agoStop including if_var.h from userland.
glebius [Mon, 6 Apr 2015 09:42:23 +0000 (09:42 +0000)]
Stop including if_var.h from userland.

Sponsored by: Nginx, Inc.

9 years agoConvert printfs in m_ext allocator to KASSERTs.
glebius [Mon, 6 Apr 2015 09:15:18 +0000 (09:15 +0000)]
Convert printfs in m_ext allocator to KASSERTs.

Discussed with: rwatson
Sponsored by: Nginx, Inc.

9 years agoRespect DESTDIR when creating the directory structure when NO_ROOT is set.
andrew [Mon, 6 Apr 2015 08:37:40 +0000 (08:37 +0000)]
Respect DESTDIR when creating the directory structure when NO_ROOT is set.

Reviewed by: bapt
MFC after: 1 Week

9 years agoSMBIOS support for EFI.
rpaulo [Mon, 6 Apr 2015 06:55:47 +0000 (06:55 +0000)]
SMBIOS support for EFI.

MFC after: 1 week

9 years agoichsmb: add a device id for the Wildcat Point-LP.
rpaulo [Mon, 6 Apr 2015 06:02:58 +0000 (06:02 +0000)]
ichsmb: add a device id for the Wildcat Point-LP.

MFC after: 1 week

9 years agoMake strlcpy/strlcat slightly easier to read.
pfg [Mon, 6 Apr 2015 03:21:22 +0000 (03:21 +0000)]
Make strlcpy/strlcat slightly easier to read.

Bring small upstream updates.

Obtained from: OpenBSD

9 years agosort: style knits / cleanups.
pfg [Mon, 6 Apr 2015 03:02:20 +0000 (03:02 +0000)]
sort: style knits / cleanups.

Minor cleanups that got accidentally reverted.

Obtained from: OpenBSD

9 years agoRevert (partial) r281123, r281125:
pfg [Mon, 6 Apr 2015 02:35:55 +0000 (02:35 +0000)]
Revert (partial) r281123, r281125:
sort: style knits / cleanups.

Our style guide(9) specifies that in absence of local variables
an empty line must be inserted.

Pointed out by: eadler

9 years agoEnforce LC_COLLATE="C" until we do support proper UTF-8 collation
bapt [Mon, 6 Apr 2015 01:53:47 +0000 (01:53 +0000)]
Enforce LC_COLLATE="C" until we do support proper UTF-8 collation

9 years agoMake use of gcc attributes in some standard include headers.
pfg [Mon, 6 Apr 2015 01:39:16 +0000 (01:39 +0000)]
Make use of gcc attributes in some standard include headers.

The `nonnull' attribute specifies that some function parameters should be
non-null pointers.  This is very useful as it helps the compiler generate
warnings on suspicious code and can also enable some small optimizations.

Also start using 'alloc_size' attribute in the allocator functions.

This is an initial step to better integrate our libc with the compiler:
these attributes are fully supported by clang and they are also useful
for the static analyzer.

Note that due to some bogus internal procedure in the way gcc ports
are built they may require updating if they were built before r280801.

Relnotes: yes
Hinted by: Android's bionic libc
Differential Revision: https://reviews.freebsd.org/D2107

9 years agoSwitch russian login class to UTF-8
amdmi3 [Mon, 6 Apr 2015 01:32:26 +0000 (01:32 +0000)]
Switch russian login class to UTF-8

Reviewed by: glebius
Approved by: glebius
Differential Revision: D2129

9 years agoReturn the correct HAL data type for HAL_DIAG_ANI_STATS.
adrian [Mon, 6 Apr 2015 01:12:53 +0000 (01:12 +0000)]
Return the correct HAL data type for HAL_DIAG_ANI_STATS.

I .. stupidly added code to return HAL_ANI_STATS to HAL_DIAG_ANI_STATS.
I discovered this in a noisy environment when the returned values were
enough to .. well, make everything terrible.

So - restore functionality.

Tested:

* AR5416 (uses the AR5212 HAL), in a /very/ noisy 2GHz environment.
  Enough to trigger ANI to get upset and generate useful data.

9 years agopsm: print newer Synaptics Touchpad capabilities.
rpaulo [Mon, 6 Apr 2015 01:04:08 +0000 (01:04 +0000)]
psm: print newer Synaptics Touchpad capabilities.

9 years agoTypecast things.
adrian [Mon, 6 Apr 2015 00:34:59 +0000 (00:34 +0000)]
Typecast things.

9 years agosort: style knits / cleanups.
pfg [Sun, 5 Apr 2015 23:06:42 +0000 (23:06 +0000)]
sort: style knits / cleanups.

Obtained from: OpenBSD

9 years agosort: Fix a comment.
pfg [Sun, 5 Apr 2015 22:34:03 +0000 (22:34 +0000)]
sort: Fix a comment.

Obtained from: OpenBSD

9 years agosort: Cleanup small issues with spaces.
pfg [Sun, 5 Apr 2015 22:22:43 +0000 (22:22 +0000)]
sort: Cleanup small issues with spaces.

Obtained from: OpenBSD

9 years agoConvert the DIR-825C1 to use the new map based MAC address configuration.
adrian [Sun, 5 Apr 2015 22:00:44 +0000 (22:00 +0000)]
Convert the DIR-825C1 to use the new map based MAC address configuration.

Tested:

* DIR-825C1

9 years agoDo not call msdosfs_sync() on the read-only msdosfs mounts. In fact,
kib [Sun, 5 Apr 2015 21:10:38 +0000 (21:10 +0000)]
Do not call msdosfs_sync() on the read-only msdosfs mounts.  In fact,
it should be a nop for ro.

PR: 199152
Reviewed by: bde (PR version of the patch)
Submitted by: longwitz@incore.de
MFC after: 1 week

9 years agoAssert that an msdosfs mount is not read-only when FAT modifications
kib [Sun, 5 Apr 2015 21:08:04 +0000 (21:08 +0000)]
Assert that an msdosfs mount is not read-only when FAT modifications
are requested.

PR: 199152
Sponsored by: The FreeBSD Foundation
MFC after: 1 week

9 years agoUpdate the board MAC address configuration for the DIR-655A1.
adrian [Sun, 5 Apr 2015 20:56:51 +0000 (20:56 +0000)]
Update the board MAC address configuration for the DIR-655A1.

The MAC addresses were totally wrong. They're like the DIR-625C1 - at
0x1ffe0004 and 0x1ffe0018. They're however stored as text strings.
The ath0 MAC address is also not set, even though the calibration
partition is valid.

So, pick the board address / first MAC as the ath0 MAC, and derive
arge0/arge1 from that.  That way they're hopefully unique enough
for people with multiple devices.

Tested:

* DIR-655A1

TODO:

* Do the same for the DIR-625A1 and DIR-625C1.

9 years agoUntil the lock assertions in vm_page_advise() are properly reevaluated,
alc [Sun, 5 Apr 2015 20:07:33 +0000 (20:07 +0000)]
Until the lock assertions in vm_page_advise() are properly reevaluated,
vm_fault_dontneed() should acquire a write lock on the first object in
the shadow chain.

Reported by: gleb, David Wolfskill

9 years agoMove boot1.efi to the global CLEANFILES list, it's not x86 specific.
andrew [Sun, 5 Apr 2015 18:57:58 +0000 (18:57 +0000)]
Move boot1.efi to the global CLEANFILES list, it's not x86 specific.

9 years agobthidd: Consider usage ranges when dealing with array inputs.
rakuco [Sun, 5 Apr 2015 18:53:48 +0000 (18:53 +0000)]
bthidd: Consider usage ranges when dealing with array inputs.

So far, we were always using HID_USAGE() to determine the Usage ID of a
certain HID report input item. This does not work as intended if a field
is an array and the allowed usages are specified with a usage range, as
HID_USAGE() will return 0. We need to use the field value as an index in
the usage range list in this case instead.

This makes the volume keys in a Microsoft Bluetooth Mobile Keyboard
5000 be properly recognized. The relevant part of the HID report looks
like this:

  0xA1, 0x01,        // Collection (Application)
  0x85, 0x07,        //   Report ID (7)
  0x05, 0x0C,        //   Usage Page (Consumer)
  0x19, 0x00,        //   Usage Minimum (Unassigned)
  0x2A, 0xFF, 0x03,  //   Usage Maximum (0x03FF)
  0x95, 0x01,        //   Report Count (1)
  0x75, 0x10,        //   Report Size (16)
  0x15, 0x00,        //   Logical Minimum (0)
  0x27, 0xFF, 0x03, 0x00, 0x00,  //   Logical Maximum (1023)
  0x81, 0x00,        //   Input (Data,Array,Abs,No Wrap,Linear,Preferred
                     //   State,No Null Position)

When a key such as "volume down" is pressed, the following data is
transferred through Interrupt In:

  0x07 0xEA 0x00

Differential Revision: https://reviews.freebsd.org/D2229
Reviewed by: emax
Approved by: emax
MFC after: 1 week

9 years agoSpell MACHINE_CPUARCH correctly
andrew [Sun, 5 Apr 2015 18:42:43 +0000 (18:42 +0000)]
Spell MACHINE_CPUARCH correctly

9 years agoAdd FDT support to loader.efi. This will be used on arm and arm64.
andrew [Sun, 5 Apr 2015 18:37:39 +0000 (18:37 +0000)]
Add FDT support to loader.efi. This will be used on arm and arm64.

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

9 years agoFix wrong kassert msg in uma.
dchagin [Sun, 5 Apr 2015 18:25:23 +0000 (18:25 +0000)]
Fix wrong kassert msg in uma.

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

9 years agoBug fixes and feature adds
jpaetzel [Sun, 5 Apr 2015 17:09:58 +0000 (17:09 +0000)]
Bug fixes and feature adds

- Remove extranious echo that breaks puppet
- Handle restarts of multiple pflog devices correctly
- Add the ability to perform actions on specific pflog devices.

PR: 199150
Submitted by: jason.unovitch@gmail.com
MFC after: 3 days

9 years agoMissed this in r281096 as well.
jhibbits [Sun, 5 Apr 2015 16:35:13 +0000 (16:35 +0000)]
Missed this in r281096 as well.

Renumber EXC_DEBUG to be above EXC_LAST, so as not to conflict with AIM trap
vectors.