Commit Graph

226412 Commits

Author SHA1 Message Date
Kyle Evans
7b9f317cf3 hexdump: Remove expected test failures for now succeeding tests
r323990 fixed the -s flag breakage reported by PR 219173. Mark the
corresponding hexdump tests accordingly, since they should now both succeed.

PR:		222781
Reported by:	ngie
Reviewed by:	emaste, ngie
Approved by:	emaste (mentor)
Differential Revision:	https://reviews.freebsd.org/D12590
2017-10-04 18:11:00 +00:00
Mark Johnston
bf4e2e5be1 Add get_random_{int,long} to the LinuxKPI.
Fix some whitespace bugs while here.

Reviewed by:	hselasky
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D12588
2017-10-04 17:29:08 +00:00
Alan Somers
27f0f2ec5f Display rotation rate and TRIM/UNMAP support in diskinfo(8)
Bump __FreeBSD_version due to the expansion of struct diocgattr_arg.

Reviewed by:	mav, allanjude, imp
MFC after:	3 weeks
Relnotes:	yes
Sponsored by:	Spectra Logic Corp
Differential Revision:	https://reviews.freebsd.org/D12578
2017-10-04 15:09:49 +00:00
Warner Losh
6043585892 'private' isn't a PNP string field, so instead used the reserved '#'
name for this field (it might even be possible to just drop it
entirely, since it will be ignored either way).

Sponsored by: Netflix
2017-10-04 14:41:45 +00:00
Ed Maste
49ccd3fe61 arch.7: correct statement about time_t size
After r320347 it is 64-bit on every architecture except i386.

Sponsored by:	The FreeBSD Foundation
2017-10-04 14:39:55 +00:00
Hans Petter Selasky
87a567f181 Make sure the timer belonging to the delayed work in the LinuxKPI
gets drained before invoking the work function. Else the timer
mutex may still be in use which can lead to use-after-free situations,
because the work function might free the work structure before returning.

MFC after:	1 week
Sponsored by:	Mellanox Technologies
2017-10-04 13:13:38 +00:00
Benjamin Kaduk
75ea0b7697 mdoc style: start new sentence on new line 2017-10-04 12:58:30 +00:00
Edward Tomasz Napierala
b73e1f746a Don't destroy gmountver(8) devices on shutdown, unless they are orphaned.
Otherwise we would fail to sync the filesystem on reboot.

MFC after:	2 weeks
Sponsored by:	DARPA, AFRL
2017-10-04 12:25:39 +00:00
Edward Tomasz Napierala
253f5a2edb Make md(4) support GEOM::ident for vnode-backed disks. It's based
on backing file device and inode numbers.

This is useful for gmountver(8) regression tests.

MFC after:	2 weeks
Sponsored by:	DARPA, AFRL
Differential Revision:	https://reviews.freebsd.org/D12230
2017-10-04 12:23:34 +00:00
Edward Tomasz Napierala
5b4bc31eee Fix iSCSI target panics on concurrent session teardown and display
(eg removing a target and doing "ctladm islist -v" at the same time).

Reviewed by:	manu
Tested by:	manu
MFC after:	2 weeks
Sponsored by:	DARPA, AFRL
2017-10-04 11:35:04 +00:00
Cy Schubert
9eba44bf46 Fix typo.
Reported by:	se
2017-10-04 09:54:59 +00:00
Cy Schubert
82ef8ce5a6 Fix typo. 2017-10-04 09:54:55 +00:00
Emmanuel Vadot
1da3e8b097 mountd: Convert mountlist to SLIST
Use SLIST from sys/queue.h instead of homebrew linked list for mountlist.

Reviewed by:	bapt, rmacklem
MFC after:	1 week
Sponsored by:	Gandi.net
Differential Revision:	https://reviews.freebsd.org/D12504
2017-10-04 08:48:05 +00:00
Emmanuel Vadot
c9ac0f714c mountd: Convert exportlist to SLIST
Use SLIST from sys/queue.h instead of homebrew linked list for the exportlist.

