Commit Graph

271982 Commits

Author SHA1 Message Date
Andriy Gapon
1abf1e8c6b cam_get_device: resolve path links before parsing device name
The CAM subsystem uses bus:taget:lun tuple to address peripherals.  But
for convenience many userland programs such as camcontrol accept devices
names such as da0.  There is a libcam function, cam_open_device, to
support that.  It first calls cam_get_device() to parse the device name
as a driver name and a unit (and handle some special device name
prefixes) and then uses cam_lookup_pass() to find a matching pass
device.

This change extends cam_get_device() to apply realpath(3) to the device
name before parsing it.  This will allow to use tools such as camcontrol
and smartctl with symbolic links that could be friendlier (more
distinguished) names for devices.

MFC after:	3 weeks
Relnotes:	maybe
2022-01-26 11:25:31 +02:00
Andriy Gapon
94ff1d9cc8 sdhci: fix dumping support in MMCCAM configuration
This change fixes interaction with recently added sddadump.

MFC after:	1 week
2022-01-26 09:31:45 +02:00
Warner Losh
e35816c1c9 mpr/mps: Fix a race in diagnostic reset
There's a small race in freezing the simq when performing a diagnostic
reset. During this time, a transaction can slip through and encounter
the target id of 0. If we're still in diagnostic reset when we detect
this, return a CAM_DEVICE_NOT_THERE status. Instead, freeze the queue
and return a requeue status, similar to what we do when we're resetting
a target and a transaction get here. The race is unavoidable due to
separate locks for queue and SIM, but easy enough to detect and make
harmless.

Sponsored by:		Netflix
Reviewed by:		scottl, mav
Differential Revision:	https://reviews.freebsd.org/D34017
2022-01-25 19:15:46 -07:00
John Baldwin
5fcb5ae8dc Remove a stale comment.
The intr_disable as a macro was only a problem on arm and mips and
is no longer relevant after the mips removal.
2022-01-25 17:19:36 -08:00
John Baldwin
46f69eba96 opencrypto/xform_*.h: Trim scope of included headers.
Reviewed by:	markj, emaste
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D34022
2022-01-25 15:21:22 -08:00
John Baldwin
f6459a7aa8 opencrypto/cryptodev.h: Add includes to make more self-contained.
Reviewed by:	markj, emaste
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D34021
2022-01-25 15:20:46 -08:00
Jessica Clarke
d930ec4ff9 dp83822phy: Add missing MII_PHY_END to avoid buffer overread on probe
Found by:	CHERI
Fixes:		0c9156faec ("Introduce DP83822 PHY driver")
2022-01-25 20:34:55 +00:00
Jessica Clarke
3f707064a5 dp83867phy: Add missing MII_PHY_END to avoid buffer overread on attach
Found by:	CHERI
Fixes:		e85c94b8d6 ("Introduce DP83867 PHY driver")
2022-01-25 20:34:55 +00:00
John Baldwin
8de1a8131e libthr: Use TLS_TCB_* in _tcb_[cd]tor.
This matches libc and rtld in using the alignment (TLS_TCB_ALIGN) from
machine/tls.h instead of hardcoding 16.

Reviewed by:	kib
Sponsored by:	The University of Cambridge, Google Inc.
Differential Revision:	https://reviews.freebsd.org/D34023
2022-01-25 11:38:34 -08:00
John Baldwin
42e51b158a Stop trying to strip 'eb' suffixes from ARM MACHINE_ARCH.
armeb is no longer a supported MACHINE_ARCH.

Reviewed by:	imp, emaste
Sponsored by:	The University of Cambridge, Google Inc.
Differential Revision:	https://reviews.freebsd.org/D34019
2022-01-25 11:37:29 -08:00
John Baldwin
0a902e4261 Stop trimming 'hf' suffixes from MACHINE_ARCH.
This was only used for MIPS hard-float architectures.

Reviewed by:	imp
Sponsored by:	The University of Cambridge, Google Inc.
Differential Revision:	https://reviews.freebsd.org/D34018
2022-01-25 11:31:17 -08:00
Wolfram Schneider
ccf50c1df9 locate statistics: non zero exit on corrupt database 2022-01-25 16:55:58 +00:00
Robert Wing
08cb63a12f bhyve/block_if: allow DIOCGMEDIASIZE ioctl
This is needed to get mediasize of the device after a resize event.

