Commit graph

193139 commits

Author SHA1 Message Date
Gleb Smirnoff 09c7577ef3 - When reconfiguring protocol on a lagg, first set it to LAGG_PROTO_NONE,
then drop lock, run the attach routines, and then set it to specific
  proto. This removes tons of WITNESS warnings.
- Make lagg protocol attach handlers not failing and allocate memory
  with M_WAITOK.

Sponsored by:	Netflix
Sponsored by:	Nginx, Inc.
2014-09-26 08:42:32 +00:00
Gavin Atkinson cd8d304e79 Add new (untested) device IDs to smsc(4)
MFC after:	1 week
2014-09-26 08:16:26 +00:00
Gleb Smirnoff b5e094cfd7 Make lagg protos a enum. 2014-09-26 08:12:12 +00:00
Gleb Smirnoff b1bbc5b3d1 Make lagg protocols detach methods returning void.
Sponsored by:	Netflix
Sponsored by:	Nginx, Inc.
2014-09-26 07:12:40 +00:00
Mark Johnston 946497ec23 Fix the description of the -h option.
Reported by:	swills
MFC after:	3 days
2014-09-26 07:01:27 +00:00
Xin LI e267e00eef Refactor the code a little bit to reduce duplicated code.
Reviewed by:	mjg
MFC after:	2 weeks
2014-09-26 05:05:34 +00:00
Sergey Kandaurov 663222b9f6 Fix description of mutex acquisition.
Reviewed by:	kib
X-MFC with:	r272070
Sponsored by:	Nginx, Inc.
2014-09-26 04:33:27 +00:00
Pedro F. Giffuni c1cd488caf Revert r272122
The patch still needs to be more robust and it broke the
build on MIPS so revert it for now while all the issues
are fixed.

Reported by:	ache, davide
PR:		137307
2014-09-25 23:04:37 +00:00
Xin LI 4b8740cd0a Explicitly set errno to 0 before calling strto*.
Suggested by:	mjg
MFC after:	2 weeks
2014-09-25 22:47:19 +00:00
Xin LI 9e4ed37219 The strtol(3) family of functions would set errno when it hits one.
Check errno and handle it as invalid input.

Obtained from:	HardenedBSD
Submitted by:	David CARLIER <devnexen@gmail.com>
MFC after:	2 weeks
2014-09-25 22:37:27 +00:00
Xin LI 97d15a9372 Use a char * as iterator over a bounded string.
MFC after:	1 week
2014-09-25 22:22:57 +00:00
Xin LI a6733ed126 Use strlcpy(). I don't believe these are real problems but it's better
to use a safe idiom.

Reported by:	Coverity
CID:		1238914
MFC after:	1 week
2014-09-25 22:22:54 +00:00
Xin LI a2cf0c3c61 Refactor the code a little bit to avoid NULL deference when
allocation was failed.

Reported by:	Coverity
CID:		1238915
MFC after:	1 week
2014-09-25 22:22:51 +00:00
Xin LI 0a8534f083 Plug a file descriptor leak.
Reported by:	Coverity
CID:		1238916
MFC after:	1 week
2014-09-25 22:22:48 +00:00
Xin LI be930504be Being able to access a path do not necessarily mean we have access
to a directory. So instead of doing this, we just call mkdir(2)
directly and test if the returned value is 0 or errno is EISDIR.

Reported by:	Coverity
CID:		1238925
MFC after:	1 week
2014-09-25 22:22:43 +00:00
Steve Kargl dde47d8bbc * Whitespace. 2014-09-25 22:15:10 +00:00
Warren Block 89d65d77e6 Revised to better point to release notes and errata, security advisories,
and be more specific about the -questions list.

MFC after:	3 days
2014-09-25 21:57:35 +00:00
Allan Jude 84907ef05c Update man(1) to list the different sections of the manual
Add each of the intro sections to the 'Also See' list

