]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
2 years agoif_cgem: Make ext_resources non-optional
Emmanuel Vadot [Tue, 11 Jan 2022 09:42:34 +0000 (10:42 +0100)]
if_cgem: Make ext_resources non-optional

EXT_RESOURCES have been introduced in 12-CURRENT and all supported
releases have it enabled in their kernel config.

MFC after:      1 month
Differential Revision: https://reviews.freebsd.org/D33825

2 years agosdhci: Make ext_resources non-optional
Emmanuel Vadot [Tue, 11 Jan 2022 09:41:23 +0000 (10:41 +0100)]
sdhci: Make ext_resources non-optional

EXT_RESOURCES have been introduced in 12-CURRENT and all supported
releases have it enabled in their kernel config.

MFC after:      1 month
Differential Revision: https://reviews.freebsd.org/D33824

2 years agotwsi: Make ext_resources non-optional
Emmanuel Vadot [Tue, 11 Jan 2022 09:39:47 +0000 (10:39 +0100)]
twsi: Make ext_resources non-optional

EXT_RESOURCES have been introduced in 12-CURRENT and all supported
releases have it enabled in their kernel config.

MFC after:      1 month
Differential Revision: https://reviews.freebsd.org/D33823

2 years agodwmmc: Make ext_resources non-optional
Emmanuel Vadot [Tue, 11 Jan 2022 09:38:24 +0000 (10:38 +0100)]
dwmmc: Make ext_resources non-optional

EXT_RESOURCES have been introduced in 12-CURRENT and all supported
releases have it enabled in their kernel config.

MFC after:      1 month
Differential Revision: https://reviews.freebsd.org/D33822

2 years agommc: Make ext_resources non-optional
Emmanuel Vadot [Tue, 11 Jan 2022 09:37:02 +0000 (10:37 +0100)]
mmc: Make ext_resources non-optional

EXT_RESOURCES have been introduced in 12-CURRENT and all supported
releases have it enabled in their kernel config.

MFC after:      1 month
Differential Revision: https://reviews.freebsd.org/D33821

2 years agodwc: Make ext_resources non-optional
Emmanuel Vadot [Tue, 11 Jan 2022 09:34:36 +0000 (10:34 +0100)]
dwc: Make ext_resources non-optional

EXT_RESOURCES have been introduced in 12-CURRENT and all supported
releases have it enabled in their kernel config.

MFC after: 1 month
Differential Revision: https://reviews.freebsd.org/D33820

2 years agommap map_at_zero test: handle W^X
Arka Sharma [Fri, 18 Feb 2022 15:34:15 +0000 (09:34 -0600)]
mmap map_at_zero test: handle W^X

Use kern.elfXX.allow_wx to decide whether to map W+X or W-only memory.

Future work could expand this test to add an "allow_wx" axis to the
test matrix, but I would argue that a separate test should be written,
since that's orthogonal to map_at_zero.

MFC after: 1 week
Sponsored by: Dell EMC Isilon

2 years agotcp: Congestion control move to using reference counting.
Randall Stewart [Mon, 21 Feb 2022 11:30:17 +0000 (06:30 -0500)]
tcp: Congestion control move to using reference counting.

In the transport call on 12/3 Gleb asked to move the CC modules towards
using reference counting to prevent folks from unloading a module in use.
It was also agreed that Michael would do a user space utility like tcp_drop
that could be used to move all connections that are using a specific CC
to some other CC.

This is the half I committed to doing, making it so that we maintain a refcount
on a cc module every time a pcb refers to it and decrementing that every
time a pcb no longer uses a cc module. This also helps us simplify the
whole unloading process by getting rid of tcp_ccunload() which munged
through all the tcb's. Instead we mark a module as being removed and
prevent further references to it. We also make sure that if a module is
marked as being removed it cannot be made as the default and also
the opposite of that, if its a default it fails and does not mark it as being
removed.

Reviewed by: Michael Tuexen, Gleb Smirnoff
Sponsored by: Netflix Inc.
Differential Revision: https://reviews.freebsd.org/D33249

2 years agolibarchive: merge vendor bugfix
Martin Matuska [Mon, 21 Feb 2022 11:06:54 +0000 (12:06 +0100)]
libarchive: merge vendor bugfix

OSS-Fuzz #44843 (security):
RAR reader: fix null-dereference in RAR (v4) filter code

X-MFC-with: 833a452e9d

2 years agoUpdate vendor/libarchive to libarchive/libarchive@1271f775d
Martin Matuska [Mon, 21 Feb 2022 11:04:05 +0000 (12:04 +0100)]
Update vendor/libarchive to libarchive/libarchive@1271f775d

Bugfixes:
OSS-Fuzz #44843 (security):
  RAR reader: fix null-dereference in RAR (v4) filter code

Obtained from: libarchive
Libarchive commit: 1271f775dc917798ad7d03c3b3bd66bacad03603

2 years agocpufreq: dt: Plug set but not used variable
Emmanuel Vadot [Mon, 21 Feb 2022 10:04:09 +0000 (11:04 +0100)]
cpufreq: dt: Plug set but not used variable

Sponsored by: Beckhoff Automation GmbH & Co. KG

2 years agotwsi: Plug set but not used variable
Emmanuel Vadot [Mon, 21 Feb 2022 10:03:57 +0000 (11:03 +0100)]
twsi: Plug set but not used variable

Sponsored by: Beckhoff Automation GmbH & Co. KG

2 years agoaudio_soc: Plug set but not used variable
Emmanuel Vadot [Mon, 21 Feb 2022 10:03:38 +0000 (11:03 +0100)]
audio_soc: Plug set but not used variable