I missed this earlier as I was building WITH_BHYVE_SNAPSHOT, which
disables capsicum.

Reviewed by:	khng, markj
Fixes: ae9ea22e14 ("bhyve: get mediasize for character devices when ...")
Differential Revision:	https://reviews.freebsd.org/D34013
2022-01-25 07:44:13 -09:00
Wolfram Schneider
b7a74bbc41 stop on error and display the statstics anyway
PR:		32686
2022-01-25 15:59:41 +00:00
Konstantin Belousov
86a16ada1e __sflush(): on write error, if nothing was written, reset FILE state back
otherwise the data is just dropped.  Check for current position equal to
the buffer base at the entry of the function; if not equal, setvbuf()
was done from the write method and it is not our business to override
the decision.

PR:	76398
Reviewed by:	markj
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D34007
2022-01-25 17:26:05 +02:00
Emmanuel Vadot
59d465e200 Bump __FreeBSD_version for LinuxKPI changes
Sponsored by:	Beckhoff Automation GmbH & Co. KG
2022-01-25 16:15:46 +01:00
Emmanuel Vadot
1961a14a47 linuxkpi: Add i2c support
Add i2c support to linuxkpi. This is needed by drm-kmod.
For every i2c_adapter added by i2c_add_adapter we add a child to the
device named "lkpi_iic". This child handle the conversion between
Linux i2c_msgs to FreeBSD iic_msgs.
For every i2c_adapter added by i2c_bit_add_bus we add a child to the
device named "lkpi_iicbb". This child handle the conversion between
Linux i2c_msgs to FreeBSD iic_msgs.
With the help of iic(4), this expose the i2c controller to userspace
allowing a user to query DDC information from a monitor.
e.g.: i2c -f /dev/iic0 -a 0x28 -c 128 -d r
will query the standard EDID from the monitor if plugged.

The bitbang part (lkpi_iicbb) isn't tested at all for now as I don't have
compatible hardware (all my hardware have native i2c controller).

Tested on:	Intel (SandyBridge, Skylake, ApolloLake)
Tested on:	AMD (Picasso, Polaris (amd64 and arm64))

MFC after:	1 month
Reviewed by:	hselasky
Sponsored by:	Beckhoff Automation GmbH & Co. KG
Differential Revision:	https://reviews.freebsd.org/D33053
2022-01-25 16:15:39 +01:00
Edward Tomasz Napierala
9caeb82eab Revert "linux: Provide dummy seccomp(2)"
This reverts commit 56981629f9.

Wrong patch; fails to build on i386.
2022-01-20 22:25:15 +00:00
Edward Tomasz Napierala
56981629f9 linux: Provide dummy seccomp(2)
Don't emit warnings; this isn't any different from a Linux kernel
built without OPTIONS_SECCOMP, so the userspace already needs to know
how to deal with it.  This is also similar with how we handle seccomp
in linux_prctl().

Sponsored By:	EPSRC
Differential Revision: https://reviews.freebsd.org/D33808
2022-01-25 11:54:00 +00:00
Baptiste Daroussin
389844c058 locate: change from BSD-4-clause to BSD-3-clause
We have the authorization from the University of California to remove
the advertising clause for a while, wosch@ who also hold a copyright
on this code also approved the relicensing

Approved by:	wosch@
MFC after:	3 days
2022-01-25 09:20:17 +01:00
Eugene Grosbein
85f15576b4 fetch(1): more fixes for soft failure handling
Fix logic error introduced in my commit
bf599c03f0

Also, authorization errors should not be considered as soft failures.
2022-01-25 12:48:28 +07:00
Gleb Smirnoff
80fc25025f tests/net*: destroy interface from inside a jail
There is no guarentee that upon return of 'jail -r' all jail resources
will be released.  The test suite used to rely on that.  Recent changes
to the PCB zones made jails delay releasing their resources, which ended
with interface leak in the test suite.

Fix that by executing 'ifconfig foo0 destroy' inside the jail, instead
of doing 'jail -r' and expecting interfaces to pop up back immediately
in the parent jail.

Reviewed by:		kp
Differential revision:	https://reviews.freebsd.org/D33942
2022-01-24 21:08:03 -08:00
Gleb Smirnoff
6d1808f051 if_clone: correctly destroy a clone from a different vnet
Try to live with cruel reality fact - if_vmove doesn't move an
interface from previous vnet cloning infrastructure to the new
one.  Let's admit this as design feature and make it work better.

