Commit graph

39474 commits

Author SHA1 Message Date
Gordon Bergling
47fa565344 ixgbe(4): Fix common typos in source code comments
- s/filer/filter/

Obtained from:	NetBSD

(cherry picked from commit cd7e11f78d)
2022-06-15 07:34:57 +02:00
Kevin Bowling
06a9e144da igc: Increase rx_buffer_size local variable to 32b
Apply 6987c47569 to igc. This is not
expected to have any benefit on current parts with current observed PBA
sizes but will avoid surprises if they are increased in future chips.

Approved by:	grehan
Differential Revision:	https://reviews.freebsd.org/D35217

(cherry picked from commit 9b88ecd674)
2022-06-08 09:39:19 +02:00
Gordon Bergling
388c843267 e1000: Fix a typos in source code comments
- s/negotation/negotiation/

(cherry picked from commit 237a666333)
2022-06-08 09:35:17 +02:00
Kevin Bowling
d9d0161ffd e1000: Increase rx_buffer_size to 32b
Extend the size of the local rx_buffer_size variable to account for
larger buffer sizes possible on 82580, i350 chips.

From i350 datasheet, 6.2.10 Initialization Control 4 (LAN Base Address
+ Offset 0x13):
When 4 ports are enabled maximum buffer size is 36 KB. When 2 ports are
enabled maximum buffer size is 72 KB. When only a single port is
enabled maximum buffer size is 144 KB.

and 8.3:
The overall available internal buffer size in the I350 for all ports is
144 KB for receive buffers and 80 KB for transmit Buffers. Disabled
ports memory can be shared between active ports and sharing can be
asymmetric. The default buffer size for each port is loaded from the
EEPROM on initialization.

From the reporter:
But for I350 when only 2 ports are used PBA size can be set as 72KB
(see datasheet RXPbsize or e1000_rxpbs_adjust_82580 function in
e1000_82575.c). In this case calculating the rx_buffer_size overflows
as 0x0048 << 10 = 73728 or 0x12000 pushed into u16. It is then set as
0x2000 or 8192.

PR:		263896
Reported by:	hannula@gmail.com
Tested by:	hannula@gmail.com
Approved by:	markj
Differential Revision:	https://reviews.freebsd.org/D35167

(cherry picked from commit 6987c47569)
2022-06-08 09:19:00 +02:00
Misho
f27e50a5d1 if_bnxt: Allow bnxt interfaces to use vlans
When VLAN HW filter is disabled, the NIC does not pass any vlan tagged
traffic. Setting these flags on the device allows vlan tagged traffic to
pass.

PR:		236983
Tested by:	pi
Sponsored by:	Klara, Inc.
Differential Revision:	https://reviews.freebsd.org/D34824
2022-04-21 10:36:11 +02:00
Ed Maste
1289cbfc18 mpr/mps/mpt: verify cfg page ioctl lengths
*_CFG_PAGE ioctl handlers in the mpr, mps, and mpt drivers allocated a
buffer of a caller-specified size, but copied to it a fixed size header.
Add checks that the size is at least the required minimum.

Note that the device nodes are owned by root:operator with 0640
permissions so the ioctls are not available to unprivileged users.

This change includes suggestions from scottl, markj and mav.

Two of the mpt cases were reported by Lucas Leong (@_wmliang_) of
Trend Micro Zero Day Initiative; scottl reported the third case in mpt.
Same issue found in mpr and mps after discussion with imp.

Reported by:	Lucas Leong (@_wmliang_), Trend Micro Zero Day Initiative
Reviewed by:	imp, mav
MFC after:	3 days
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D34692

(cherry picked from commit 8276c4149b)
(cherry picked from commit 0b29e1b9f9)

Approved by:	so
Security:	CVE-2022-23086
Security:	FreeBSD-SA-22:06.ioctl
2022-04-06 08:05:11 +02:00
Vincenzo Maffione
5d0ad8f28f netmap: Fix TOCTOU vulnerability in nmreq_copyin
The total size of the user-provided nmreq was first computed and then
trusted during the copyin. This might lead to kernel memory corruption
and escape from jails/containers.

Reported by: Lucas Leong (@_wmliang_) of Trend Micro Zero Day Initiative
Security: CVE-2022-23084
MFC after:	3 days

(cherry picked from commit 3937299165)
(cherry picked from commit 9f600a260a)

Approved by:	so
Security:	FreeBSD-SA-22:04.netmap
2022-04-06 08:05:05 +02:00
Vincenzo Maffione
66a974ce8e netmap: Fix integer overflow in nmreq_copyin
An unsanitized field in an option could be abused, causing an integer
overflow followed by kernel memory corruption. This might be used
to escape jails/containers.