Sponsored by: Beckhoff Automation GmbH & Co. KG

2 years agoif_dwc: Plug set but not used variable
Emmanuel Vadot [Mon, 21 Feb 2022 10:03:25 +0000 (11:03 +0100)]
if_dwc: Plug set but not used variable

Sponsored by: Beckhoff Automation GmbH & Co. KG

2 years agoarm: allwinner: a33_codec: Plug set but not used variable
Emmanuel Vadot [Mon, 21 Feb 2022 10:03:09 +0000 (11:03 +0100)]
arm: allwinner: a33_codec: Plug set but not used variable

Sponsored by: Beckhoff Automation GmbH & Co. KG

2 years agoarm: allwinner: a10_timer: Plug set but not used variable
Emmanuel Vadot [Mon, 21 Feb 2022 10:02:53 +0000 (11:02 +0100)]
arm: allwinner: a10_timer: Plug set but not used variable

Sponsored by: Beckhoff Automation GmbH & Co. KG

2 years agopmic: rockchip: Plug set but not used variable
Emmanuel Vadot [Mon, 21 Feb 2022 09:55:43 +0000 (10:55 +0100)]
pmic: rockchip: Plug set but not used variable

Sponsored by: Beckhoff Automation GmbH & Co. KG

2 years agoarm: allwinner: clk: Plug set but not used variable
Emmanuel Vadot [Mon, 21 Feb 2022 09:55:07 +0000 (10:55 +0100)]
arm: allwinner: clk: Plug set but not used variable

Sponsored by: Beckhoff Automation GmbH & Co. KG

2 years agoarm64: allwinner: aw_usb3phy: Plug set but not used variable
Emmanuel Vadot [Mon, 21 Feb 2022 09:54:47 +0000 (10:54 +0100)]
arm64: allwinner: aw_usb3phy: Plug set but not used variable

Sponsored by: Beckhoff Automation GmbH & Co. KG

2 years agoarm64: allwinner: aw_i2s: Plug set but not used variable
Emmanuel Vadot [Mon, 21 Feb 2022 09:54:17 +0000 (10:54 +0100)]
arm64: allwinner: aw_i2s: Plug set but not used variable
Sponsored by: Beckhoff Automation GmbH & Co. KG

2 years agoarm: allwinner: aw_gpio: Plug set but not used variable
Emmanuel Vadot [Mon, 21 Feb 2022 09:53:58 +0000 (10:53 +0100)]
arm: allwinner: aw_gpio: Plug set but not used variable

Sponsored by: Beckhoff Automation GmbH & Co. KG

2 years agoarm64: allwinner: axp81x: Plug set but not used variable
Emmanuel Vadot [Mon, 21 Feb 2022 09:39:05 +0000 (10:39 +0100)]
arm64: allwinner: axp81x: Plug set but not used variable
Sponsored by: Beckhoff Automation GmbH & Co. KG

2 years agoarm64: allwinner: aw_sid: Plug set but not used variable
Emmanuel Vadot [Mon, 21 Feb 2022 09:38:06 +0000 (10:38 +0100)]
arm64: allwinner: aw_sid: Plug set but not used variable
Sponsored by: Beckhoff Automation GmbH & Co. KG

2 years agomlx5core: Add PCI IDs for ConnectX-8.
Hans Petter Selasky [Mon, 21 Feb 2022 08:25:45 +0000 (09:25 +0100)]
mlx5core: Add PCI IDs for ConnectX-8.

MFC after: 1 week
Sponsored by: NVIDIA Networking

2 years agomlx5ib: Add support for NDR link speed.
Hans Petter Selasky [Mon, 21 Feb 2022 08:25:29 +0000 (09:25 +0100)]
mlx5ib: Add support for NDR link speed.

The IBTA specification has new speed - NDR. That speed supports signaling
rate of 100Gb. mlx5 IB driver translates link modes reported by ConnectX
device to IB speed and width. Added translation of new 100Gb, 200Gb and
400Gb link modes to NDR IB type and width of x1, x2 or x4 respectively.

Linux commits:
f946e45f59ef01ff54ffb3b1eba3a8e7915e7326

MFC after: 1 week
Sponsored by: NVIDIA Networking

2 years agomlx5core: Add PCI IDs for ConnectX-7.
Hans Petter Selasky [Mon, 21 Feb 2022 08:25:23 +0000 (09:25 +0100)]
mlx5core: Add PCI IDs for ConnectX-7.

Linux commits:
505a7f5478062c6cd11e22022d9f1bf64cd8eab3
dd8595eabeb486d41ad9994e6cece36e0e25e313

MFC after: 1 week
Sponsored by: NVIDIA Networking

2 years agoibcore: Add support for NDR link speed.
Hans Petter Selasky [Mon, 21 Feb 2022 08:25:10 +0000 (09:25 +0100)]
ibcore: Add support for NDR link speed.

Add new IBTA speed NDR, supporting signaling rate of 100Gb.

Linux commit:
c7adf7717301558e8852949d8e3dc3748d1a4a97

MFC after: 1 week
Sponsored by: NVIDIA Networking

2 years agoTemporarily skip usr.bin.diff.diff_test.functionname in CI
Li-Wen Hsu [Mon, 21 Feb 2022 08:31:43 +0000 (16:31 +0800)]
Temporarily skip usr.bin.diff.diff_test.functionname in CI

PR: 262086
Sponsored by: The FreeBSD Foundation

2 years agoRevert "Enable -Wdate-time warning"
Ed Maste [Mon, 21 Feb 2022 00:01:40 +0000 (19:01 -0500)]
Revert "Enable -Wdate-time warning"

