Commit Graph

198991 Commits

Author SHA1 Message Date
Eric Joyner
eb7e25b22f 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
2015-04-07 21:31:17 +00:00
Kristof Provost
53deb05c36 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)
2015-04-07 20:29:03 +00:00
Xin LI
dd3856601d 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
2015-04-07 20:20:09 +00:00
Xin LI
edc76c95db Improve patch for SA-15:04.igmp to solve a potential buffer overflow.
Reported by:	bde
Submitted by:	oshogbo
2015-04-07 20:20:03 +00:00
Hans Petter Selasky
10e69389b6 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
2015-04-07 19:39:23 +00:00
Mark Johnston
c99d7d32ec 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
2015-04-07 19:37:49 +00:00
Ed Maste
6853d12d4f 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
2015-04-07 19:31:29 +00:00
Ed Maste
13553dc6bd 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
2015-04-07 19:28:53 +00:00
Hans Petter Selasky
d92661658b 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
2015-04-07 18:52:00 +00:00
Pedro F. Giffuni
a45060f0cc 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
2015-04-07 18:06:46 +00:00
Takanori Watanabe
8d6f425ddd Check l2cap socket initialisation and define L2CAP_SOCKET_CHECKED
This will fix build.
2015-04-07 16:48:23 +00:00
Allan Jude
212236608c 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.
2015-04-07 15:56:08 +00:00
Christian Brueffer
67214fc8af Add a missing comma.
Submitted by:	danfe
2015-04-07 15:32:25 +00:00
Andrew Turner
be3b046ce8 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
2015-04-07 15:12:03 +00:00
Pedro F. Giffuni
079419ddc2 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.
2015-04-07 14:47:27 +00:00
Michael Tuexen
25044bbcfb The code says "or", not "either or". So fix the documentation.
MFC after: 1 week
2015-04-07 14:33:03 +00:00
Andrew Turner
8c9db319f6 We will have fueword on arm64, mark as such in machine/param.h.
Sponsored by:	The FreeBSD Foundation
2015-04-07 13:17:28 +00:00
Andrew Turner
7966cc995c Fix uart_fdt_get_clock. It should have beed using the cell variable passed
in, not value on the stack.
2015-04-07 12:42:06 +00:00
Alexander Motin
80867e61d8 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
2015-04-07 10:25:27 +00:00
Takanori Watanabe
fbc48c2bfb 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
2015-04-07 10:22:56 +00:00
Andrew Turner
d422e6f9b5 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
2015-04-07 09:52:14 +00:00
John-Mark Gurney
9df9c6bc0d add the define to properly guard this header..
Sponsored by:	Netflix, Inc.
2015-04-07 09:00:03 +00:00
Gleb Smirnoff
b7703ad432 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.
2015-04-07 06:22:22 +00:00
Gleb Smirnoff
6fe1796015 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
2015-04-07 05:50:45 +00:00
Jeff Roberson
34d8b7ea3b - 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
2015-04-07 02:18:52 +00:00
Kevin Lo
45440aa84e Add Lenovo ThinkPad OneLink GigaLAN.
PR:	199184
Submitted by:	Robin Karlsson
2015-04-07 01:47:36 +00:00
Pedro F. Giffuni
0f4b9a9057 Remove custom getdelim(3) and fix a small memory leak.
Originally from Andre Smagin.

Obtained from:	OpenBSD
MFC after:	1 week
2015-04-07 01:17:49 +00:00
Pedro F. Giffuni
b904ab99bc 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
2015-04-07 01:17:29 +00:00
Devin Teske
2df04ab49b Eliminate literal escape sequences from *.rc
Suggested by:	alfred
MFC after:	3 days
X-MFC-to:	stable/10
X-MFC-with:	r280976, r281179
2015-04-06 23:37:04 +00:00
Devin Teske
e076835f9c 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
2015-04-06 23:22:54 +00:00
Devin Teske
be77d1d90c 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
2015-04-06 23:16:03 +00:00
Devin Teske
72bd569df0 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
2015-04-06 23:13:16 +00:00
Devin Teske
9390da3689 Partially revert r280925: Back to previous mode-endings based on feedback
MFC after:	3 days
X-MFC-with:	r280925
Reported by:	lattera
2015-04-06 23:10:47 +00:00
Mark Johnston
bef6922b96 lockf(1): add a reference to lockf(3).
Submitted by:	Conrad Meyer
MFC after:	1 week
2015-04-06 22:53:23 +00:00
Gleb Smirnoff
c151f24d08 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
2015-04-06 22:12:18 +00:00
Jung-uk Kim
7ecb60344d Tidy up battery status information. Remove a trailing white space.
PR:		193671
2015-04-06 21:51:55 +00:00
John Baldwin
b871bfa1a2 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
2015-04-06 20:40:01 +00:00
Andrew Turner
533e5098de Make global variabled only used in this file static. 2015-04-06 19:58:28 +00:00
Devin Teske
1ebd9bd41c 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
2015-04-06 19:26:45 +00:00
Josh Paetzel
fe56ff1ccc Typo fix in comment
MFC after:	3 days
2015-04-06 19:23:45 +00:00
Kristof Provost
31e2e88c27 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)
2015-04-06 19:08:44 +00:00
Kristof Provost
1873dcc8c9 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)
2015-04-06 19:05:00 +00:00
Alexander Motin
83dd77c3c1 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.
2015-04-06 18:56:02 +00:00
Dmitry Chagin
6723fdfe46 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
2015-04-06 18:45:41 +00:00
Devin Teske
4ef4026223 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
2015-04-06 18:03:35 +00:00
John Baldwin
44947d3aeb 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
2015-04-06 17:39:36 +00:00
Justin Hibbits
7a9d50b370 Fix the index for FAULTBUF_R13, missed during merge/cleanup. 2015-04-06 16:29:45 +00:00
Andrew Turner
46f52b028f 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
2015-04-06 16:27:22 +00:00
Andrew Turner
63d071445e 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
2015-04-06 15:50:20 +00:00
Gleb Smirnoff
93d4534cdc Add sleepable lock to protect at least against two parallel SIOCSVHs.
Sponsored by:	Nginx, Inc.
2015-04-06 15:31:19 +00:00