Reviewed by:	bapt, rmacklem
MFC after:	1 week
Sponsored by:	Gandi.net
Differential Revision:	https://reviews.freebsd.org/D12502
2017-10-04 08:43:56 +00:00
Cy Schubert
b1b1386ff4 Clarify the wording describing the stayopen flag.
MFC after:	1 week
2017-10-04 06:06:22 +00:00
Cy Schubert
0c059da3e1 When building multiple kernels using KERNCONF, non-existent KERNCONF
files will produce an error and buildkernel will fail. Previously missing
KERNCONF files silently failed giving no indication as to why, only to
subsequently discover during installkernel that the desired kernel was
never built in the first place.

This is a rework of r302865.

This is the correct patch.

Reviewed by:	ngie (previous version, r302865)
MFC after:	2 months
Differential Revision:	D7167
2017-10-04 03:39:54 +00:00
Cy Schubert
84f54c4fd7 Revert r324246. This is not exactly what was intended. 2017-10-04 03:35:23 +00:00
Cy Schubert
74e0e295e4 When building multiple kernels using KERNCONF, non-existent KERNCONF
files will produce an error and buildkernel will fail. Previously missing
KERNCONF files silently failed giving no indication as to why, only to
subsequently discover during installkernel that the desired kernel was
never built in the first place.

This is a rework of r302865.

Reviewed by:	ngie (previous version, r302865)
MFC after:	2 months
Differential Revision:	D7167
2017-10-04 03:24:16 +00:00
Conrad Meyer
3cd1f90972 chpass(1): Check crypt(3) return and handle error appropriately
This change is spiritually similar to the earlier r231994.

PR:		222756
Submitted by:	Lubos Boucek <bouceklubos AT gmail.com>
Obtained from:	DragonflyBSD 2020c8fec4168a5020f984a093224fade3074b25
2017-10-04 01:12:26 +00:00
Brooks Davis
5e12225140 Remove an unneeded and incorrect memset().
On Variant I TLS architectures (aarch64, arm, mips, powerpc, and riscv)
the __libc_allocate_tls function allocates thread local storage memory
with calloc(). It then copies initialization data over the portions with
non-zero initial values. Before this change it would then pointlessly
zero the already zeroed remainder of the storage. Unfortunately the
calculation was wrong and it would zero TLS_TCB_SIZE (2*sizeof(void *))
additional bytes.

In practice, this overflow only matters if the TLS segment is sized such
that calloc() allocates a less than TLS_TCB_SIZE extra memory. Even
then, the likely result will be zeroing part of the next bucket. This
coupled with the impact being confined to Tier II platforms means there
will be no security advisory for this issue.

Reviewed by:	kib, dfr
Discussed with:	security-officer (delphij)
MFC after:	1 week
Found by:	CHERI
Sponsored by:	DARPA, AFRL
Differential Revision:	https://reviews.freebsd.org/D12547
2017-10-03 22:57:19 +00:00
Alan Somers
780dc32b31 Fix copy/paste error in diskinfo.8 from r320555
MFC after:	1 week
Sponsored by:	Spectra Logic Corp
2017-10-03 17:00:01 +00:00
Maxim Konovalov
5a64575e73 o FreeBSD 10.4 happened after 11.1, adjust the branches accordingly.
o The current FreeBSD branch is 12 not 13.

Suggested by:	lidl
2017-10-03 14:23:49 +00:00
Maxim Konovalov
fff2980dad FreeBSD 10.4 release added. 2017-10-03 13:31:22 +00:00
Edward Tomasz Napierala
3cfa7c6e48 Make procstat(1) recognize process descriptors, so that it shows
"P" instead of "?" in "procstat -af" output. Note that there are
still a few more DTYPE_* kinds we don't decode yet.