This reverts commit 489d7a8528cae1adb7192c2563028e2d028c354b.

The flag leaks into some port builds, causing them to fail.  I will
recommit it with some sort of opt-out later on.

Reported by: mi

2 years agodev/pci: fix potential panic due to bogus VPD data
Stefan Eßer [Sun, 20 Feb 2022 21:07:35 +0000 (22:07 +0100)]
dev/pci: fix potential panic due to bogus VPD data

A panic has been observed on a system with a Intel X520 dual LAN
device. The panic is caused by a KASSERT() noticing that the amount
of VPD data copied out to the pciconf command does not match the
amount of data read from the device.

The cause of the size mismatch was VPD data that started with 0x82,
the VPD tag that indicates that a VPD ident follows, but with a length
of more than 255 characters, which happens to be the maximum ident
size supported by the API between kernel and the pciconf program.
The data provided did not resemble an actual VPD identifier, and it
can be assumed that the initial tag value 0x82 happens to be there
by accident.

An ident size of 255 far exceeds the sensible length of that data
element, which is in the order of at most 30 to 40 bytes.

This patch adds several consitstency checks to the VPD parser, the
most critical being that ident lengths of more than 255 bytes are
rejected. Other checks reject VPD with more than one ident tag or
with an empty (zero length) ident string.

This patch prevents the panic that occured when "pciconf -lV" was
executed on the affected system.

During the anaylsis of the issue and the VPD code it has been
found that the VPD parser uses a state machine that accepts tags
in any order and combination. This is a bad match for the actual
VPD data, which has a very simple structure that can be parsed
with a non-recursive direct descent parser (which always knows
exactly which token to expect next).

A review fpr a much simpler VPD parser that performs many more
consistency checks and rejects invalid VPD has been proposed in
review https://reviews.freebsd.org/D34268.

Reported by: mikej at paymentallianceintl.com (Michael Jung)
Approved by: jhb
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D34255

2 years agoAvoid unaligned writes by fsck_ffs(8).
Kirk McKusick [Sun, 20 Feb 2022 21:18:05 +0000 (13:18 -0800)]
Avoid unaligned writes by fsck_ffs(8).

Normally fsck_ffs never does reads or writes that are not aligned
to the size of one of the checked filesystems fragments. The one
exception is when it finds that it needs to write the superblock
recovery information. Here it will write with the alignment reported
by the underlying disk as its sector size as reported by an
ioctl(diskfd, DIOCGSECTORSIZE, &secsize).

Modern disks have a sector size of 4096, but for backward compatibility
with older disks will report that they have a sector size of 512.
When presented with a 512 byte write, they have to read the associated
4096 byte sector, replace the 512 bytes to be written, and write
the updated 4096 byte sector back to the disk. Unfortunately, some
disks report that they have 512 sectors, but fail writes that are not
aligned to 4096 boundaries and are a multiple of 4096 bytes in size.

This commit updates fsck_ffs(8) so that it uses the filesystem fragment
size as the smallest size and alignment for doing writes rather than
the disk's reported sector size.

Reported by:  Andriy Gapon
MFC after:    1 week

2 years agoshare/mk: Fix obvious typo in README (TAREGT -> TARGET)
Joerg Wunsch [Sun, 20 Feb 2022 16:26:04 +0000 (17:26 +0100)]
share/mk: Fix obvious typo in README (TAREGT -> TARGET)

MFC after: 1 week

2 years agosctp: remove KASSERT() which not always holds
Michael Tuexen [Sun, 20 Feb 2022 14:59:21 +0000 (15:59 +0100)]
sctp: remove KASSERT() which not always holds

Reported by: syzbot+c907045aed2043011f3c@syzkaller.appspotmail.com
MFC after: 3 days

2 years agosctp: make sure new locking requirements are satisfied.
Michael Tuexen [Sun, 20 Feb 2022 14:31:53 +0000 (15:31 +0100)]
sctp: make sure new locking requirements are satisfied.

Reported by: syzbot+cd3c1dd64861b8c200bd@syzkaller.appspotmail.com
MFC after: 3 days

2 years agofetch: make -S argument accept values > 2GB
Stefan Eßer [Sun, 20 Feb 2022 14:24:43 +0000 (15:24 +0100)]
fetch: make -S argument accept values > 2GB

Use strtoll() to parse the argument of the -S option.

FreeBSD has supported 64 bit file offsets for more than 25 years on
all architectures and off_t is a 64 bit integer type for that reason.

While strtol() returns a 64 bit value on 64 LP64 architectures, it
is limit to 32 bit on e.g. i386. The strtoll() function returns a 64
but result on all supported architectures and therefore supports the
possible file lengths and file offsets on 32 bit archtectures.

Reported by: antoine
MFC after: 3 days

2 years agosctp: don't hold the assoc create lock longer than needed
Michael Tuexen [Sun, 20 Feb 2022 13:55:41 +0000 (14:55 +0100)]
sctp: don't hold the assoc create lock longer than needed

Reported by: syzbot+c738e3df67cf425c49a2@syzkaller.appspotmail.com
MFC after: 3 days

2 years agoofw_iicbus: Use uint32_t for iic bus address argument, not int.
Michal Meloun [Sun, 20 Feb 2022 11:24:15 +0000 (12:24 +0100)]
ofw_iicbus: Use uint32_t for iic bus address argument, not int.

The iicbus devinfo uses uint32_t for storing iic bus address and new method
should comply with this fact.

MFC with: 1bd3e8ba696633ccd7525030d951b58ade167814#