PR:		193460
Differential Revision:	D834
Approved by:	bcr (mentor)
Sponsored by:	ScaleEngine Inc.
2014-09-25 21:34:57 +00:00
Konstantin Belousov f69261f2f9 Fix fcntl(2) compat32 after r270691. The copyin and copyout of the
struct flock are done in the sys_fcntl(), which mean that compat32 used
direct access to userland pointers.

Move code from sys_fcntl() to new wrapper, kern_fcntl_freebsd(), which
performs neccessary userland memory accesses, and use it from both
native and compat32 fcntl syscalls.

Reported by:	jhibbits
Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
2014-09-25 21:07:19 +00:00
Konstantin Belousov 2c6fbcbed6 In kern_linkat() and kern_renameat(), do not call namei(9) while
holding a write reference on the filesystem.  Try to get write
reference in unblocked way after all vnodes are resolved; if failed,
drop all locks and retry after waiting for suspension end.

The VFS_UNMOUNT() methods for UFS and tmpfs try to establish
suspension on unmount, while covered vnode is locked by VFS, which
prevents namei() from stepping over the mount point.  The thread doing
namei() sleeps on the covered vnode lock, owning the write ref.

Reported by:	bdrewery
Tested by:	bdrewery (previous version), pho
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
2014-09-25 20:42:25 +00:00
John Baldwin 83e78a7f6e Merge the PC98 fdc(4) driver into the MI driver. While here, replace
the magic numbers used with NE7CMD_SPECIFY with invocations of the
NE7_SPEC_x() macros.

Approved by:	nyan
2014-09-25 20:40:24 +00:00
Pedro F. Giffuni 55a803b32a bsdgrep: Work-around for segmentation fault.
Fix by David Carlier.

Obtained from:	HardenedBSD
PR:		167921
MFC after:	1 month
2014-09-25 19:22:26 +00:00
Pedro F. Giffuni fd29269606 reiserfs: Use signed i_nlink
Unlike Linux, FreeBSD's kernel doesn't like unsigned file link
count. This is consistent with our ext2fs implementation.

MFC after:	1 month
2014-09-25 19:10:32 +00:00
Mark Johnston 540cc663b1 Factor out some of the duplicated code in the symbol lookup functions, in
preparation for adding userland CTF support to DTrace.

MFC after:	1 month
Sponsored by:	EMC / Isilon Storage Division
2014-09-25 19:08:06 +00:00
John Baldwin 43776a00e2 Use callout(9) instead of timeout(9).
Approved by:	nyan
2014-09-25 18:54:36 +00:00
John Baldwin 2b428a10da Use callout() instead of timeout(). This is almost identical to the
changes in r271963.

Approved by:	nyan
2014-09-25 18:53:27 +00:00
Pedro F. Giffuni ce1d331eee Add strptime(3) support for %U and %W
Add support for the missing POSIX-2001 %U and %W features: the
existing  FreeBSD strptime code recognizes both directives and
validates that the week number lies in the permitted range,
but then simply discards the value.

Initial support for the feature was written by Paul Green with
important fixes by Andrey Chernov. Additional support for
handling tm_wday/tm_yday was written by David Carlier.

PR:		137307
MFC after:	1 month
2014-09-25 18:52:17 +00:00
John Baldwin 9de2fdafa8 Lock ncr(4) and mark it MPSAFE along with various other fixes:
- Use bus_*() instead of bus_space_*().
- Use device_printf().
- Remove unused global variables and the extra warning suppression
  they required.
- Use callout() instead of timeout().

Reviewed by:	se
2014-09-25 18:43:52 +00:00
Ruslan Bukin 5d43fd685b Add driver for Synopsys DesignWare 3504-0 Universal 10/100/1000
Ethernet MAC.

Sponsored by:	DARPA, AFRL
2014-09-25 18:03:14 +00:00
Luigi Rizzo b3d3758852 fix a panic when passing ifioctl from a netmap file descriptor to
the underlying device. This needs to be merged to 10.1