Reported by:	rwatson
MFC after:	2 weeks
Sponsored by:	DARPA, AFRL
Differential Revision:	https://reviews.freebsd.org/D12426
2017-10-03 11:45:24 +00:00
Ruslan Ermilov
a470b2750f Fixed description of msg_name/msg_namelen in recvmsg(). 2017-10-03 11:13:25 +00:00
Conrad Meyer
2c9a33f557 Correct sense of crypt(3) NULL checks in init(8) and lock(1)
In r231994, an attempt was made to fix crypt(3) failure returns (NULL).
However, instead of treating crypt(3) failure as authentication failure,
some of the changes treated crypt(3) failure as authentication success.
This is wrong.

r324225 fixed this for ppp, which also inspired this review.  The other
changes in the 231994 revision were audited for correctness and look ok.

Reviewed by:	jhb
Security:	yes
Sponsored by:	Dell EMC Isilon
Differential Revision:	https://reviews.freebsd.org/D12571
2017-10-03 00:53:11 +00:00
John Baldwin
61d53d8fce Flesh out pathconf() on UDF.
- Return 64 bits for _PC_FILESIZEBITS.
- Handle _PC_SYMLINK_MAX.
- Defer _PC_PATH_MAX to vop_stdpathconf().

Sponsored by:	Chelsio Communications
2017-10-02 23:31:11 +00:00
Gleb Smirnoff
0e229f343f Hide struct socket and struct unpcb from the userland.
Violators may define _WANT_SOCKET and _WANT_UNPCB respectively and
are not guaranteed for stability of the structures.  The violators
list is the the usual one: libprocstat(3) and netstat(1) internally
and lsof in ports.

In struct xunpcb remove the inclusion of kernel structure and add
a bunch of spare fields.  The xsocket already has socket not included,
but add there spares as well.  Embed xsockbuf into xsocket.

Sort declarations in sys/socketvar.h to separate kernel only from
userland available ones.

PR:		221820 (exp-run)
2017-10-02 23:29:56 +00:00
John Baldwin
9d1d1d1900 Return 64 for pathconf(_PC_FILESIZEBITS) on tmpfs.
Sponsored by:	Chelsio Communications
2017-10-02 23:23:12 +00:00
Conrad Meyer
af3b49ef41 ppp(8): Fix various bugs in NOPAM section of auth_CheckPasswd
* pw is not initialized before use
* success is returned if crypt(3) errors

These bugs were introduced in r231994, which attempted to adopt DragonflyBSD
f4a9869feb646aafe72de6e5d61051a023a02676.  The original author of the
Dragonfly change also noticed these mistakes and filed the PR.

PR:		222620
Submitted by:	Lubos Boucek <bouceklubos AT gmail.com>
Obtained from:	DragonflyBSD f4a9869feb646aafe72de6e5d61051a023a02676
2017-10-02 23:14:29 +00:00
John Baldwin
eb3d4ccc48 Handle _PC_FILESIZEBITS and _PC_SYMLINK_MAX pathconf() requests in cd9660.
cd9660 only supports symlinks with Rock Ridge extensions, so
_PC_SYMLINK_MAX is conditional on Rock Ridge.

Sponsored by:	Chelsio Communications
2017-10-02 23:12:02 +00:00
Alan Somers
d22f655459 MFV r319743: 8108 zdb -l fails to read labels 2 and 3
illumos/illumos-gate@22c8b9583d
22c8b9583d

https://www.illumos.org/issues/8108

Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Reviewed by: Toomas Soome <tsoome@me.com>
Reviewed by: Igor Kozhukhov <igor@dilos.org>
Reviewed by: Andrew Stormont <andyjstormont@gmail.com>
Approved by: Robert Mustacchi <rm@joyent.com>
Author: Yuri Pankov <yuri.pankov@nexenta.com>

MFC after:	3 weeks
2017-10-02 22:39:12 +00:00
Alan Somers
58dde1c585 MFV r316863: 3871 fix issues introduced by 3604
illumos/illumos-gate@de05b58863
de05b58863