2 years agoFix a534b50e245d on powerpc.
Michal Meloun [Sun, 20 Feb 2022 13:02:13 +0000 (14:02 +0100)]
Fix a534b50e245d on powerpc.

MFC with: 1bd3e8ba696633ccd7525030d951b58ade167814

2 years agotegra: Improve the detection of the secondary function (RTC) of the MAX77620.
Michal Meloun [Sun, 20 Feb 2022 10:18:42 +0000 (11:18 +0100)]
tegra: Improve the detection of the secondary function (RTC) of the MAX77620.

Use the new ofw_iicbus_set_devinfo() method to implant an OFW compatibility
string for a manually created RTC sub-device.

MFC after: 4 weeks
Reported by: archimedes.gaviola_at_gmail.com
bscott_at_bunyatech.com.au

2 years agoofw_iicbus: Add method for manual setting of basic OFW parameters.
Michal Meloun [Sun, 20 Feb 2022 09:45:14 +0000 (10:45 +0100)]
ofw_iicbus: Add method for manual setting of basic OFW parameters.

Some IIC multifunction devices may have multiple I2C addresses per chip, but
only the primary address is listed in the DT (e.g. MAX776200). In this case,
the sub-devices for the secondary addresses must be created manually with
fixed OFW parameters (node, name, compatibility string, IIC address).
Add a bus method to the ofw_iicbus interface that does this.

MFC after: 4 weeks

2 years agoProvide an interface that allows GEOM modules to return multiple messages.
Kirk McKusick [Sun, 20 Feb 2022 05:30:37 +0000 (21:30 -0800)]
Provide an interface that allows GEOM modules to return multiple messages.

The gctl_error() function provides GEOM modules with the ability
to report only a single message. When running with the verbose
flag, commands that handle multiple devices may want to report a
message for each of the devices on which it operates. This commit
adds the gctl_msg() function that can be called multiple times
to post messages. When finished issuing messages, the application
must either call gctl_post_messages() or call gctl_error() to cause
the messages to be reported to the calling process.

Tested by:    Peter Holm

2 years agosctp: cleanup sctp_lower_sosend
Michael Tuexen [Sun, 20 Feb 2022 00:09:30 +0000 (01:09 +0100)]
sctp: cleanup sctp_lower_sosend

This is a preparation for retiring the tcp send lock in the
next step.

MFC after: 3 days

2 years agosnd_uaudio(4): Set hardware buffering to the minimum by default.
Hans Petter Selasky [Sat, 19 Feb 2022 23:10:53 +0000 (00:10 +0100)]
snd_uaudio(4): Set hardware buffering to the minimum by default.

Improves the audio experience when using applications like
audio/jamulus and audio/hpsjam .

MFC after: 1 week
Sponsored by: NVIDIA Networking

2 years agovnet: add CURVNET_ASSERT_SET for !VIMAGE
Mateusz Guzik [Sat, 19 Feb 2022 21:00:00 +0000 (21:00 +0000)]
vnet: add CURVNET_ASSERT_SET for !VIMAGE

Reported by: ler
Sponsored by: Rubicon Communications, LLC ("Netgate")

2 years agortsx: Add RTS5260 support and replace bootverbose with sysctl.
Henri Hennebert [Sat, 19 Feb 2022 16:41:53 +0000 (11:41 -0500)]
rtsx: Add RTS5260 support and replace bootverbose with sysctl.

Tested by: mav
MFC after: 4 days
Differential Revision: https://reviews.freebsd.org/D34246

2 years agoipsec: sprinkle CURVNET_ASSERT_SET
Mateusz Guzik [Thu, 17 Feb 2022 16:53:15 +0000 (16:53 +0000)]
ipsec: sprinkle CURVNET_ASSERT_SET

Reviewed by: ae
Sponsored by: Rubicon Communications, LLC ("Netgate")
Differential Revision: https://reviews.freebsd.org/D34314

2 years agoipsec: extend vnet coverage in esp_input/output_cb
Mateusz Guzik [Thu, 17 Feb 2022 16:50:13 +0000 (16:50 +0000)]
ipsec: extend vnet coverage in esp_input/output_cb

key_delsav used to conditionally dereference vnet, leading to panics as
it was getting unset too early.

While the particular condition was removed, it makes sense to handle all
operations of the sort with correct vnet set so change it.

Reviewed by: ae
Sponsored by: Rubicon Communications, LLC ("Netgate")
Differential Revision: https://reviews.freebsd.org/D34313

2 years agovnet: add CURVNET_ASSERT_SET
Mateusz Guzik [Thu, 17 Feb 2022 16:48:45 +0000 (16:48 +0000)]
vnet: add CURVNET_ASSERT_SET

Reviewed by: kp
Sponsored by: Rubicon Communications, LLC ("Netgate")
Differential Revision: https://reviews.freebsd.org/D34312

2 years agolibarchive: merge vendor bugfixes
Martin Matuska [Fri, 18 Feb 2022 23:57:56 +0000 (00:57 +0100)]
libarchive: merge vendor bugfixes

Bugfixes:
OSS-Fuzz #44547: fix heap-use-after-free in RAR (v4) filter code
PR #1671: Fix 7z PPMD reading beyond boundary

X-MFC-with: 833a452e9d

2 years agoUpdate vendor/libarchive to libarchive/libarchive@72ce1ff7c
Martin Matuska [Fri, 18 Feb 2022 23:45:12 +0000 (00:45 +0100)]
Update vendor/libarchive to libarchive/libarchive@72ce1ff7c

Bugfixes:
  OSS-Fuzz #44547 (security):
    fix heap-use-after-free in RAR (v4) filter code
  PR #1671:
    Fix 7z PPMD reading beyond boundary

