Philip Paeps [Sun, 26 Sep 2021 06:45:39 +0000 (14:45 +0800)]
contrib/tzdata: import tzdata 2021b
Merge commit '
a5725262945a2971af3b808088217fe975e8364e'
Changes: https://github.com/eggert/tz/blob/2021b/NEWS
MFC after: 3 days
Philip Paeps [Sun, 26 Sep 2021 06:35:07 +0000 (14:35 +0800)]
Import tzdata 2021b
Yoshihiro Ota [Sun, 26 Sep 2021 06:28:43 +0000 (23:28 -0700)]
kern_ctf: Use zlib's uncompress function for simpler code.
Reviewed by: markj, delphij
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D21531
Sean Bruno [Sat, 25 Sep 2021 22:23:08 +0000 (15:23 -0700)]
uart: Add PCI ID for intel 100 Series/C230 Series AMT
Reviewed by: kib
Tested by: kbowling
Differential Revision: https://reviews.freebsd.org/D32146
Alexander Motin [Sat, 25 Sep 2021 20:54:28 +0000 (16:54 -0400)]
acpi_cpu: Fix panic if some CPU devices are disabled.
While there, remove couple unneeded global variables.
Colin Percival [Sat, 25 Sep 2021 19:04:06 +0000 (12:04 -0700)]
efi loader: Call tslog_init from efi_main
We were calling tslog_init from main; no reason to wait that long.
Fixes:
f49381ccb6bc efi/loader: Call tslog_init
Sponsored by: https://www.patreon.com/cperciva
John Baldwin [Sat, 25 Sep 2021 18:51:01 +0000 (11:51 -0700)]
mount: Don't pass a NULL format string to xo_err().
This fixes a -Wformat error from GCC 9.
Fixes:
e725ee7eb672 mount: add libxo(3) support
John Baldwin [Sat, 25 Sep 2021 18:28:14 +0000 (11:28 -0700)]
mana: Cast an unused value to void to quiet a warning.
This appeases a -Wunused-value warning from GCC 9.
Reviewed by: whu
Differential Revision: https://reviews.freebsd.org/D31948
John Baldwin [Sat, 25 Sep 2021 18:25:25 +0000 (11:25 -0700)]
bhyve: Add an empty case for event types in mevent_kq_fflags().
This fixes a -Wswitch error raised by GCC 9.
Differential Revision: https://reviews.freebsd.org/D31938
John Baldwin [Sat, 25 Sep 2021 18:24:35 +0000 (11:24 -0700)]
kernel: Disable errors for -Walloca-larger-than for GCC.
GCC complains about the use of alloca() with variable sizes (for XSAVE
state len) in sendsig() for i386. Modern XSAVE state is probably
getting a bit large for the i386 kstack, but downgrade the error to a
warning.
Reviewed by: kib, emaste
Differential Revision: https://reviews.freebsd.org/D31934
John Baldwin [Sat, 25 Sep 2021 17:07:18 +0000 (10:07 -0700)]
bhyve_config.5: Document gdb.address.
John Baldwin [Sat, 25 Sep 2021 17:01:43 +0000 (10:01 -0700)]
bhyve: Update the -G description in the SYNPOSIS.
It was missing both the 'w' flag and 'bind_address'.
Yoshihiro Takahashi [Sat, 25 Sep 2021 16:32:42 +0000 (01:32 +0900)]
unzip: sync with NetBSD upstream to add passphrase support
- Add support for password protected zip archives.
We use memset_s() rather than explicit_bzero() for more portable
(See PR).
- Use success/failure macro in exit()
- Mention ZIPX format in unzip(1)
Submitted by: Mingye Wang and Alex Kozlov (ak@)
PR: 244181
Reviewed by: mizhka
Obtained from: NetBSD
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D28892
Yoshihiro Takahashi [Sat, 25 Sep 2021 16:24:33 +0000 (01:24 +0900)]
ng_ether: Create netgraph nodes for bridge interfaces.
Create netgraph nodes for bridge interfaces when the ng_ether module
is loaded. If a bridge interface is created after loading the ng_ether
module, a netgraph node is created via ether_ifattach().
MFC after: 1 week
Mateusz Guzik [Sat, 25 Sep 2021 12:49:43 +0000 (14:49 +0200)]
mmc: fix 1-byte reallocs (when it should have been sizeof device_t)
Reported by KASAN:
panic: ASan: Invalid access, 8-byte write at 0xfffffe00f0992610, RedZonePartial(1)
panic() at panic+0xb5/frame 0xffffffff86a595b0
__asan_store8_noabort() at __asan_store8_noabort+0x376/frame 0xffffffff86a59670
mmc_go_discovery() at mmc_go_discovery+0x6c61/frame 0xffffffff86a5a790
mmc_delayed_attach() at mmc_delayed_attach+0x35/frame 0xffffffff86a5a7b0
[snip]
Sponsored by: Rubicon Communications, LLC ("Netgate")
Mateusz Guzik [Sat, 25 Sep 2021 12:24:39 +0000 (14:24 +0200)]
fifo: support flock
This evens it up with Linux.
Original patch by: Greg V <greg@unrelenting.technology>
Differential Revision: https://reviews.freebsd.org/D24255#565302
Mark Johnston [Sat, 25 Sep 2021 14:18:52 +0000 (10:18 -0400)]
amd64: Remove proc0_tf, the bootstrap trapframe
It no longer serves any purpose as thread0's td_frame field is now
initialized during fpuinitstate(). No functional change intended.
Reviewed by: kib
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D32057
Mark Johnston [Sat, 25 Sep 2021 14:15:31 +0000 (10:15 -0400)]
amd64: Avoid copying td_frame from kernel procs
When creating a new thread, we unconditionally copy td_frame from the
creating thread. For threads which never return to user mode, this is
unnecessary since td_frame just points to the base of the stack or a
random interrupt frame.
If KASAN is configured this copying may also trigger false positives
since the td_frame region may contain poisoned stack regions. It was
not noticed before since thread0 used a dummy proc0_tf trapframe, and
kernel procs are generally created by thread0. Since commit
df8dd6025af88a99d34f549fa9591a9b8f9b75b1, though, we call
cpu_thread_alloc(&thread0) when initializing FPU state, which
reinitializes thread0.td_frame.
Work around the problem by not copying the frame unless the copying
thread came from user mode. While here, de-duplicate the copying and
remove redundant re(initialization) of td_frame.
Reported by: syzbot+
2ec89312bffbf38d9aec@syzkaller.appspotmail.com
Reviewed by: kib
Fixes:
df8dd6025af8
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D32057
Mark Johnston [Sat, 25 Sep 2021 14:13:56 +0000 (10:13 -0400)]
cam: Avoiding waking up doneq threads if we're dumping
Depending on the state of the target doneq thread at the time of the
panic, the wakeup can hang indefinitely in thread_lock_block_wait().
That function should likely be modified to return immediately if the
scheduler is stopped, but it is also preferable to avoid wakeups in
general after a panic.
Reported by: pho
Reviewed by: mav, imp
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D32126
Konstantin Belousov [Fri, 24 Sep 2021 17:46:47 +0000 (20:46 +0300)]
x86 bounce_bus_dmamem_alloc(): use malloc_aligned() only when possible
malloc_domainset_aligned() requires that alignment is less than
page size. Fall back to other allocation methods, most likely
kmem_alloc_contig(), when malloc_aligned() cannot fullfill the driver
request.
Reported by: Loic F <loic.f@hardenedbsd.org>
Reviewed by: markj
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D32127
Konstantin Belousov [Fri, 24 Sep 2021 19:38:53 +0000 (22:38 +0300)]
malloc_aligned(9): allow zero size and alignment
For alignment we do not need to do anything to make it operational.
For size, upgrade zero sized request to one byte so that we do not
request insane amount of memory for placeholder.
Reviewed by: markj
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D32127
Gordon Bergling [Sat, 25 Sep 2021 11:57:41 +0000 (13:57 +0200)]
net80211(4): Fix a few common typos in source code comments
- s/annoucement/announcement/
- s/setings/settings/
MFC after: 1 week
Gordon Bergling [Sat, 25 Sep 2021 09:47:24 +0000 (11:47 +0200)]
ubsan: Fix a typo in an error message
- s/asumption/assumption/
Obtained from: NetBSD
MFC after: 1 week
Kyle Evans [Sat, 25 Sep 2021 05:00:31 +0000 (00:00 -0500)]
hostname: avoid strcpy() overlap in -d flag handling
We don't need the strcpy() anyways, just use a pointer to the hostname
buffer and move it forward for `hostname -d`.
Sponsored by: Klara, Inc.
Marko Zec [Sat, 25 Sep 2021 04:29:48 +0000 (06:29 +0200)]
[fib_algo][dxr] Split unused range chunk list in multiple buckets
Traversing a single list of unused range chunks in search for a block
of optimal size was suboptimal.
The experience with real-world BGP workloads has shown that on average
unused range chunks are tiny, mostly in length from 1 to 4 or 5, when
DXR is configured with K = 20 which is the current default (D16X4R).
Therefore, introduce a limited amount of buckets to accomodate descriptors
of empty blocks of fixed (small) size, so that those can be found in O(1)
time. If no empty chunks of the requested size can be found in fixed-size
buckets, the search continues in an unsorted list of empty chunks of
variable lengths, which should only happen infrequently.
This change should permit us to manage significantly more empty range
chunks without sacrifying the speed of incremental range table updating.
MFC after: 3 days
Alexander Motin [Sat, 25 Sep 2021 03:25:46 +0000 (23:25 -0400)]
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.
Colin Percival [Sat, 25 Sep 2021 03:20:33 +0000 (20:20 -0700)]
loader printf: Profile with TSLOG
Now that the loader tslog code doesn't call printf, we can profile
printf using TSLOG. On an EC2 c5.xlarge instance, we spend roughly
45 ms here (out of roughly 500 ms), presumably due to the time spent
writing output to the console.
MFC after: 1 week
Sponsored by: https://www.patreon.com/cperciva
Colin Percival [Sat, 25 Sep 2021 03:19:38 +0000 (20:19 -0700)]
loader tslog: Don't use sprintf
Instead, append the log entry "manually".
MFC after: 1 week
Sponsored by: https://www.patreon.com/cperciva
Kyle Evans [Wed, 27 Jan 2021 18:12:33 +0000 (12:12 -0600)]
makesyscalls: sprinkle some assert() on standard function calls
Improves our error reporting, ensuring that we aren't just ignoring
errors in the common case.
Note specifically the boundary where we have to change up our error
handling approach. It's fine to error() out up until we create the
tempdir, then the rest should try to handle it gracefully and abort().
A future change will clean this up further by pcall'ing all of the bits
that cannot currently error() without cleaning up.
Kyle Evans [Fri, 24 Sep 2021 01:04:36 +0000 (20:04 -0500)]
makesyscalls: rip out arbitrary command execution
This was previously needed only for CloudABI, which used it to generate
its capenabled from syscalls.master. CloudABI was removed in
cf0ee8738e31, so we don't need to support this anymore. Others looking
to do similar things should come up with a more integrated technique,
such as a .conf flag or pattern/glob support. brooks suggests that it
could be done in modern makesyscalls.lua by adding a config flag to
specify always-on/initial flags (CAPENABLED).
Reviewed by: brooks, imp
MFC after: never
Differential Revision: https://reviews.freebsd.org/D32095
Kyle Evans [Wed, 27 Jan 2021 17:46:15 +0000 (11:46 -0600)]
makesyscalls: stop trying to remove . and .. in cleanup
lfs.dir() will include these entries, but os.remove() cannot remove them
for obvious reasons.
Alexander Motin [Sat, 25 Sep 2021 01:03:02 +0000 (21:03 -0400)]
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).
Kevin Bowling [Sat, 25 Sep 2021 00:09:43 +0000 (17:09 -0700)]
e1000: Rename 'struct adapter' to 'struct e1000_sc'
Rename the 'struct adapter' to 'struct e1000_sc' to avoid type ambiguity
in things like kgdb.
Reviewed by: jhb, markj
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D32129
Alexander Motin [Sat, 25 Sep 2021 00:27:10 +0000 (20:27 -0400)]
bus: Cleanup device_probe_child()
When device driver probe method returns 0, i.e. absolute priority, do
not remove its class from the device just to set it back few lines
later, that may change the device unit number, etc. and after which
we'd better call the probe again.
If during search we found some driver with absolute priority, we do
not need to set device driver and class since we haven't removed them
before.
It should not happen, but if second probe method call failed, remove
the driver and possibly the class from the device as it was when we
started.
Reviewed by: imp, jhb
Differential Revision: https://reviews.freebsd.org/D32125
Cameron Katri [Thu, 23 Sep 2021 20:51:30 +0000 (22:51 +0200)]
mount: add libxo(3) support
Adds --libxo to mount(8).
Differential Revision: https://reviews.freebsd.org/D30341
Warner Losh [Fri, 24 Sep 2021 20:03:10 +0000 (14:03 -0600)]
bus: Fix LINT / BUS_DEBUG build
Fix
0389e9be63c5e for LINT built. Removed an arg only from code
under BUS_DEBUG w/o rebuilding LINT...
Sponsored by: Netflix
Fixes:
0389e9be63c5e24ecedbb366c5682ddc2ff4de60
Math Ieu [Fri, 24 Sep 2021 06:58:40 +0000 (08:58 +0200)]
ps: fix `ps -aa`
Passing the -a flag multiple times made ps show no processes.
Differential Revision: https://reviews.freebsd.org/D27215
Mark Johnston [Fri, 24 Sep 2021 19:04:45 +0000 (15:04 -0400)]
opencrypto: Disallow requests which pass VERIFY_DIGEST without a MAC
Otherwise we can end up comparing the computed digest with an
uninitialized kernel buffer.
In cryptoaead_op() we already unconditionally fail the request if a
pointer to a digest buffer is not specified.
Based on a patch by Simran Kathpalia.
Reported by: syzkaller
Reviewed by: jhb
MFC after: 1 week
Pull Request: https://github.com/freebsd/freebsd-src/pull/529
Differential Revision: https://reviews.freebsd.org/D32124
Toomas Soome [Fri, 24 Sep 2021 14:07:20 +0000 (17:07 +0300)]
loader: dev_net.c should use __func__ with printf
We have printf calls with function name hardwired to string,
sometimes wrong name. Use __func__ instead.
MFC after: 1 week
Cy Schubert [Fri, 24 Sep 2021 18:18:42 +0000 (11:18 -0700)]
ipfilter: Locking sysctls here is not required
Locking of data structures touched by sysctls is more finely locked
in ipflter therefore higher level locks are redundant.
MFC after: 3 days
Cy Schubert [Wed, 22 Sep 2021 04:58:08 +0000 (21:58 -0700)]
ipfilter: Avoid a null if-then-else blocks
When WITHOUT_INET6 is selected we generate a null if-then-else blocks
due to incorrect placment of #if statments. Move the #if statements
reducing unnecessary runtime comparisons WITHOUT_INET6.
MFC after: 1 week
Mark Johnston [Fri, 24 Sep 2021 18:35:38 +0000 (14:35 -0400)]
cxgbe: Mark received packets as initialized for KMSAN
The KMSAN runtime needs to have its shadow maps updated when devices
update host memory, otherwise it assumes that device-populated memory is
uninitialized. For most drivers this is handled transparently by
busdma, but cxgbe doesn't make use of dma maps for receive buffers and
so requires special treatment.
Reported by: mjg
Tested by: mjg
Reviewed by: np
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D32102
Bryan Drewery [Sat, 23 May 2020 17:01:45 +0000 (10:01 -0700)]
read builtin: Empty variables on timeout
This matches how a non-timeout error is handled.
Reviewed by: jilles
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D31876
Warner Losh [Fri, 24 Sep 2021 18:10:18 +0000 (12:10 -0600)]
bus: retire DF_REBID
I did DF_REBID to allow for 'hoover' drivers that would attach to
otherwise unattached devices in the tree. This notion didn't catch on as
it was tricky to make work well and it was easier to just publish a /dev
node of some flavor by the parent device. It's been nothing but dead
weight for a long time.
Reviewed by: mav
Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D32056
Konstantin Belousov [Fri, 24 Sep 2021 03:12:20 +0000 (06:12 +0300)]
pidfile test: guarantee nul termination of the read pid string
PR: 258701
Based on the submission by: sigsys@gmail.com
MFC after: 1 week
Mark Johnston [Fri, 24 Sep 2021 15:31:53 +0000 (11:31 -0400)]
tests/sys/sys: Raise WARNS
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
Kristof Provost [Fri, 24 Sep 2021 12:19:39 +0000 (14:19 +0200)]
UPDATING: new entry about dummynet
Dummynet now no longer requires ipfw, so any users relying on this
dependency to load ipfw will need to explicitly load ipfw.
While here fix a typo in the date of the previous entry.
Sponsored by: Rubicon Communications, LLC ("Netgate")
Kristof Provost [Fri, 24 Sep 2021 08:31:27 +0000 (10:31 +0200)]
cxgbe: fix LINT-NOIP builds
The -NOIP builds fail because cxgbe_tls_tag_free() has no prototype (if
neither INET nor INET6 are defined). The function isn't actually used
in that case, so we can just remove the stub implementation.
Sponsored by: Rubicon Communications, LLC ("Netgate")
Kristof Provost [Fri, 10 Sep 2021 12:42:44 +0000 (14:42 +0200)]
pf.conf.5: document dummynet support
MFC after: 2 weeks
Sponsored by: Rubicon Communications, LLC ("Netgate")
Differential Revision: https://reviews.freebsd.org/D31907
Kristof Provost [Fri, 10 Sep 2021 11:03:24 +0000 (13:03 +0200)]
man dummynet: dummynet can also be used with pf
MFC after: 2 weeks
Sponsored by: Rubicon Communications, LLC ("Netgate")
Differential Revision: https://reviews.freebsd.org/D31906
Kristof Provost [Mon, 6 Sep 2021 15:13:19 +0000 (17:13 +0200)]
netpfil tests: extend dummynet tests to pf
Now that pf can also use dummynet we should extend the existing dummynet
tests to also test it when used with pf.
Reviewed by: donner
MFC after: 2 weeks
Sponsored by: Rubicon Communications, LLC ("Netgate")
Differential Revision: https://reviews.freebsd.org/D31905
Kristof Provost [Sat, 15 May 2021 11:49:22 +0000 (13:49 +0200)]
pf: support dummynet
Allow pf to use dummynet pipes and queues.
We re-use the currently unused IPFW_IS_DUMMYNET flag to allow dummynet
to tell us that a packet is being re-injected after being delayed. This
is needed to avoid endlessly looping the packet between pf and dummynet.
MFC after: 2 weeks
Sponsored by: Rubicon Communications, LLC ("Netgate")
Differential Revision: https://reviews.freebsd.org/D31904
Kristof Provost [Thu, 13 May 2021 13:56:50 +0000 (15:56 +0200)]
dummynet: Does not depend on ipfw
Allow the dummynet module to be loaded without ipfw, as a first step
towards making pf use it for packet scheduling.
Reviewed by: donner
Sponsored by: Rubicon Communications, LLC ("Netgate")
Differential Revision: https://reviews.freebsd.org/D31903
Kristof Provost [Fri, 10 Sep 2021 09:50:55 +0000 (11:50 +0200)]
man dummynet: point to dnctl instead of ipfw
Dummynet configuration is ideally done through dnctl now. While ipfw
still works dnctl is preferred now that dummynet can also be used with
pf.
MFC after: 2 weeks
Sponsored by: Rubicon Communications, LLC ("Netgate")
Differential Revision: https://reviews.freebsd.org/D31902
Bartlomiej Grzesik [Fri, 24 Sep 2021 08:27:21 +0000 (10:27 +0200)]
ipsec: Add support for PMTUD for IPv6 tunnels
Discard and send ICMPv6 Packet Too Big to sender when we try to encapsulate
and forward a packet which total length exceeds the PMTU.
Logic is based on the IPv4 implementation.
Common code was moved to a separate function.
Differential revision: https://reviews.freebsd.org/D31771
Obtained from: Semihalf
Sponsored by: Stormshield
Bartlomiej Grzesik [Fri, 24 Sep 2021 08:25:53 +0000 (10:25 +0200)]
ipsec: If no PMTU in hostcache assume it's equal to link's MTU
If we fail to find to PMTU in hostcache, we assume it's equal
to link's MTU.
This patch prevents packets larger then link's MTU to be dropped
silently if there is no PMTU in hostcache.
Differential revision: https://reviews.freebsd.org/D31770
Obtained from: Semihalf
Sponsored by: Stormshield
Bartlomiej Grzesik [Fri, 24 Sep 2021 08:17:11 +0000 (10:17 +0200)]
ipsec: Add PMTUD support for IPsec IPv4 over IPv6 tunnel
Add support for checking PMTU for IPv4 packets encapsulated in IPv6 tunnels.
Differential revision: https://reviews.freebsd.org/D31769
Sponsored by: Stormshield
Obtained from: Semihalf
Jason A. Harmening [Sun, 12 Sep 2021 05:43:57 +0000 (22:43 -0700)]
unionfs: lock newly-created vnodes before calling insmntque()
This fixes an insta-panic when attempting to use unionfs with
DEBUG_VFS_LOCKS. Note that unionfs still has a long way to
go before it's generally stable or usable.
Reviewed by: kib (prior version), markj
Tested by: pho
Differential Revision: https://reviews.freebsd.org/D31917
Nathaniel Wesley Filardo [Fri, 24 Sep 2021 00:31:39 +0000 (17:31 -0700)]
kqueue: Add EV_KEEPUDATA flag
When this flag is set, operations that update an existing kevent will
not change the udata field. This can be used to NOTE_TRIGGER or
EV_{EN,DIS}ABLE events without overwriting the stashed pointer.
Reviewed by: Domagoj Stolfa <domagoj.stolfa@gmail.com>
Obtained from: CheriBSD
Sponsored by: Microsoft
Differential Revision: https://reviews.freebsd.org/D30286
Nathaniel Wesley Filardo [Fri, 24 Sep 2021 00:31:39 +0000 (17:31 -0700)]
libsysdecode: Permit _ in VM_PROT_(.*) names.
CheriBSD defines additional protection flags which use underscores
such as VM_PROT_READ_CAP and VM_PROT_WRITE_CAP.
Obtained from: CheriBSD
Sponsored by: Microsoft
Differential Revision: https://reviews.freebsd.org/D30017
Konstantin Belousov [Fri, 24 Sep 2021 00:14:56 +0000 (03:14 +0300)]
aio_aqueue(): avoid ucred leak on failure path
PR: 258698
Submitted by: sigsys@gmail.com
MFC after: 1 week
Warner Losh [Thu, 23 Sep 2021 22:31:32 +0000 (16:31 -0600)]
nvme: Use shared timeout rather than timeout per transaction
Keep track of the approximate time commands are 'due' and the next
deadline for a command. twice a second, wake up to see if any commands
have entered timeout. If so, quiessce and then enter a recovery mode
half the timeout further in the future to allow the ISR to
complete. Once we exit recovery mode, we go back to operations as
normal.
Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D28583
Kristof Provost [Thu, 23 Sep 2021 08:39:49 +0000 (10:39 +0200)]
pf: fix pagefault in pf_getstatus()
We can't copyout() while holding a lock, in case it triggers a page
fault.
Release the lock before copyout, which is safe because we've already
copied all the data into the nvlist.
PR: 258601
Reviewed by: mjg
MFC after: 1 week
Sponsored by: Modirum MDPay
Differential Revision: https://reviews.freebsd.org/D32076
Wenzhuo Lu [Fri, 16 Oct 2015 02:51:09 +0000 (10:51 +0800)]
e1000: fix K1 configuration
This patch is for the following updates to the K1 configurations:
Tx idle period for entering K1 should be 128 ns.
Minimum Tx idle period in K1 should be 256 ns.
Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
PR: 258153
Reviewed by: erj
Tested by: iron.udjin@gmail.com
Approved by: imp
Obtained from: DPDK (
6f934fa24dfd437c90ead96bc7598ee77a117ede)
MFC after: 1 week
Kyle Evans [Wed, 22 Sep 2021 19:58:19 +0000 (14:58 -0500)]
man: reset OPTIND before parsing args
From jilles: POSIX requires that a script set `OPTIND=1` before using
different sets of parameters with `getopts`, or the results will be
unspecified.
The specific problem observed here is that we would execute `man -f` or
`man -k` without cleaning up state from man_parse_args()' `getopts`
loop. FreeBSD's /bin/sh seems to reset OPTIND to 1 after we hit the
second getopts loop, rendering the following shift harmless; other
/bin/sh implementations will leave it at what we came into the loop at
(e.g., bash as /bin/sh), shifting off any keywords that we had.
Input from: jilles
Reviewed by: allanjude, bapt, imp
Sponsored by: Klara, Inc.
Differential Revision: https://reviews.freebsd.org/D32063
Alexander Motin [Thu, 23 Sep 2021 17:41:02 +0000 (13:41 -0400)]
x86: Add NUMA nodes into CPU topology.
Depending on hardware, NUMA nodes may match last level caches, or
they may be above them (AMD Zen 2/3) or below (Intel Xeon w/ SNC).
This information is provided by ACPI instead of CPUID, and it is
provided for each CPU individually instead of mask widths, but
this code should be able to properly handle all the above cases.
This change should immediately allow idle stealing in sched_ule(4)
to prefer load from NUMA-local CPUs to remote ones when the node
does not match LLC. Later we may think of how to better handle it
on sched_pickcpu() side.
MFC after: 1 month
Randall Stewart [Thu, 23 Sep 2021 15:43:29 +0000 (11:43 -0400)]
tcp: Rack compressed ack path updates the recv window too easily
The compressed ack path of rack is not following proper procedures in updating
the peers window. It should be checking the seq and ack values before updating and
instead it is blindly updating the values. This could in theory get the wrong window
in the connection for some length of time.
Reviewed by: tuexen
Sponsored by: Netflix Inc.
Differential Revision: https://reviews.freebsd.org/D32082
Randall Stewart [Thu, 23 Sep 2021 14:54:23 +0000 (10:54 -0400)]
tcp: Two bugs in rack one of which can lead to a panic.
In extensive testing in NF we have found two issues inside
the rack stack.
1) An incorrect offset is being generated by the fast send path when a fast send is initiated on
the end of the socket buffer and before the fast send runs, the sb_compress macro adds data to the trailing socket.
This fools the fast send code into thinking the sb offset changed and it miscalculates a "updated offset".
It should only do that when the mbuf in question got smaller.. i.e. an ack was processed. This can lead to
a panic deref'ing a NULL mbuf if that packet is ever retransmitted. At the best case it leads to invalid data being
sent to the client which usually terminates the connection. The fix is to have the proper logic (that is in the rsm fast path)
to make sure we only update the offset when the mbuf shrinks.
2) The other issue is more bothersome. The timestamp check in rack needs to use the msec timestamp when
comparing the timestamp echo to now. It was using a microsecond timestamp which ends up giving error
prone results but causes only small harm in trying to identify which send to use in RTT calculations if its a retransmit.
Reviewed by: tuexen
Sponsored by: Netflix Inc.
Differential Revision: https://reviews.freebsd.org/D32062
Ed Maste [Wed, 22 Sep 2021 18:41:00 +0000 (14:41 -0400)]
vt: bound buffer access in redraw optimization
PR: 248628
Reported by: oleg
Reviewed by: cem, oleg (both earlier)
Fixes:
ee97b2336aa4 ("Speed up vt(4) by keeping...")
MFC after: 3 days
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D32059
Michael Tuexen [Thu, 23 Sep 2021 12:16:56 +0000 (14:16 +0200)]
sctp: Cleanup stream schedulers.
No functional change intended.
MFC after: 1 week
Arnaud Ysmal [Thu, 23 Sep 2021 08:57:11 +0000 (10:57 +0200)]
LACP: Do not wait response for marker messages not sent
The error returned when a marker message can not be emitted on a port is not handled.
This cause the lacp to block all emissions until the timeout of 3 seconds is reached.
To fix this issue, I just clear the LACP_PORT_MARK flag when the packet could not be emitted.
Differential revision: https://reviews.freebsd.org/D30467
Obtained from: Stormshield
Stephane Rochoy [Thu, 23 Sep 2021 08:53:56 +0000 (10:53 +0200)]
veriexec: Fix veriexec -i's confusion between loaded and locked states
Calling veriexec -i locked return the state of loaded and vice-versa.
Differential revision: https://reviews.freebsd.org/D30952
Reviewed by: sjg,imp
Obtained from: Stromshield
Stephane Rochoy [Thu, 23 Sep 2021 08:40:59 +0000 (10:40 +0200)]
sh: Add -o verify to use O_VERIFY when sourcing scripts
Add -o verify to sh to make it use O_VERIFY when
sourcing scripts and reading profiles.
Useful in conjunction with mac_veriexec to help protect at
least some parts of the boot sequence, e.g., /etc/rc*.
Differential revision: https://reviews.freebsd.org/D30464
Reviewed by: jilles, sjg
Obtained from: Stormshield
Hans Petter Selasky [Thu, 23 Sep 2021 07:49:01 +0000 (09:49 +0200)]
UPDATING: Fix spelling.
Submitted by: gljennjohn@gmail.com
Differential Revision: https://reviews.freebsd.org/D31636
Sponsored by: NVIDIA Networking
Kyle Evans [Mon, 20 Sep 2021 05:46:21 +0000 (00:46 -0500)]
kern: random: collect ~16x less from fast-entropy sources
Previously, we were collecting at a base rate of:
64 bits x 32 pools x 10 Hz = 2.5 kB/s
This change drops it to closer to 64-ish bits per pool per second, to
work a little better with entropy providers in virtualized environments
without compromising the security goals of Fortuna.
Reviewed by: #csprng (cem, delphij, markm)
Differential Revision: https://reviews.freebsd.org/D32021
Kyle Evans [Mon, 20 Sep 2021 04:59:09 +0000 (23:59 -0500)]
kern: random: drop read_rate and associated functionality
Refer to discussion in PR 230808 for a less incomplete discussion, but
the gist of this change is that we currently collect orders of magnitude
more entropy than we need.
The excess comes from bytes being read out of /dev/*random. The default
rate at which we collect entropy without the read_rate increase is
already more than we need to recover from a compromise of an internal
state.
Reviewed by: #csprng (cem, delphij, markm)
Differential Revision: https://reviews.freebsd.org/D32021
Wojciech Macek [Mon, 20 Sep 2021 11:08:32 +0000 (13:08 +0200)]
hwpmc: fix performance issues
Differential revision: https://reviews.freebsd.org/D32025
Avoid using atomics as it_wait is guarded by td_lock.
Report threshold calculation is done only if at least one PMC hook
is installed
Fixes:
* avoid unnecessary branching (if frame != null ...)
by having PMC_HOOK_INSTALLED_ANY
condition on the top of them, which should hint
the core not to execute speculatively anything
which us underneath;
* access intr_hwpmc_waiting_report_threshold cacheline
only if at least one hook is loaded;
Wojciech Macek [Wed, 22 Sep 2021 07:52:42 +0000 (09:52 +0200)]
pmc: intr pmc.soft(3) update
Obtained from: Semihalf
Sponsored by: Stormshield
Reviewed by: mhorne
Differential revision: https://reviews.freebsd.org/D32055
Baptiste Daroussin [Thu, 23 Sep 2021 02:48:50 +0000 (04:48 +0200)]
check-links.sh: treat PIE executable as elf files
Konstantin Belousov [Wed, 22 Sep 2021 22:47:10 +0000 (01:47 +0300)]
tests/sys/fs/fusefs/read.cc: fix build on powerpc64
There sig_atomic_t is shorter than void *.
As result, it cannot keep pointer.
Assigning to void * is actually safe for us in a signal handler.
Reviewed by: asomers
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Fixes:
4f917847c9037d
Differential revision: https://reviews.freebsd.org/D32064
John Baldwin [Thu, 23 Sep 2021 00:02:17 +0000 (17:02 -0700)]
sysdecode.3: Remove documentation of CloudABI ABIs.
Fixes:
cf0ee8738e31 Drop cloudabi
Olivier Houchard [Wed, 22 Sep 2021 23:23:07 +0000 (01:23 +0200)]
truss: Decode correctly 64bits arguments on 32bits arm.
Mostly revert
ebbc3140ca0d7eee154f7a67ccdae7d3d88d13fd.
We don't need to special-case anything for arm64, the check for the pointer
size is already done for us, just keep the bits about having arm and arm64
having to add padding for 32bits binaries.
MFC after: 1 week
Kirk McKusick [Wed, 22 Sep 2021 23:16:39 +0000 (16:16 -0700)]
Eliminate an unnecessary rerun request in fsck_ffs.
When fsck_ffs is running in preen mode and finds a zero-length directory,
it deletes that directory. In doing this operation, it unnecessary set
its internal flag saying that fsck_ffs needed to be rerun. This patch
deletes the rerun request for this case.
Reported by: Mark Johnson
PR: 246962
MFC after: 1 week
Sponsored by: Netflix
Olivier Houchard [Wed, 22 Sep 2021 22:45:42 +0000 (00:45 +0200)]
truss: Decode correctly 64bits arguments on 32bits arm.
When decoding 32bits arm syscall, make sure we account for the padding when
decoding 64bits args. Do it too when using a 64bits truss on a 32bits binary.
MFC After: 1 week
PR: 256199
Olivier Houchard [Wed, 22 Sep 2021 22:22:30 +0000 (00:22 +0200)]
libsysdecode: Decode FreeBSD32 syscalls on arm64.
Add aarch64 to the list of architectures that can run 32bits FreeBSD binaries,
so that truss works correctly with an arm32 binary.
The same should probably be done with mips.
MFC After: 1 week
Piotr Pawel Stefaniak [Wed, 22 Sep 2021 16:42:41 +0000 (18:42 +0200)]
sh: try to avoid overwriting HISTFILE produced by other shells
If an attempt to load history from an existing history file was
unsuccessful, do not try to save command history to that file on exit.
Piotr Pawel Stefaniak [Wed, 22 Sep 2021 16:23:29 +0000 (18:23 +0200)]
sh: improve command completion
When there are many matches, find the longest common substring starting
from the beginning of each command and use that to replace input.
As an example: on my system, llv<tab> will be autocompleted to llvm-
and another <tab> will print all matching llvm commands.
Konstantin Belousov [Wed, 22 Sep 2021 18:54:39 +0000 (21:54 +0300)]
Revert "linux32: add a hack to avoid redefining the type of the savefpu tag"
This reverts commit
0f6829488ef32142b9ea1c0806fb5ecfe0872c02.
Also it changes the type of md_usr_fpu_save struct mdthread member
to void *, which is what uncovered this trouble. Now the save area
is untyped, but since it is hidden behind accessors, it is not too
significant. Since apparently there are consumers affected outside
the tree, this hack is better than one from the reverted revision.
PR: 258678
Reported by: cy
Reviewed by: cy, kevans, markj
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D32060
Hans Petter Selasky [Wed, 22 Sep 2021 20:09:23 +0000 (22:09 +0200)]
rc.d/mixer: Use -o flag instead of -s flag to get current mixer state.
Submitted by: christos@
Differential Revision: https://reviews.freebsd.org/D31636
Sponsored by: NVIDIA Networking
Hans Petter Selasky [Wed, 22 Sep 2021 20:01:12 +0000 (22:01 +0200)]
mixer(3) and mixer(8): Update manual pages.
- Use correct e-mail address.
- Set FreeBSD 14.0 as introduction for the updated mixer(8) utility.
Submitted by: christos@
Differential Revision: https://reviews.freebsd.org/D31636
Sponsored by: NVIDIA Networking
Hans Petter Selasky [Wed, 22 Sep 2021 18:56:34 +0000 (20:56 +0200)]
mixer(8): Compile fix for when the "char" type is unsigned.
Differential Revision: https://reviews.freebsd.org/D31636
Sponsored by: NVIDIA Networking
Hans Petter Selasky [Wed, 22 Sep 2021 14:47:25 +0000 (16:47 +0200)]
UPDATING: Add new entry about mixer(8) usage.
Differential Revision: https://reviews.freebsd.org/D31636
Sponsored by: NVIDIA Networking
Hans Petter Selasky [Wed, 22 Sep 2021 13:42:51 +0000 (15:42 +0200)]
Implement and use new mixer(3) library for FreeBSD.
Wiki article: https://wiki.freebsd.org/SummerOfCode2021Projects/SoundMixerImprovements
This project was part of Google Summer of Code 2021.
Submitted by: christos@
Differential Revision: https://reviews.freebsd.org/D31636
Sponsored by: NVIDIA Networking
Alexander Motin [Wed, 22 Sep 2021 12:42:36 +0000 (08:42 -0400)]
Fix false device_set_unit() error.
It should silently succeed if the current unit number is the same as
requested, not fail immediately.
MFC after: 1 week
Stefan Eßer [Wed, 22 Sep 2021 11:59:01 +0000 (13:59 +0200)]
ObsoleteFiles.inc: Add sponge(1) command and man-page
The sponge command has been imported on 2017-12-05 but the import has
been reverted the next day.
A script failed and I found that it was due to the left-over broken
sponge binary in base being prefered over the port version. To prevent
a known non-working binary to persist in /usr/bin, I'm adding sponge
to the obsolete files list even though it could only be installed on
a single day in 2017.
I do not plan to MFC this change since the issue will only exist on
systems installed from -CURRENT sources in 2017, and I do assume that
such systems are not running -STABLE today
Baptiste Daroussin [Wed, 22 Sep 2021 09:12:04 +0000 (11:12 +0200)]
dma: make the version exposed reflect the new version
Baptiste Daroussin [Wed, 22 Sep 2021 09:09:27 +0000 (11:09 +0200)]
dma: import snapshot 2021-07-10
Piotr Pawel Stefaniak [Sun, 19 Sep 2021 20:17:01 +0000 (22:17 +0200)]
sh: reset sh bindings on bind -e, bind -v
Until this change, any bindings set in histedit() were lost on calls to
bindcmd().
Only bind -e and bind -v call libedit's keymacro_reset(). Currently you
cannot fool libedit/map.c:map_bind() by trying something like bind -le
as when p[0] == '-', it does a switch statement on p[1].
Baptiste Daroussin [Wed, 22 Sep 2021 08:52:34 +0000 (10:52 +0200)]
dma: import git snapshot 2021-07-10
Baptiste Daroussin [Wed, 22 Sep 2021 08:27:10 +0000 (10:27 +0200)]
sh: remove emacs improvements that are now defaults in libedit