Reported by: Reno Robert and Lucas Leong (@_wmliang_) of Trend Micro
Zero Day Initiative
Security: CVE-2022-23085

(cherry picked from commit 694ea59c70)
(cherry picked from commit 9df8dd3ea3)

Approved by:	so
Security:	FreeBSD-SA-22:04.netmap
2022-04-06 08:05:00 +02:00
Alexander Motin
10d43e45b8 APEI: Make sure event data fit into the buffer.
There seem to be systems returning some garbage here.  I still don't
know why, but at least I hope this check fix indefinite printf loop.

MFC after:	2 weeks

(cherry picked from commit 3b248a2113)
2022-02-15 15:08:52 +01:00
Aleksandr Fedorov
228cd6949d if_vtnet(4): Restore the ability to set promisc mode.
PR:	254343, 255054
Reviewed by:	vmaffione (mentor), donner
Approved by:	vmaffione (mentor), donner
MFC after:	2 weeks
Sponsored by:	vstack.com
Differential Revision:	https://reviews.freebsd.org/D30639
2022-02-07 08:18:05 +01:00
Franco Fichtner
e91d90c0ac Revert "Hyper-V: hn: Enable vSwitch RSC support in hn netvsc driver"
This reverts commit cdc59163ff.
2022-01-28 19:49:38 +01:00
Franco Fichtner
2077062afc Revert "Hyper-V: hn: Initialize the internal field of per packet info on tx path"
This reverts commit 2fbdbfaa0c.
2022-01-28 19:49:37 +01:00
Ad Schellevis
232cb14f50 sys/dev/ixgbe - workaround to prevent an i2c bus read to keep trying to read an empty slot.
When executing `ifconfig -v` this will lead to stalls for a second per interface due to the timeout being set to a static 10 without a module placed, this patch makes sure this is only allowed once per insertion.
2022-01-25 07:15:46 +01:00
Franco Fichtner
96c94f73cc Merge remote-tracking branch 'upstream/stable/13' into stable/22.1 2022-01-10 08:54:21 +01:00
Alexander Motin
4ee9fbcd85 acpi_support: Remove CTLFLAG_NEEDGIANT from sysctls.
MFC after:	2 weeks

(cherry picked from commit 6237a1cc2d)
2022-01-09 19:30:14 -05:00
Alexander Motin
1b1f80ae1c sound: Remove CTLFLAG_NEEDGIANT from some sysctls.
While there, remove some dead code.

MFC after:	2 weeks

(cherry picked from commit 3b4c543322)
2022-01-09 19:29:59 -05:00
Alexander Motin
f39bf9a217 acpica: Remove CTLFLAG_NEEDGIANT from most sysctls.
MFC after:	2 weeks

(cherry picked from commit 3e68d2c52b)
2022-01-09 19:29:55 -05:00
Alexander Motin
6bc8606fca pccbb: Remove Giant mention in comments.
MFC after:	2 weeks

(cherry picked from commit 22405bb2e4)
2022-01-08 20:24:13 -05:00
Alexander Motin
2a36679b74 amdtemp: Remove CTLFLAG_NEEDGIANT from sysctls.
It seems to be needed only to serialize very old K8 registers access.
Introduce separate lock for that and remove Giant dependency.

MFC after:	2 weeks

(cherry picked from commit 6c101ed7a3)
2022-01-08 20:24:07 -05:00
Alexander Motin
cd9fe8d81d uart: Remove CTLFLAG_NEEDGIANT from sysctl.
MFC after:	2 weeks

(cherry picked from commit c214c2c004)
2022-01-08 20:24:01 -05:00
Alexander Motin
7518562484 hwpmc: Remove CTLFLAG_NEEDGIANT from sysctl.
MFC after:	2 weeks

(cherry picked from commit 1886cef69b)
2022-01-08 20:23:58 -05:00
Hans Petter Selasky
457750da86 snd_uaudio(4): Loosen up the USB MIDI permissions.
This makes USB MIDI more userfriendly for desktop users.

PR:		260489
Sponsored by:	NVIDIA Networking

(cherry picked from commit 2fcd7d380b)
2022-01-07 14:23:26 +01:00
Franco Fichtner
a1264e8edf Merge remote-tracking branch 'upstream/stable/13' into stable/22.1 2022-01-07 08:32:41 +01:00
Scott Long
ea4e9becc7 Fix "set but not used" warnings in the mpr driver. This fixes a minor
bug in error handling.