Obtained from: libarchive
Libarchive commit: 72ce1ff7c6857a7334baa05884e69b9264a2199c

2 years agoctl ramdisk: Free compare buffer after a compare I/O request.
John Baldwin [Fri, 18 Feb 2022 23:20:14 +0000 (15:20 -0800)]
ctl ramdisk: Free compare buffer after a compare I/O request.

For a compare request, the ramdisk backend allocates a temporary
buffer to hold the I/O data and then compares it against the LUN's
pages in ctl_backend_ramdisk_cmp after the data has been filled.
However, the tempory buffer was leaked when after the comparison was
complete.  Fix this by freeing the buffer after the comparison.

Reviewed by: mav
Sponsored by: Chelsio Communications
Differential Revision: https://reviews.freebsd.org/D34316

2 years agoLinuxKPI: return value for linux_pci_probe()
Bjoern A. Zeeb [Mon, 17 Jan 2022 00:47:13 +0000 (00:47 +0000)]
LinuxKPI: return value for linux_pci_probe()

In linux_pci_probe() return BUS_PROBE_DEFAULT rather than 0
(which actually is BUS_PROBE_SPECIFIC and means 'Only this
driver can use this device').

Sponsored by:   The FreeBSD Foundation
MFC after:      3 days
Reviewed by: hselasky
Differential Revision: https://reviews.freebsd.org/D33913

2 years agocxgbe(4): Changes to the fatal error handler.
Navdeep Parhar [Fri, 4 Feb 2022 21:16:35 +0000 (13:16 -0800)]
cxgbe(4): Changes to the fatal error handler.

* New error_flags that can be used from the error ithread and elsewhere
  without a synch_op.
* Stop the adapter immediately in t4_fatal_err but defer most of the
  rest of the handling to a task.  The task is allowed to sleep, unlike
  the ithread.  Remove async_event_task as it is no longer needed.
* Dump the devlog, CIMLA, and PCIE_FW exactly once on any fatal error
  involving the firmware or the CIM block.  While here, dump some
  additional info (see dump_cim_regs) for these errors.
* If both reset_on_fatal_err and panic_on_fatal_err are set then attempt
  a reset first and do not panic the system if it is successful.

MFC after: 1 week
Sponsored by: Chelsio Communications

2 years agouname: -v: strip final whitespace compatibly with uname(3)
наб [Fri, 18 Feb 2022 13:34:40 +0000 (14:34 +0100)]
uname: -v: strip final whitespace compatibly with uname(3)

This restores POSIX.1 conformance

PR: 260938

2 years agosctp: improve robustness
Michael Tuexen [Fri, 18 Feb 2022 13:30:07 +0000 (14:30 +0100)]
sctp: improve robustness

MFC after: 3 days

2 years agosctp: cleanup, no functional change intended.
Michael Tuexen [Fri, 18 Feb 2022 13:20:01 +0000 (14:20 +0100)]
sctp: cleanup, no functional change intended.

MFC after: 3 days

2 years agodiff: fix failed compare when ignoring file case
Tom Jones [Fri, 18 Feb 2022 15:21:23 +0000 (15:21 +0000)]
diff: fix failed compare when ignoring file case

With --ignore-file-name-case we need to compare files regardless of
case. We need to propigate both names down to diffit so we can look up
the correct file when the names differ based on case, otherwise we try
to look up the file using the case from the a tree which might not be
discoverable if its case is different in the b tree.

Reviewed by: bapt
Sponsored by: Klara Inc.
Differential Revision: https://reviews.freebsd.org/D34201

2 years agoRemove surplus check for which diff is being tested
Tom Jones [Fri, 18 Feb 2022 15:47:46 +0000 (15:47 +0000)]
Remove surplus check for which diff is being tested

Must have left this when I was testing the test invocation for
8f79bd9b85716c495c2741ac25db37e8d71f22f7

Pointy hat: thj
Sponsored by: Klara Inc.

2 years agodiff: add --no-dereference flag
Tom Jones [Fri, 18 Feb 2022 15:13:13 +0000 (15:13 +0000)]
diff: add --no-dereference flag

When diffing files and directories, don't follow symbolic links, instead
compare where the links point to.

Reviewed by: bapt
Sponsored by: Klara Inc.
Differential Revision: https://reviews.freebsd.org/D34203

2 years agodiff: Detect Objective-C methods
Tom Jones [Fri, 18 Feb 2022 15:07:52 +0000 (15:07 +0000)]
diff: Detect Objective-C methods

When searching back for function definitions, consider lines starting
with '+' and '-', this allows us to pick up Objective-C methods as well
as C style function definitions.

Reviewed by: bapt
Sponsored by: Klara Inc.
Differential Revision: https://reviews.freebsd.org/D34202

2 years agosctp: remove unused parameter
Michael Tuexen [Fri, 18 Feb 2022 11:20:44 +0000 (12:20 +0100)]
sctp: remove unused parameter

MFC after: 3 days

2 years agovtfontcvt: update FreeBSD Foundation copyrights
Ed Maste [Fri, 18 Feb 2022 01:04:29 +0000 (20:04 -0500)]
vtfontcvt: update FreeBSD Foundation copyrights

Remove "All Rights Reserved"

2 years agounbound: Vendor import 1.15.0
Cy Schubert [Fri, 18 Feb 2022 00:05:15 +0000 (16:05 -0800)]
unbound: Vendor import 1.15.0

Vendor import GA release of unbound 1.15.0.

MFC after:      2 weeks

2 years agounbound: Vendor import 1.15.0
Cy Schubert [Thu, 17 Feb 2022 22:47:14 +0000 (14:47 -0800)]
unbound: Vendor import 1.15.0

2 years agosctp: fix a signed/unsigned mismatch.
Michael Tuexen [Thu, 17 Feb 2022 21:44:41 +0000 (22:44 +0100)]
sctp: fix a signed/unsigned mismatch.

MFC after: 3 days

2 years agoAdd support for getting early entropy from UEFI
Colin Percival [Thu, 17 Feb 2022 21:01:11 +0000 (13:01 -0800)]
Add support for getting early entropy from UEFI

UEFI provides a protocol for accessing randomness. This is a good way
to gather early entropy, especially when there's no driver for the RNG
on the platform (as is the case on the Marvell Armada8k (MACCHIATObin)
for now).

If the entropy_efi_seed option is enabled in loader.conf (default: YES)
obtain 2048 bytes of entropy from UEFI and pass is to the kernel as a
"module" of name "efi_rng_seed" and type "boot_entropy_platform"; if
present, ingest it into the kernel RNG.

Submitted by: Greg V
Reviewed by: markm, kevans
Approved by: csprng (markm)
MFC after: 3 weeks
Differential Revision: https://reviews.freebsd.org/D20780

2 years agoAdd myself (asiciliano) as src committer and bapt as my mentor
Alfonso S. Siciliano [Thu, 17 Feb 2022 18:45:11 +0000 (19:45 +0100)]
Add myself (asiciliano) as src committer and bapt as my mentor

Approved by: bapt (mentor)
Differential Revision: https://reviews.freebsd.org/D34310

2 years agoarmv8crypto: Remove leftover debug printfs
Mark Johnston [Thu, 17 Feb 2022 19:19:23 +0000 (14:19 -0500)]
armv8crypto: Remove leftover debug printfs

Fixes: 26b08c5d21b5 ("armv8crypto: Use cursors to access crypto buffer data")
Reported by: bz

2 years agomd(4): Add dummy support of the BIO_FLUSH command for malloc and swap
Aleksandr Fedorov [Thu, 17 Feb 2022 19:21:56 +0000 (22:21 +0300)]
md(4): Add dummy support of the BIO_FLUSH command for malloc and swap
backend.

PR: 260200
Reported by: editor@callfortesting.org
Reviewed by: vmaffione (mentor), markj
Approved by: vmaffione (mentor), markj
Differential Revision: https://reviews.freebsd.org/D34260

2 years agosctp: avoid undefined behaviour and cleanup the code.
Michael Tuexen [Thu, 17 Feb 2022 18:23:59 +0000 (19:23 +0100)]
sctp: avoid undefined behaviour and cleanup the code.

MFC after: 3 days

2 years agounbound: Refresh manpages to latest version
Cy Schubert [Thu, 17 Feb 2022 16:11:33 +0000 (08:11 -0800)]
unbound: Refresh manpages to latest version

Update unbound manpages by copying the current unbound manpages in
contrib/doc/*.in to their respective manpages,

PR: 262013
Reported by: Michael Osipov <michael.osipov@siemens.com>
Fixes: numerous previous updates
MFC after: 3 days

2 years agoelfdump: handle small files more gracefully
Eric van Gyzen [Thu, 17 Feb 2022 15:53:48 +0000 (09:53 -0600)]
elfdump: handle small files more gracefully

elfdump -E on an empty file would complain "Invalid argument" because
it tried to mmap zero bytes.  With the -E flag, elfdump should
simply exit non-zero.  For tiny files, the code would reference off
the end of the mapped region.

Ensure the file is large enough to contain an ELF header before mapping it.

MFC after: 1 week
Sponsored by: Dell EMC Isilon

2 years agoLinuxKPI: implement dma_sync_single_for_*, apply to (un)map single/sg
Bjoern A. Zeeb [Fri, 1 Oct 2021 10:51:50 +0000 (10:51 +0000)]
LinuxKPI: implement dma_sync_single_for_*, apply to (un)map single/sg

Implement dma_sync_single_for_{cpu,device} translating the Linux
DMA_ flags to BUS_DMASYNC_ combinations.  Make map_single/unmap_single*
functions call the respective sync function.   Apply the same logic to
the scatter-gather list map/unmap functions.

Sponsored by: The FreeBSD Foundation
MFC after: 3 days
Reviewed by: hselasky
Differential Revision: https://reviews.freebsd.org/D32255

2 years agopf tests: Test per-anchor tables
Kristof Provost [Thu, 17 Feb 2022 13:13:50 +0000 (14:13 +0100)]
pf tests: Test per-anchor tables

MFC after: 1 week
Sponsored by: Rubicon Communications, LLC ("Netgate")

2 years agopf tests: remove a stray 'set -x'
Kristof Provost [Thu, 17 Feb 2022 12:40:41 +0000 (13:40 +0100)]
pf tests: remove a stray 'set -x'

'set -x' is very useful when debugging tests, but does not need to be
left in.

MFC after: 1 week
Sponsored by: Rubicon Communications, LLC ("Netgate")

2 years agomlx5en: Improve CQE error debugging.
Hans Petter Selasky [Thu, 17 Feb 2022 11:50:22 +0000 (12:50 +0100)]
mlx5en: Improve CQE error debugging.

MFC after: 1 week
Sponsored by: NVIDIA Networking

2 years agomlx5en: Fix TLS worker thread race.
Hans Petter Selasky [Thu, 17 Feb 2022 11:48:57 +0000 (12:48 +0100)]
mlx5en: Fix TLS worker thread race.

Create a dedicated free state, in case the taskqueue worker is still pending,
to avoid re-activation of a freed send tag.

MFC after: 1 week
Sponsored by: NVIDIA Networking

2 years agomlx5en: Improve RX- and TX- TLS refcounting.
Hans Petter Selasky [Thu, 17 Feb 2022 11:47:20 +0000 (12:47 +0100)]
mlx5en: Improve RX- and TX- TLS refcounting.

Use the send tag refcounting mechanism to refcount the RX- and TX- TLS
send tags. Then it is no longer needed to wait for refcounts to reach
zero when destroying RX- and TX- TLS send tags as a result of pending
data or WQE commands.

This also ensures that when TX-TLS and rate limiting is used at the same
time, the underlying SQ is not prematurely destroyed.

MFC after: 1 week
Sponsored by: NVIDIA Networking

2 years agomlx5en: Add missing refcount decrement on link-down.
Hans Petter Selasky [Thu, 17 Feb 2022 11:45:25 +0000 (12:45 +0100)]
mlx5en: Add missing refcount decrement on link-down.

MFC after: 1 week
Sponsored by: NVIDIA Networking

2 years agofreebsd-update.conf.5: Sort options
Mateusz Piotrowski [Thu, 17 Feb 2022 09:54:07 +0000 (10:54 +0100)]
freebsd-update.conf.5: Sort options

Reported by: pauamma_gundo.com
MFC after: 1 week

2 years agofreebsd-update.conf.5: Address style issues
Mateusz Piotrowski [Thu, 17 Feb 2022 09:40:48 +0000 (10:40 +0100)]
freebsd-update.conf.5: Address style issues

- Do not set Os to FreeBSD explicitly. We don't do it in other manual
  pages.
- Remove macros from the -width specifier.
- Use Xr instead of Cm to refer to the freebsd-update command.
- Address some mandoc lint warnings and use \(em instead of --.
- Wordsmith some paragraphs.
- Add a missing El macro.

MFC after: 1 week

2 years agofreebsd-update.8: Document CreateBootEnv
Mateusz Piotrowski [Fri, 4 Feb 2022 10:20:49 +0000 (11:20 +0100)]
freebsd-update.8: Document CreateBootEnv

Also, add bectl(8) to section "See Also". [1]

PR: 261716
Reviewed by: debdrup, pauamma_gundo.com
MFC after: 1 week
Fixes: f28f13890541 freebsd-update: create a ZFS boot environment on install
Differential Revision: https://reviews.freebsd.org/D34169
Co-authored-by: Tobias Rehbein <tobias.rehbein@web.de> [1]

2 years agoBump FreeBSD_version after linuxkpi update.
Emmanuel Vadot [Thu, 17 Feb 2022 08:42:42 +0000 (09:42 +0100)]
Bump FreeBSD_version after linuxkpi update.

Sponsored by: Beckhoff Automation GmbH & Co. KG

2 years agolinuxkpi: Add mmap_lock.h
Emmanuel Vadot [Wed, 16 Feb 2022 10:26:14 +0000 (11:26 +0100)]
linuxkpi: Add mmap_lock.h

This contain mmap_read_lock, mmap_read_unlock and mmap_write_lock_killable
which are abstraction around down_read, up_read and down_write_killable.
Note that in Linux 5.8 mmap_sem was renamed to mmap_lock.
We might want to do the same at some point but some drivers still uses
the old mmap locking API.

Reviewed by: bz
MFC after: 2 weeks
Sponsored by: Beckhoff Automation GmbH & Co. KG
Differential Revision: https://reviews.freebsd.org/D34297

2 years agolinuxkpi: Add atomic64_fetch_add
Emmanuel Vadot [Wed, 16 Feb 2022 09:44:55 +0000 (10:44 +0100)]
linuxkpi: Add atomic64_fetch_add

Linux variant of atomic_fetchadd_64.

Reviewed by: bz
MFC after: 2 weeks
Sponsored by: Beckhoff Automation GmbH & Co. KG
Differential Revision: https://reviews.freebsd.org/D34296

2 years agolinuxkpi: Add orderly_poweroff
Emmanuel Vadot [Tue, 15 Feb 2022 11:06:26 +0000 (12:06 +0100)]
linuxkpi: Add orderly_poweroff

This simply poweroff the system.
Needed by drm-kmod v5.8

Reviewed by: bz
MFC after: 2 weeks
Sponsored by: Beckhoff Automation GmbH & Co. KG
Differential Revision: https://reviews.freebsd.org/D34287

2 years agolinuxkpi: Add dev_emerg
Emmanuel Vadot [Tue, 15 Feb 2022 11:05:56 +0000 (12:05 +0100)]
linuxkpi: Add dev_emerg

Needed by drm-kmod v5.8

Reviewed by: bz
MFC after: 2 weeks
Sponsored by: Beckhoff Automation GmbH & Co. KG
Differential Revision: https://reviews.freebsd.org/D34286

2 years agolinuxkpi: Add backlight_device_set_brightness
Emmanuel Vadot [Tue, 15 Feb 2022 11:05:07 +0000 (12:05 +0100)]
linuxkpi: Add backlight_device_set_brightness

This simply set the brightness of a backlight device.
Needed by drm-kmod v5.8

Reviewed by: bz, emaste
MFC after: 2 weeks
Sponsored by: Beckhoff Automation GmbH & Co. KG
Differential Revision: https://reviews.freebsd.org/D34285

2 years agolinuxkpi: Add user_write_access_*
Emmanuel Vadot [Tue, 15 Feb 2022 11:04:40 +0000 (12:04 +0100)]
linuxkpi: Add user_write_access_*

Needed by drm-kmod v5.8

Reviewed by: bz
MFC after: 2 weeks
Sponsored by: Beckhoff Automation GmbH & Co. KG
Differential Revision: https://reviews.freebsd.org/D34284

2 years agolinuxkpi: Add list_rotate_to_front
Emmanuel Vadot [Fri, 11 Feb 2022 15:10:08 +0000 (16:10 +0100)]
linuxkpi: Add list_rotate_to_front

This just calls list_move_tail.

Reviewed by: hselasky, bz
Sponsored by: Beckhoff Automation GmbH & Co. KG
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D34251

2 years agolinuxkpi: Add __var_waitqueue
Emmanuel Vadot [Fri, 11 Feb 2022 10:33:59 +0000 (11:33 +0100)]
linuxkpi: Add __var_waitqueue

This returns the wait queue based on the object but in LinuxKPI
we only have one waitqueue for this.

Reviewed by: hselasky, bz
MFC after: 2 weeks
Sponsored by: Beckhoff Automation GmbH & Co. KG
Differential Revision: https://reviews.freebsd.org/D34250

2 years agoDocument when zfree(9) was added to FreeBSD.
David E. O'Brien [Thu, 17 Feb 2022 04:03:48 +0000 (20:03 -0800)]
Document when zfree(9) was added to FreeBSD.

2 years agoDon't delete hack.c - causes perpetual 'out of date' kernel
David E. O'Brien [Mon, 14 Feb 2022 02:24:36 +0000 (18:24 -0800)]
Don't delete hack.c - causes perpetual 'out of date' kernel

Deleting hack.c cause the kernel to always be out of date:

   $ make kernel
   make: /usr/src/sys/amd64/compile/GENERIC/.depend.hack.pico, 1:
     ignoring stale .depend for hack.c
   :> hack.c
   cc -shared -O2 -pipe ... -nostdlib hack.c -o hack.pico
   rm -f hack.c
   MAKE="make" sh ../../../conf/newvers.sh "-R" GENERIC
   cc -c -O2 -pipe ...  -std=iso9899:1999 -Werror  vers.c
   ctfconvert -L VERSION -g vers.o
   linking kernel.full

Keeping hack.c in the compile directory causes no harm,
so there's no reason to delete it.

Also rename the file to "force-dyamic-hack.c" so it is
clear what the hack is aboug.

Reviewed by: sjg
Differential Revision: https://reviews.freebsd.org/D34281

2 years agoAdd a number of five letter words to the dictionary
Ed Maste [Wed, 16 Feb 2022 13:47:33 +0000 (08:47 -0500)]
Add a number of five letter words to the dictionary

(And a four letter root of one of them.)

Reviewed by: imp
Differential Revision: https://reviews.freebsd.org/D34299

2 years agoLinuxKPI: 802.11 simplify beacon checks in rx path
Bjoern A. Zeeb [Thu, 17 Feb 2022 00:58:12 +0000 (00:58 +0000)]
LinuxKPI: 802.11 simplify beacon checks in rx path

In linuxkpi_ieee80211_rx() check if the frame is a beacon once upfront
and use the result for enhanced debugging and further checks.
This was done intially for rx_status->device_timestamp debugging.

Sponsored by: The FreeBSD Foundation
MFC after: 3 days

2 years agoLinuxKPI: 802.11 advertise full offload scanning based on hw_scan only
Bjoern A. Zeeb [Thu, 17 Feb 2022 00:15:56 +0000 (00:15 +0000)]
LinuxKPI: 802.11 advertise full offload scanning based on hw_scan only

We disabled hw_scan for drivers not advertising SINGLE_SCAN_ON_ALL_BANDS.
Do not depend on this hw flag to set IEEE80211_FEXT_SCAN_OFFLOAD for
net80211 as otherwise scanning will never work.
Long-term we probably want to re-think how we do/integrate hw_scan
better in net80211.

Sponsored by: The FreeBSD Foundation
MFC after: 3 days

2 years agoLinuxKPI: 802.11: disable ic_headroom for the moment
Bjoern A. Zeeb [Wed, 16 Feb 2022 23:57:27 +0000 (23:57 +0000)]
LinuxKPI: 802.11: disable ic_headroom for the moment

There is a problem with some drivers, such as rtw88, asking for more
headroom than we currently can handle throughout the stack (we have
other legacy wireless driver in the tree with similar problems).
This may trigger an assertion in the TCP syncache where we are checking
for a reply to fit in MHLEN.
While for the moment we still copy data from mbufs to skbs,
we can simply disable the extra headroom request in ic_headroom and
deal with it ourselves (which we already did anyway).
Leave a link to the thread on freebsd-transport detailing more of the
problem so we can find it again and solve it here or there.

MFC after: 3 days

2 years agocc-wrap.mk: fix typo in modifiers
Simon J. Gerraty [Wed, 16 Feb 2022 23:21:27 +0000 (15:21 -0800)]
cc-wrap.mk: fix typo in modifiers

2 years agoClean up warnings in pthread tests
Ed Maste [Wed, 16 Feb 2022 21:10:45 +0000 (16:10 -0500)]
Clean up warnings in pthread tests

I intend to move these into lib/libthr/tests/ and connect to kyua.  This
is a first step to address warnings emitted when building using standard
make infrastructure.

Reviewed by: markj
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D34306

2 years agoIntegrate contrib/file/tests with kyua/atf
Eric van Gyzen [Wed, 16 Feb 2022 15:50:43 +0000 (09:50 -0600)]
Integrate contrib/file/tests with kyua/atf

This could be done better by making each test a separate ATF test case.
This exercise is left for the reader.

Reviewed by: delphij (earlier version)
MFC after: 1 week
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D34303