Commit Graph

9716 Commits

Author SHA1 Message Date
Allan Jude
ae5a522cae nvmecontrol: Display Metadata and Sanitize capabilities of the device
Determine if a device supports "Extended" or "Separate" metadata, and
what the current metadata setting is (None, Extended, Separate)

Also determine if the device supports:
  - Sanitize Crypto Erase
  - Sanitize Block Erase
  - Sanitize Overwrite

Reviewed by:	chuck
Sponsored by:	NetApp, Inc.
Sponsored by: 	Klara, Inc.
X-NetApp-PR:	#49
Differential Revision:	https://reviews.freebsd.org/D31067
2021-09-21 21:15:55 +00:00
Warner Losh
53cce2e744 camcontrol: depop command
Implement and document the new depop command. This command manages drive elements
for drives that support it. Storage elements are typically heads. Element status
can be discovered. Elements may be removed or restored. And the status of any
current depop operation can be assessed.

depop -d elm will remove element elm and truncate available capacity.
depop -l will list the current drive elements and their current status.
depop -r elm will try to restore all retired elements and rebuild capacity.

Changing storage elements may reinitialize the drive. This operation will lose
data and may take hours to complete. Use the drive provided timeout for
operations by default.

Reviewed by:		gbe (manpages)
Sponsored by:		Netflix
Differential Revision:	https://reviews.freebsd.org/D29018
2021-09-20 16:27:59 -06:00
Ka Ho Ng
3703c18883 md: Add MD_MUSTDEALLOC support
This adds an option to detect if hole-punching is implemented by the
underlying file system.  If this flag is set, and if the underlying file
system does not support hole-punching, md(4) fails BIO_DELETE requests
with EOPNOTSUPP.

Sponsored by:	The FreeBSD Foundation
Reviewed by:	markj
Differential Revision:	https://reviews.freebsd.org/D31883
2021-09-11 20:04:52 +08:00
Kristof Provost
0b95680e07 ipfw: Introduce dnctl
Introduce a link to the ipfw command, dnctl, for dummynet configuration.
dnctl only handles dummynet configuration, and is part of the effort to
support dummynet in pf.

/sbin/ipfw continues to accept pipe, queue and sched commands, but these can
now also be issued via the new dnctl command.

Reviewed by:	donner
MFC after:	2 weeks
Sponsored by:	Rubicon Communications, LLC ("Netgate")
Differential Revision:	https://reviews.freebsd.org/D30465
2021-09-08 17:17:50 +02:00
Emmanuel Vadot
0818f499bc pkgbase: Move spppcontrol to FreeBSD-ppp
This program belong with the other ppp-related programs.

Differential Revision:	 https://reviews.freebsd.org/D31792
Reviewed by: emaste
2021-09-07 10:18:53 +02:00
Emmanuel Vadot
d22072a7d5 pkgbase: Create a FreeBSD-ggate package
Move ggate* to it.

Differential Revision:	https://reviews.freebsd.org/D31790
2021-09-07 10:17:28 +02:00
Kristof Provost
846a6e8f9a pfctl: print counters in decimal
795d78a467 pfctl: Don't use PRIu64 mistakenly changed these to be
printed as hexadecimal numbers.

Reported by:	Florian Smeets
MFC after:	4 days
Sponsored by:	Rubicon Communications, LLC ("Netgate")
2021-09-04 16:07:59 +02:00
Kristof Provost
795d78a467 pfctl: Don't use PRIu64
Rather than PRIu64 we can just treat the data as uintmax_t, and use %jx
instead.

MFC after:	1 week
Suggested by:	kib
Sponsored by:	Rubicon Communications, LLC ("Netgate")
2021-09-02 09:35:36 +02:00
Mark Johnston
ed59446b47 mdconfig: Add a regression test for mediasize rounding
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
2021-08-31 15:50:09 -04:00
Dimitry Andric
5b8f07b12f Fix -Wformat errors in pfctl on 32-bit architectures
Use PRIu64 to printf(3) uint64_t quantities, otherwise this will result
in "error: format specifies type 'unsigned long' but the argument has
type 'uint64_t' (aka 'unsigned long long') [-Werror,-Wformat]" on 32-bit
architectures.

Fixes:		80078d9d38
MFC after:	1 week
2021-08-29 17:31:28 +02:00
Kristof Provost
80078d9d38 pfctl: use libpfctl to retrieve pf status
Rather than call DIOCGETSTATUS ourselves use the new libpfctl functions.

MFC after:	1 week
Sponsored by:	Modirum MDPay
Differential Revision:	https://reviews.freebsd.org/D31697
2021-08-29 14:59:38 +02:00
Gordon Bergling
b1603638e3 Fix a common typo in man pages and src comments
- s/desciptor/descriptor/