* Delete two blocks of code that would fallback to vnet0, if a
  cloner isn't found.  They didn't do any good job and also whole
  idea of treating vnet0 as special one is wrong.
* When deleting a cloned interface, lookup its cloner using it's
  home vnet.

With this change simple sequence works correctly:

  ifconfig foo0 create
  jail -c name=jj persist vnet vnet.interface=foo0
  jexec jj ifconfig foo0 destroy

Differential revision:	https://reviews.freebsd.org/D33942
2022-01-24 21:07:16 -08:00
Gleb Smirnoff
54712fc423 if_vmove: improve restoration in cloner's ifgroup membership
* Do a single call into if_clone.c instead of two.  The cloner
  can't disappear since the interface sits on its list.
* Make restoration smarter - check that cloner with same name
  exists in the new vnet.

Differential revision:	https://reviews.freebsd.org/D33941
2022-01-24 21:06:59 -08:00
Thomas Steen Rasmussen
4a178afb4a tests/netinet: add test for IPv6 NS and CARP
PR:			193280
Reviewed by:		melifaro
Differential revision:	https://reviews.freebsd.org/D33859
2022-01-24 21:02:47 -08:00
Thomas Steen Rasmussen
bc6abdd97e nd6: use CARP link level address in SLLAO for NS sent out
When sending an NS, check if we are using a IPv6 CARP address
and if we do, then put proper CARP link level address into
ND_OPT_SOURCE_LINKADDR option and also put PACKET_TAG_CARP tag
on the packet.  The latter will enforce CARP link level address
at the data link layer too, which might be necessary for broken
implementations.
The code really follows what NA sending code has been doing since
introduction of carp(4).  While here, bring to style(9) the whole
block of code.

PR:			193280
Differential revision:	https://reviews.freebsd.org/D33858
2022-01-24 21:02:47 -08:00
Eric Joyner
e438f0a975
ice_ddp: Update to 1.3.27.0
This is intended to be used with forthcoming ice(4) driver version 1.34.2.

Signed-off-by: Eric Joyner <erj@FreeBSD.org>

Sponsored by:	Intel Corporation
2022-01-24 18:25:56 -08:00
Eric Joyner
213e91399b
iflib: Allow drivers to determine which queue to TX on
Adds a new function pointer to struct if_txrx in order to allow
drivers to set their own function that will determine which queue
a packet should be sent on.

Since this includes a kernel ABI change, bump the __FreeBSD_version
as well.

(This motivation behind this is to allow the driver to examine the
UP in the VLAN tag and determine which queue to TX on based on
that, in support of HW TX traffic shaping.)

Signed-off-by: Eric Joyner <erj@FreeBSD.org>

Reviewed by:	kbowling@, stallamr@netapp.com
Tested by:	jeffrey.e.pieper@intel.com
Sponsored by:	Intel Corporation
Differential Revision:	https://reviews.freebsd.org/D31485
2022-01-24 18:22:02 -08:00
John Baldwin
4f0e50b293 atsectl: Remove.
This was used in the BERI Altera DE4 that ran CHERI MIPS.

Approved by:	brooks
2022-01-24 16:40:02 -08:00
John Baldwin
2c4b65cc3d Bump __FreeBSD_version for the addition of <crypto/curve25519.h>.
Sponsored by:	The FreeBSD Foundation
2022-01-24 15:28:36 -08:00
John Baldwin
16cf646a6f crypto: Remove xform.c and compile xform_*.c standalone.
Reviewed by:	markj
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D33995
2022-01-24 15:27:40 -08:00
John Baldwin
faf470ffdc xform_*.c: Add headers when needed to compile standalone.
Reviewed by:	markj
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D33994
2022-01-24 15:27:40 -08:00
John Baldwin
991b84eca9 Retire now-unused M_XDATA.
Reviewed by:	markj
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D33993
2022-01-24 15:27:39 -08:00
John Baldwin
35d9e00dba IPsec: Use protocol-specific malloc types instead of M_XDATA.
Reviewed by:	markj
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D33992
2022-01-24 15:27:39 -08:00
John Baldwin
8f3f3fdf73 cryptodev: Use a private malloc type (M_CRYPTODEV) instead of M_XDATA.
Reviewed by:	markj
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D33991
2022-01-24 15:27:39 -08:00
John Baldwin
1d95c6f9c0 Don't implicitly pull in most of 'device crypto' for 'options IPSEC'.
options IPSEC is already documented as requiring 'device crypto' and
duplicating the dependencies is harder to read and not always
consistent.