(cherry picked from commit 61f17c5fd6)
2022-01-06 14:08:50 -05:00
Warner Losh
59e2f48e03 mpr: Minor formatting changes to match mps.
Minor reformatting nits to make mprsas_scsiio_timeout match
mpssas_scsiio_timeout more closely. The differences aren't necessary and
are distracting when comparing the routines. No functional changes.

Sponsored by:		Netflix

(cherry picked from commit 2bbaed4d7f)
2022-01-06 14:08:24 -05:00
Warner Losh
726d8e1852 mps(4): Fix unmatched devq release.
Port 9781c28c6d and a8837c77ef to the mps driver.  Before this
change devq was frozen only if some command was sent to the target after
reset started, but release was called always.  This change freezes the
devq immediately, leaving mprsas_action_scsiio() check only to cover
race condition due to different lock devq use.

This should also avoid unnecessary requeue of the commands, creating
additional log noise and confusing some broken apps. It also avoids a
'busy' requeue of I/Os failing when we're doing recovery that takes
longer than the normal busy timeout. These I/Os failing can lead to
filesystems being unmounted in the force unmount case for I/O errors.

Sponsored by:		Netflix
Reviewed by:		mav
Differential Revision:	https://reviews.freebsd.org/D33228

(cherry picked from commit a10253cffe)
2022-01-06 14:03:38 -05:00
Scott Long
0565198d80 Fix "set but not used" warnings in the mps driver.
(cherry picked from commit bcce9c5bed)
2022-01-06 14:01:59 -05:00
Warner Losh
f9c51d3a1d mps: Fix debugging line
Print cm instead of sc here, as is done in mpr. We can get the sc from
cm, but not vice versa.

Sponsored by:		Netflix

(cherry picked from commit b086bc0bf1)
2022-01-06 14:01:19 -05:00
Franco Fichtner
de71f51a6b Merge remote-tracking branch 'upstream/stable/13' into stable/22.1 2022-01-05 10:15:07 +01:00
Andrew Turner
bc98adaf6a Check cpu_softc is not NULL before dereferencing
In the acpi_cpu_postattach SYSINIT function cpu_softc may be NULL, e.g.
on arm64 when booting from FDT. Check it is not NULL at the start of
the function so we don't try to dereference a NULL pointer.

Sponsored by:	The FreeBSD Foundation

(cherry picked from commit 4e50efb194)
2022-01-04 13:08:58 -05:00
Alexander Motin
6b06f8a792 amdtemp: Revert related part of "Make CPU children" commit.
While it still looks like previous code worked by coincidence, this
change broke things even more instead of fixing.

Reported by:	avg@
MFC after:	1 week

(cherry picked from commit 94a72c5ac4)
2022-01-04 12:21:49 -05:00
Alexander Motin
a77188ffd3 acpi_cpu: Fix panic if some CPU devices are disabled.
While there, remove couple unneeded global variables.

(cherry picked from commit 695323ae88)
2022-01-04 12:21:46 -05:00
Alexander Motin
b7668d009e Make CPU children explicitly share parent unit numbers.
Before this device unit number match was coincidental and broke if I
disabled some CPU device(s).  Aside of cosmetics, for some drivers
(may be considered broken) it caused talking to wrong CPUs.

(cherry picked from commit d3a8f98acb)
2022-01-04 12:21:42 -05:00
Alexander Motin
083a2ff0f0 acpi_cpu: Make device unit numbers match OS CPU IDs.
There are already APIC ID, ACPI ID and OS ID for each CPU.  In perfect
world all of those may match, but at least for SuperMicro server boards
none of them do.  Plus none of them match the CPU devices listing order
by ACPI.  Previous code used the ACPI device listing order to number
cpuX devices.  It looked nice from NewBus perspective, but introduced
4th different set of IDs. Extremely confusing one, since in some places
the device unit numbers were treated as OS CPU IDs (coretemp), but not
in others (sysctl dev.cpu.X.%location).

(cherry picked from commit c8077ccd70)
2022-01-04 12:21:35 -05:00
Franco Fichtner
0ed6186bb6 Merge remote-tracking branch 'upstream/stable/13' into stable/22.1
Conflicts:
	sys/netinet/ip_fastfwd.c
2022-01-03 08:54:23 +01:00
Alexander Motin
2572b6bd6b xen/blkfront: Remove CTLFLAG_NEEDGIANT from sysctl.
It only converts bit field into string.  It does not need locking.

MFC after:	1 week

(cherry picked from commit 54daceab55)
2022-01-02 16:39:28 -05:00
Bjoern A. Zeeb
a34668185b modules: increase MAXMODNAME and provide backward compat
With various firmware files used by graphics and wireless drivers
we are exceeding the current 32 character module name (file path
in kldxref) length.
In order to overcome this issue bump it to the maximum path length
for the next version.
To be able to MFC provide backward compat support for another version
of the struct as the offsets for the second half change due to the
array size increase.