https://www.illumos.org/issues/3871
  GCC 4.5.3 on Gentoo Linux did not like a few of the changes made in the issue
  3604 patch. It printed an error and a couple of warnings:
  ../../cmd/zdb/zdb.c: In function 'dump_bpobj':
  ../../cmd/zdb/zdb.c:1257:3: error: 'for' loop initial declarations are only
  allowed in C99 mode
  ../../cmd/zdb/zdb.c:1257:3: note: use option -std=c99 or -std=gnu99 to compile
  your code
  ../../cmd/zdb/zdb.c: In function 'dump_deadlist':
  ../../cmd/zdb/zdb.c:1323:8: warning: too many arguments for format
  ../../cmd/zdb/zdb.c:1323:8: warning: too many arguments for format

Reviewed by: Paul Dagnelie <pcd@delphix.com>
Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Reviewed by: Serapheim Dimitropoulos <serapheim@delphix.com>
Approved by: Dan McDonald <danmcd@omniti.com>
Author: Richard Yao <ryao@gentoo.org>

MFC after:	3 weeks
2017-10-02 22:35:35 +00:00
Alan Somers
2091d1c3b9 MFV r316861: 6866 zdb -l should return non-zero if it fails to find any label
illumos/illumos-gate@64723e3611
64723e3611

https://www.illumos.org/issues/6866
  Need this for #6865.
  To be generally more scripting-friendly, overload this issue with adding '-q'
  option which should skip printing any label information.

Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Reviewed by: John Kennedy <john.kennedy@delphix.com>
Approved by: Robert Mustacchi <rm@joyent.com>
Author: Yuri Pankov <yuri.pankov@nexenta.com>

MFC after:	3 weeks
2017-10-02 22:13:20 +00:00
Alan Somers
66eafdf052 MFC r316858 7280 Allow changing global libzpool variables in zdb
7280 Allow changing global libzpool variables in zdb and ztest through command line

illumos/illumos-gate@0e60744c98
0e60744c98

https://www.illumos.org/issues/7280
  zdb is very handy for diagnosing problems with a pool in a safe and
  quick way. When a pool is in a bad shape, we often want to disable some
  fail-safes, or adjust some tunables in order to open them. In the
  kernel, this is done by changing public variables in mdb. The goal of
  this feature is to add the same capability to zdb and ztest, so that
  they can change libzpool tuneables from the command line.

Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Reviewed by: Dan Kimmel <dan.kimmel@delphix.com>
Approved by: Robert Mustacchi <rm@joyent.com>
Author: Pavel Zakharov <pavel.zakharov@delphix.com>

MFC after:	3 weeks
2017-10-02 22:02:04 +00:00
Michael Zhilin
37a6f46190 [libthr] revert change of visibility of _thread_keytable to unbreak debugger
Fix regression by r318539. The sysutils/pstack uses library libthread_db to
read information about threads state. The function pt_ta_new makes lookup of
several key symbols including _thread_keytable. But r318539 mades this field
static. It causes silent ignore of libthr library by pstack and as result
sysutils/pstack doesn't output any thread information.

This fix changes this field back to non-static.

MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D11738
2017-10-02 20:33:16 +00:00
Michael Tuexen
ab1d48801b Whitespace changes: Remove leading spaces followed by a tab. 2017-10-02 20:02:25 +00:00
Emmanuel Vadot
d3609450aa Allwinner H3 CCU: Fix build on ARM64
ccu_h3.c is also used on ARM64 as it provides clocks for the H5 SoC.
Since ARM64 doesn't have sys/gun/dts/include in it's include path, use
the full name for the sun8i-h3-ccu.h include.

Reported by:	andreast
2017-10-02 19:17:09 +00:00
Michael Tuexen
945906384d Fix a bug which avoided that rules for matching port numbers for SCTP
packets where actually matched.
While there, make clean in the man-page that SCTP port numbers are
supported in rules.