Reported by: Patrick Kelsey
MFC after:	3 days
2014-09-25 16:22:32 +00:00
Luigi Rizzo 7f154b713a adapt the code to different freebsd versions.
Not necessary to MFC
2014-09-25 15:57:57 +00:00
Ian Lepore c47d4cde39 Replace multiple nearly-identical copies of code to walk through an FDT
node's interrupts=<...> property creating resource list entries with a
single common implementation.  This change makes ofw_bus_intr_to_rl() the
one true copy of that code and removes the copies of it from other places.

This also adds handling of the interrupts-extended property, which allows
specifying multiple interrupts for a node where each interrupt can have a
separate interrupt-parent.  The bindings for this state that the property
cells contain an xref phandle to the interrupt parent followed by whatever
interrupt info that parent normally expects.  This leads to having a
variable number of icells per interrupt in the property.  For example you
could have <&intc1 1 &intc2 26 9 0 &intc3 9 4>.

Differential Revision: https://reviews.freebsd.org/D803
2014-09-25 15:02:33 +00:00
Luigi Rizzo 89b95481b4 add missing file
Submitted by:	Daniel Peyrolon
MFC after:	3 days
2014-09-25 14:25:38 +00:00
Gavin Atkinson 425258e2de Cross reference cdce(4), ipheth(4) and urndis(4) from each other.
MFC after:	1 week
2014-09-25 14:22:32 +00:00
Gavin Atkinson 59d9081f35 Add basic man page for ipheth(4).
MFC after:	1 week
2014-09-25 14:18:34 +00:00
Ed Maste 7797431f9a Remove duplicated header content
I fail at patch(1).

MFC after:	3 days
2014-09-25 13:31:08 +00:00
Gavin Atkinson 265f42be76 Move the ARM Samsung s3c2xx0 support files into the samsung directory, to
match other platforms.

Discussed with:	andrew
2014-09-25 11:38:26 +00:00
Pawel Jakub Dawidek 19a5e7fede Document the new nvlist_get_parent() function.
Submitted by:	Mariusz Zaborski
2014-09-25 10:59:01 +00:00
Gleb Smirnoff 0d286aa4cb Provide vmxnet3_get_counter() to return counters that are not collected,
but taken from hardware.
2014-09-25 08:36:11 +00:00
Roger Pau Monné c98a2727cc ddb: allow specifying the exact address of the symtab and strtab
When the FreeBSD kernel is loaded from Xen the symtab and strtab are
not loaded the same way as the native boot loader. This patch adds
three new global variables to ddb that can be used to specify the
exact position and size of those tables, so they can be directly used
as parameters to db_add_symbol_table. A new helper is introduced, so callers
that used to set ksym_start and ksym_end can use this helper to set the new
variables.

It also adds support for loading them from the Xen PVH port, that was
previously missing those tables.

Sponsored by: Citrix Systems R&D
Reviewed by:	kib

ddb/db_main.c:
 - Add three new global variables: ksymtab, kstrtab, ksymtab_size that
   can be used to specify the position and size of the symtab and
   strtab.
 - Use those new variables in db_init in order to call db_add_symbol_table.
 - Move the logic in db_init to db_fetch_symtab in order to set ksymtab,
   kstrtab, ksymtab_size from ksym_start and ksym_end.

ddb/ddb.h:
 - Add prototype for db_fetch_ksymtab.
 - Declate the extern variables ksymtab, kstrtab and ksymtab_size.

x86/xen/pv.c:
 - Add support for finding the symtab and strtab when booted as a Xen
   PVH guest. Since Xen loads the symtab and strtab as NetBSD expects
   to find them we have to adapt and use the same method.