MAXMODNAME being defined to MAXPATHLEN needs param.h to be
included first.  With only 7 modules (or LinuxKPI module.h) not
doing that adjust them rather than including param.h in module.h [1].

Reported by:	Greg V (greg unrelenting.technology)
Sponsored by:	The FreeBSD Foundation
Suggested by:	imp [1]
Reviewed by:	imp (and others to different level)
Differential Revision:	https://reviews.freebsd.org/D32383

(cherry picked from commit df38ada293)
2021-12-30 18:26:18 +00:00
Bjoern A. Zeeb
8adc24f7c5 USB dwc3 controller: add quirk snps,dis_rxdet_inp3_quirk
Add support for the "snps,dis_rxdet_inp3_quirk" quirk needed
at least on SolidRun's HoneyComb.

Reviewed by:	manu, mw
Differential Revision: https://reviews.freebsd.org/D32921

(cherry picked from commit 3987e50611)
2021-12-29 16:02:51 +00:00
Bjoern A. Zeeb
907c4e7538 USB: add CYUSB330x to usbdevs
Add the Cypress dual USB3/2 HUB CYUSB330x as found in SolidRun's
HoneyComb to usbdevs.

(cherry picked from commit 1910048eb9)
2021-12-29 16:02:38 +00:00
Franco Fichtner
09e40c3cfa Merge remote-tracking branch 'upstream/stable/13' into stable/22.1 2021-12-29 12:47:31 +01:00
Andriy Gapon
bf206683a8 amdsbwd: always enable watchdog register decoding
This seems to be required even if the watchdog is accessed via the common
MMIO space.

Tested on:
- Ryzen 3 3200U APU;
- Ryzen 7 5800X CPU with X570 chipset.

(cherry picked from commit cca0d3bbd8)
2021-12-27 13:37:29 +02:00
Andriy Gapon
96097be6a8 vmxnet3: skip zero-length descriptor in the middle of a packet
Passing up such descriptors to iflib is obviously wasteful.
But the main conern is that we may overrun iri_frags array because of
them.  That's been observed in practice.

Also, assert that the number of fragments / descriptors / segments is
less than IFLIB_MAX_RX_SEGS.

Sponsored by:	Panzura LLC

(cherry picked from commit 9c612a5d0a)
2021-12-27 13:37:12 +02:00
黃清隆
a6f70ce9fc sys/dev/arcmsr: Update Areca RAID driver to fix some issues on ARC-1886.
1. Doorbell interrupt status may arrive lately when doorbell interrupt on
   ARC-1886.
2. System boot up hung when ARC-1886 with no volume created or no device
   attached.

Many thanks to Areca for continuing to support FreeBSD.

(cherry picked from commit 6964b77e59)
2021-12-26 22:54:48 -08:00
Mark Johnston
2520c9ba7e qat: Address -Wunused-but-set-variable warnings
(cherry picked from commit 8fcf230c13)
2021-12-26 19:15:14 -05:00
Andriy Gapon
fe3c0370da twsi: use twsi_error() to handle wrong bus status when starting
(cherry picked from commit 46e0c03795)
2021-12-26 12:15:18 +02:00
Alexander Motin
e6140a05bc hwpmc: Add IDs for Intel Comet/Ice/Tiger/Rocketlake CPUs.
MFC after:	1 month

(cherry picked from commit 913c07a049)
2021-12-25 19:47:16 -05:00
Gordon Bergling
56cb816fb7 sound(4): Fix a typo in a source code comment
- s/aggresively/aggressively/

(cherry picked from commit d34632a235)
2021-12-25 11:40:16 +01:00
Ram Kishore Vegesna
cc3114e17b ocs_fc: Populate subvendor and subdevice ids.
Enable serialnumber reporting.

Reviewed by: mav
MFC after: 3 days

(cherry picked from commit cba757ef2a)

ocs_fs(4): Fix some common typos in source code comments

- s/transfered/transferred/
- s/associted/associated/

MFC after:	3 days

(cherry picked from commit 16b71d98d9)
2021-12-24 14:28:15 +05:30
Alexander Motin
f9c97b8ada hpt27xx: Remove FreeBSD 9.x support including Giant.
MFC after:	2 weeks

(cherry picked from commit 63e0f96ace)
2021-12-23 20:05:21 -05:00
Alexander Motin
7f703988b5 ahc: Mark sysctls with CTLFLAG_MPSAFE.
MFC after:	2 weeks

(cherry picked from commit 35b2021a0a)
2021-12-23 20:05:13 -05:00