MFC after:	1 month
2017-10-02 18:25:30 +00:00
Emmanuel Vadot
7bc85edd15 Allwinner GPIO: Fail if we cannot enable a clock
If we cannot enable a clock (which is required to have the device
working), do not attach the device as it will not work.
2017-10-02 17:20:07 +00:00
Emmanuel Vadot
4168a6e9f1 Allwinner: Remove a10_gpio.h
a10_gpio.h isn't used since a long time, remove it from the tree.
2017-10-02 16:39:12 +00:00
Eugene Grosbein
8942852cbc rsh: introduce new option -N disabling shutdown of socket sending path.
This prevents premature disconnection of rsh session with protocol
implementation confused by "end-of-file" condition for standard
input stream. For example, modern Cisco IOS (15.x) versions
can be managed with "rsh -N" cron jobs having /dev/null as stdin.

PR:		205144
Approved by:	avg (mentor)
MFC after:	1 week
2017-10-02 16:33:04 +00:00
Emmanuel Vadot
d8ffc6fb25 Allwinner A31 ccu: Use clock/reset IDs from dt-bindings
Do not redefines resets and clocks ID which are already in the
dt-bindings include directory. Those files are under dual licenced
under GPL2/MIT so use them directly.
2017-10-02 16:21:20 +00:00
Emmanuel Vadot
f5bb8f4aaf Allwinner A64 ccu: Use clock/reset IDs from dt-bindings
Do not redefines resets and clocks ID which are already in the
dt-bindings include directory. Those files are under dual licenced
under GPL2/MIT so use them directly.
2017-10-02 16:12:06 +00:00
Glen Barber
54a13912f6 Bump armv6 SoC images to 2.25GB. RPI-B is full, so increase all
image sizes for consistency.

Submitted by:	manu
Sponsored by:	The FreeBSD Foundation
2017-10-02 15:56:45 +00:00
Emmanuel Vadot
5aefde1fa8 Allwinner H3 ccu: Use clock/reset IDs from dt-bindings
Do not redefines resets and clocks ID which are already in the
dt-bindings include directory. Those files are under dual licence
GPL2/MIT so use them directly.
2017-10-02 15:48:39 +00:00
Andrew Turner
5cf1f313c4 Add a memory barrier to ensure the atomic write is visible to the other
CPUs before waking them up.

Sponsored by:	DARPA, AFRL
2017-10-02 14:22:35 +00:00
Allan Jude
f78bd12d6d bsdinstall(8) hardening menu: Utilize new kern.randompid=1 behaviour
Enabling the PID randomization option in bsdinstall(8)'s hardening menu
now randomizes the effective value of kern.randompid on each boot.

Previous behaviour:
When kern.randompid was enabled via the the bsdinstall(8) hardening menu,
a random value was generated and placed in the systems /etc/sysctl.conf as
kern.randompid=value
This makes the value of kern.randompid static across reboots.

New behaviour:
When kern.randompid is enabled via the bsdinstall(8) hardening menu, the
line kern.randompid=1 is placed in the systems /etc/sysctl.conf.
This takes advantage of a new kernel feature and makes the value of
kern.randompid be randomized by the kernel on each reboot.

Submitted by:	Marie Helene Kvello-Aune <marieheleneka@gmail.com>
Reviewed by:	des
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D12433
2017-10-02 14:19:31 +00:00
Hans Petter Selasky
e5d6b589ce Make sure the doorbell lock is valid for the i386 version
of the mlx5en(4) driver.

Tested by:		gallatin @
MFC after:		1 week
Sponsored by:		Mellanox Technologies
2017-10-02 12:20:55 +00:00
Hans Petter Selasky
62afbce910 Setup mbuf hash type properly when receiving IP packets in the mlx4en(4) driver.
Submitted by:		sephe@
Differential Revision:	https://reviews.freebsd.org/D12229
MFC after:		1 week
Sponsored by:		Mellanox Technologies
2017-10-02 12:11:43 +00:00