amd64/amd64/machdep.c:
arm/arm/machdep.c:
i386/i386/machdep.c:
mips/mips/machdep.c:
pc98/pc98/machdep.c:
powerpc/aim/machdep.c:
powerpc/booke/machdep.c:
sparc64/sparc64/machdep.c:
 - Use the newly introduced db_fetch_ksymtab in order to set ksymtab,
   kstrtab and ksymtab_size.
2014-09-25 08:28:10 +00:00
Gleb Smirnoff 5af6947046 - Provide bce_get_counter() to return counters that are not collected,
but taken from hardware.
- Mechanically convert to if_inc_counter() the rest of counters.
- While here fix 3 instances of the same bug, when error counter was ++
  in one place and then assigned in other place, losing the increment.
  Achieve that storing soft errors counters in softc.
2014-09-25 07:22:24 +00:00
Gleb Smirnoff d58a49d829 - Provide lmc_get_counter() to return counters that are not collected,
but taken from hardware.
- Mechanically convert to if_inc_counter() the rest of counters.
2014-09-25 07:00:31 +00:00
Gleb Smirnoff 8d864935b6 Run through unifdef(1) with slight hand-editing after. It is obvious,
that the driver is not going to be ever improved in terms of hardware
support, it is going to be only maintained as our kernel APIs change.
Carrying all the compatibility with ancient versions of NetBSD, OpenBSD,
Linux and BSDI, as well as obsoleted FreeBSD versions has no reason.
2014-09-25 06:47:38 +00:00
Gleb Smirnoff 56ec302f3c Whitespace cleanup. 2014-09-25 05:47:33 +00:00
Gleb Smirnoff f3f040d929 - Provide mxge_get_counter() to return counters that are not collected,
but taken from hardware.
- Mechanically convert to if_inc_counter() the rest of counters.
2014-09-25 05:45:52 +00:00
Sean Bruno 488c0a7ca8 Fix NULL pointer deref in ipfw when using dummynet at layer 2.
Drop packet if pkg->ifp is NULL, which is the case here.

ref. https://github.com/HardenedBSD/hardenedBSD
commit 4eef3881c64f6e3aa38eebbeaf27a947a5d47dd7

PR 193861 --  DUMMYNET LAYER2: kernel panic

in this case a kernel panic occurs. Hence, when we do not get an interface,
we just drop the packet in question.

PR:		193681
Submitted by:	David Carlier <david.carlier@hardenedbsd.org>
Obtained from:	Hardened BSD
MFC after:	2 weeks
Relnotes:	yes
2014-09-25 02:26:05 +00:00
Marcel Moolenaar 32e570e701 Add baseline files for QCOW2. 2014-09-24 22:58:10 +00:00
Enji Cooper 4ba73429a3 Increase the memory disk size in the following testcases to avoid mount
failures, which would cause cascade failures in the rest of the test
run:

link/15.t, open/19.t, mkdir/11.t, mkfifo/11.t, symlink/11.t

Fail quickly in all of the testcases if mdconfig, mount, umount, etc
fails to avoid issues similar to this in the future

Submitted by: Casey Peel <cpeel@isilon.com>
MFC after: 2 weeks
X-MFC with: r272057
Sponsored by: EMC / Isilon Storage Division
2014-09-24 22:51:16 +00:00
Marcel Moolenaar e187064261 Finish QCOW version 2 and stop making it conditional.
We have a different ordering for the RC block(s) and L2 tables.
This is expected to be a non-issue, because everything is found
through file offsets in the corresponding RC table and L1 table.
Files that grow organically have RC blocks and L2 tables scattered
all over the place anyway.

The reason for the difference is that mkimg needs to be able to
write to a pipe. We can't seek forward and backward to fill in
the bits in non-sequential order.
2014-09-24 22:45:03 +00:00
Julien Charbon cdcab7b62a Add myself (jch) to calendar.freebsd and committers-src.dot
Approved by:	jhb (mentor)
2014-09-24 22:31:40 +00:00