Reviewed by:	markj
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D33990
2022-01-24 15:27:39 -08:00
John Baldwin
0c6274a819 crypto: Add an API supporting curve25519.
This adds a wrapper around libsodium's curve25519 support matching
Linux's curve25519 API.  The intended use case for this is WireGuard.

Note that this is not integrated with OCF as it is not related to
symmetric operations on data.

Reviewed by:	markj
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D33935
2022-01-24 15:27:39 -08:00
John Baldwin
a8c4147edc cxgbei: Parse all PDUs received prior to enabling offload mode.
Previously this would only handle a single PDU that did not contain
any data.  This should now handle an arbitrary number of PDUs.

While here check for these PDUs in the T6-specific CPL_RX_ISCSI_CMP
handler in addition to CPL_RX_ISCSI_DDP.

Reported by:	Jithesh Arakkan @ Chelsio
Sponsored by:	Chelsio Communications
2022-01-24 14:20:02 -08:00
Warner Losh
802f8d4afe mpr/mps: Remove write-only flag and callout
The discovery callout is initialized and cancelled only, making it
write-only. Remove a state flag associated with it being pending as well
as two defines that aren't used that are associated with it. Remove
MP?SAS_SHUTDOWN flag, which is unused.

Sponsored by:		Netflix
Reviewed by:		ken, scottl, mav
Differential Revision:	https://reviews.freebsd.org/D33925
2022-01-24 13:21:09 -07:00
Gordon Bergling
340e08beee pmcstudy: Fix a typo in a usage message
-s /measurments/measurements/

MFC after:	3 days
2022-01-24 19:41:39 +01:00
Wolfram Schneider
829afcb5d3 refactor script
- simpler usage of mktemp(1)
- remove unnecessary checks
- documentation
2022-01-24 18:28:30 +00:00
Wolfram Schneider
0a88bd81b7 awk: print the last two characters for bigram - not the second word
A bigram may contain a space character, and we always need two characters.
2022-01-24 18:27:43 +00:00
Wolfram Schneider
41c539bdd1 stop on first error 2022-01-24 18:27:34 +00:00
John Baldwin
b943d31594 Include the correct header for pdfork()'s prototype.
Reviewed by:	kib, markj
Obtained from:	CheriBSD
Sponsored by:	The University of Cambridge, Google Inc.
Differential Revision:	https://reviews.freebsd.org/D33988
2022-01-24 09:52:12 -08:00
John Baldwin
308fc7e5b1 user_getpeername: Use 'bool' for the compat argument.
This matches user_getsockname.

Reviewed by:	brooks, kib
Sponsored by:	The University of Cambridge, Google Inc.
Differential Revision:	https://reviews.freebsd.org/D33987
2022-01-24 09:51:35 -08:00
Eugene Grosbein
08a2504a20 fetch(1): fix error in previous commit
strncmp() compares terminating zero and sizeof() includes it.
Un-obsfuscate the code and show what it is indended to do.
2022-01-24 15:07:18 +07:00
Eugene Grosbein
bf599c03f0 fetch(1): do not consider HTTP 5XX errors as soft failures
This change fixes "fetch -a" looping forever on "502 Bad gateway"
error and similar.

MFC after:	1 month
2022-01-24 14:38:26 +07:00
Cy Schubert
45b6b37697 UPDATING: Sort by date
I still didn't sort it right.

Pointy hat to:	cy
2022-01-23 22:39:10 -08:00
Cy Schubert
8303b8ff05 UPDATING: Sort by date
Sort unbound entry by date.
2022-01-23 22:34:21 -08:00
Cy Schubert
72d0d523e9 UPDATING: Document unbound support of RFC8375
As of unbound 1.14.0rc1, as per RFC8375 unbound by default blocks
'home.arpa'. Document this new behaviour and how to unblock it.

Reported by:	avg
Discussed with:	glebius, avg
RFC:		8375, Section 6: Security Considerations
2022-01-23 22:30:55 -08:00