MFC after:	5 days
2021-08-28 19:24:27 +02:00
Gordon Tetlow
91a8bed5a4 Fix remote code execution in ggatec(8).
Approved by:    so
Security:       SA-21:14.ggatec
Security:       CVE-2021-29630
2021-08-24 11:26:45 -07:00
Kristof Provost
9ce320820e pfctl: build fix
Fix the build issue introduced in e59eff9ad3 (pfctl: fix killing states by ID)

MFC after:	1 week
Sponsored by:	Rubicon Communications, LLC ("Netgate")
2021-08-24 13:21:05 +02:00
Kristof Provost
e59eff9ad3 pfctl: fix killing states by ID
Since the conversion to the new DIOCKILLSTATESNV the kernel no longer
exists the id and creatorid to be big-endian.
As a result killing states by id (i.e. `pfctl -k id -k 12345`) no longer
worked.

Reported by:	Özkan KIRIK
MFC after:	1 week
Sponsored by:	Rubicon Communications, LLC ("Netgate")
2021-08-24 12:54:13 +02:00
Franco Fichtner
a313b5240a dhclient: skip_to_semi() consumes semicolon already
When invalid statement is found the next statement is skipped even if it
is valid.

Reviewed by:	markj
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D31527
2021-08-19 09:11:38 -04:00
Franco Fichtner
5851803f4b dhclient: remove patching of static values in BPF programs
Reviewed by:	markj
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D31502
2021-08-19 09:10:42 -04:00
Luiz Otavio O Souza
20ffd88ed5 ipfw: use unsigned int for dummynet bandwidth
This allows the maximum value of 4294967295 (~4Gb/s) instead of previous
value of 2147483647 (~2Gb/s).

Reviewed by:	np, scottl
Obtained from:	pfSense
MFC after:	1 week
Sponsored by:	Rubicon Communications, LLC ("Netgate")
Differential Revision:	https://reviews.freebsd.org/D31582
2021-08-19 10:48:53 +02:00
Fabian Kurtz
0a539a0f00 dhclient: support supersede statement for option 54
PR:		217978
Reported by:	Franco Fichtner <franco@opnsense.org>
Reviewed by:	markj
Obtained from:	OPNsense
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D31503
2021-08-18 10:15:28 -07:00
Gordon Bergling
0d71cea832 md5(1): Fix a typo in the manual page
- s/compatibilty/compatibility/

MFC after:	5 days
2021-08-14 14:48:39 +02:00
Eric van Gyzen
080c6fdc0c dumpon: fix build on some architectures
Fix a -Wsign-compare issue on some architectures.

Fixes:		96f9bd4654
Pointy hat to:	me
MFC after:	1 week
Sponsored by:	Dell EMC Isilon
2021-08-11 21:27:24 -05:00
Eric van Gyzen
96f9bd4654 dumpon: fix encrypted dumps after commit 372557d8c3
That commit moved key generation into a child process, including
a memory allocation referenced by a structure.  The child wrote
the structure to the parent over a pipe, but did not write the
referenced allocation.  The parent read the structure from the
child and used its pointer, which was bogus in the parent.

In the child, send both chunks of data to the parent.  In the
parent, make a corresponding allocation and read both chunks.

Fixes:		372557d8c3
Reviewed by:	bdrewery, markj
MFC after:	1 week
Sponsored by:	Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D31452
2021-08-11 10:54:56 -05:00
Gordon Bergling
1e1fbf3b47 iscontrol(8): Fix a typo in a struct
- s/suport/support/

MFC after:	5 days
2021-08-11 09:55:08 +02:00
Gordon Bergling
809ad8170a ipfw(8): Fix a typo in an error message
- s/suport/support/

MFC after:	5 days
2021-08-11 09:53:01 +02:00
Warner Losh
5dedd2517d devmatch: Ignore the pnp fields tagged as ignore ('#')
When matching entries, we should ignore those with a name of '#'. It's
the standard way to skip elements and need to be present to have the
proper offsets to the fields that are observed. No bus has a pnp
attribute of '#' and that is now disallowed for future buses that are
written.

Sponsored by:		Netflix
Reviewed by:		kbowling
Differential Revision:	https://reviews.freebsd.org/D31482
2021-08-10 15:47:55 -06:00
Emmanuel Vadot
e06b8f1128 pkgbase: Add nfsiod to the FreeBSD-nfs package
Missed in 081fb64492
2021-08-06 14:37:35 +02:00
Kornel Duleba
f5b29d0f35 etherswitch: Add a new striptagingress port flag
Felix switch found in LS1028A supports stripping VLAN tag on
ingress, instead of egress. The striptag flag excepts the latter
behaviour.
Add a new flag to support the feature.

Obtained from: Semihalf
Sponsored by: Alstom Group
Differential Revision: https://reviews.freebsd.org/D30922
2021-08-03 12:07:48 +02:00
Roy Marples
7045b1603b socket: Implement SO_RERROR
SO_RERROR indicates that receive buffer overflows should be handled as
errors. Historically receive buffer overflows have been ignored and
programs could not tell if they missed messages or messages had been
truncated because of overflows. Since programs historically do not
expect to get receive overflow errors, this behavior is not the
default.

This is really really important for programs that use route(4) to keep
in sync with the system. If we loose a message then we need to reload
the full system state, otherwise the behaviour from that point is
undefined and can lead to chasing bogus bug reports.

Reviewed by:	philip (network), kbowling (transport), gbe (manpages)
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D26652
2021-07-28 09:35:09 -07:00
Luiz Otavio O Souza
1e7fe2fbb9 bpf: Add an ioctl to set the VLAN Priority on packets sent by bpf
This allows the use of VLAN PCP in dhclient, which is required for
certain ISPs (such as Orange.fr).

Reviewed by:	bcr (man page)
MFC after:	1 week
Sponsored by:	Rubicon Communications, LLC ("Netgate")
Differential Revision:	https://reviews.freebsd.org/D31263
2021-07-26 23:13:31 +02:00
Bryan Drewery
accff08c2f dumpon: Fix unconfiguring netdump with "off" and "/dev/null".
Netdump has its own configuration tracking such that
ioctl(/dev/null, DIOCSKERNELDUMP) does a dumper_remove() but does not
notify netdump about the removal. Simply sending the same ioctl to
/dev/netdump handles the situation.

Reviewed by:	markj, cem
Sponsored by:	Dell EMC
Differential Revision:	https://reviews.freebsd.org/D31300
2021-07-26 13:08:59 -07:00
Bryan Drewery
372557d8c3 dumpon: Fix -v causing error when configuring an encrypted dump
If -v is specified when adding a new device then a full listing of
configured devices is displayed.  This requires sysctl access which
genkey()'s use of capability mode was blocking permission to access.
This leads to both confusing console spam but also incorrectly returning
an error status even if no other had been encountered.

	dumpon: Sysctl get 'kern.shutdown.dumpdevname': Operation not permitted

Fix this by generating the key in a child process.

Reviewed by:	markj
Sponsored by:	Dell EMC
Differential Revision: https://reviews.freebsd.org/D31266
2021-07-26 13:08:59 -07:00
Kyle Evans
4d15976919 init: execute /etc/rc.final after all user processes have terminated
This can be useful for, e.g., unmounting filesystems that were needed
for shutdown.

Reviewed by:	kib
Sponsored by:	NetApp, Inc.
Sponsored by:	Klara, Inc.
X-NetApp-PR:	#63
Differential Revision:	https://reviews.freebsd.org/D31230
2021-07-22 23:26:11 -05:00
Kristof Provost
c69121c473 pfctl: syncookie configuration
pfctl and libpfctl code required to enable/disable the syncookie
feature.

MFC after:	1 week
Sponsored by:	Modirum MDPay
Differential Revision:	https://reviews.freebsd.org/D31140
2021-07-20 10:36:14 +02:00
Kristof Provost
ef950daa35 pf: match keyword support
Support the 'match' keyword.
Note that support is limited to adding queuing information, so without
ALTQ support in the kernel setting match rules is pointless.

For the avoidance of doubt: this is NOT full support for the match
keyword as found in OpenBSD's pf. That could potentially be built on top
of this, but this commit is NOT that.

MFC after:	2 weeks
Sponsored by:	Rubicon Communications, LLC ("Netgate")
Differential Revision:	https://reviews.freebsd.org/D31115
2021-07-17 12:01:08 +02:00
Warner Losh
a535413556 devd: remove pccard entries
The pccard entries are now obsolete, remove them.

Sponsored by:		Netflix
Differential Revision:	https://reviews.freebsd.org/D31184
2021-07-15 16:17:33 -06:00
Alexander Motin
d1a0eab9fb Partially revert previous commit.
ns identify does not allow nsid of 0xffffffff.  Only general identify
allows it.

MFC after:	1 week
2021-07-14 15:46:22 -04:00
Alexander Motin
dbf1dce8d6 For ns identify/delete allow nsid of 0xffffffff.
The first should report common parameters, the second should delete
all namespaces.

MFC after:	1 week
2021-07-14 15:05:56 -04:00
Alexander Motin
d379886a41 Filter out LBA formats with LBA Data Size of 0.
According to the spec: "If the value reported is 0h, then LBA format
is not supported / used or is not currently available".

MFC after:	1 week
2021-07-14 14:05:20 -04:00
Jessica Clarke
8b487b8292 Fix bsd.subdir.mk-related issues after 0a0f748641
Since bsd.prog.mk includes bsd.obj.mk, and thus bsd.subdir.mk, we must
ensure all our bsd.subdir.mk-affecting variables are set before
including bsd.prog.mk. Since sbin's various Makefile.arch files add to
SUBDIR this results in those not taking effect, and presumably we also
end up not having buildworld as parallel as it should be due to the fact
that SUBDIR_PARALLEL was not being set before including bsd.prog.mk.

MFC with:	0a0f748641
Reviewed by:	olivier
Differential Revision:	https://reviews.freebsd.org/D31125
2021-07-12 20:54:01 +01:00
Robert Wing
0c5a59252c fsck_ffs: fix background fsck in preen mode
Background checks are only allowed for mounted filesystems - don't try
to open the device for writing when performing a background check.

While here, remove a debugging printf that's commented out.

PR:             256746
Fixes:          5cc52631b3
Reviewed by:	mckusick
MFC After:      1 week
Differential Revision:	https://reviews.freebsd.org/D30880
2021-07-11 12:47:27 -08:00
Rick Macklem
4488c8c34b mount_nfs.8: Add information for "nconnect" to man page
Commit 1e0a518d65 added a new NFS mount option "nconnect".
This patch adds information on this option to the man page.

It also adds an IMPLEMENTATION section that explains how
the default I/O size is determined and that "nfsstat -m" can
be used to find out what option settings are actually in use.

This is a content change.

Reviewed by:	gbe (manpages)
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D31135
2021-07-11 13:34:16 -07:00
Warner Losh
445b5554bf nvmecontrol: document power command
The description of the power command is missing. While the synopsis is
present, there's no explanation. Add one.

Reviewed by:		mav, chuck
PR:			237866
Sponsored by:		Netflix
Differential Revision:	https://reviews.freebsd.org/D31122
2021-07-10 10:53:34 -06:00
Mateusz Guzik
1e67e3109d setkey: drop an unused argument from postproc 2021-07-08 14:00:55 +00:00
Mateusz Guzik
b29817874d setkey: fix several warnings popping up when compiling without WARNS=1 2021-07-08 14:00:55 +00:00
Mateusz Guzik
e0c0612d9b setkey: ansify 2021-07-08 14:00:55 +00:00
Alan Somers
3874c0abb0 [skip ci] correct a few SPDX license tags
These were all incorrectly labeled as 2-clause BSD licenses by a
semi-automated process, when in fact they are 3-clause.

Discussed with:	pfg, imp
MFC after:	2 weeks
Sponsored by:	Axcient
2021-07-07 13:52:20 -06:00
Julien Grall
2b2c460d7b etc/ttys: add xen console
Xen VMs get a simulated serial device meant for use as a console.  Often
an xterm or other advanced terminal is used, so use xterm as the type.

Depending on configuration, FreeBSD on Xen for amd64 may instead use an
emulated serial port, but the virtual console may also be available.

Submitted by:	Elliott Mitchell <ehem+freebsd@m5p.com>
Reviewed by:	imp (slightly earlier version)
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D29873
2021-07-06 11:53:10 -03:00
Elliott Mitchell
c76616f496 etc/ttys: merge ttys file down to single file
The tty lists were already pretty similar and there hadn't been any real
need for them to remain distinct for some time. As such, merge to a
single file.

The RISC-V console is preserved. For systems where it doesn't exist, its
presence in /etc/ttys is harmless. The uncommented version of the
ttyv8/XDM line from ttys.amd64 was the one chosen.

Reviewed by:	imp
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D30256
2021-07-06 11:53:10 -03:00
Robert Wing
dc35484536 dumpfs(8): add option to only print superblock information
Add an option to dumpfs, `-s`, that only prints the super block information.

Reviewed by:	chs, imp
Differential Revision:	https://reviews.freebsd.org/D30881
2021-07-02 14:18:17 -08:00
Mateusz Guzik
858937bea4 pfctl: cache getprotobynumber results
As for example pfctl -ss keeps calling it, it saves a lot of overhead
from elided parsing of /etc/nsswitch.conf and /etc/protocols.

Sample result when running a pre-nvlist binary with nfs root and dumping
7 mln states:
before: 24.817u 62.993s 1:28.52 99.1%
after:	8.064u 1.117s 0:18.87 48.5%

Idea by Jim Thompson

Reviewed by:	kp
Sponsored by:	Rubicon Communications, LLC ("Netgate")
2021-07-01 21:31:45 +00:00