The command openssl-rsautl(1) has been deprecated in OpenSSL 3.0. The
openssl-pkeyutl(1) command should be used instead.
Signed-off-by: Jose Luis Duran <jlduran@gmail.com>
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/1309
When the module is loaded on a system running on qemu/kvm the "modern"
virtio infrastructure is used and virtio_read_device_config() will end
up calling vtpci_modern_read_dev_config(). This function cannot read
values of arbitrary sizes and will panic if the p9fs mount tag size is
not supported by it.
Use virtio_read_device_config_array() instead. It was tested on both
bhyve and qemu/kvm.
PR: 280098
Co-authored-by: Mark Peek <mp@FreeBSD.org>
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/1320
In pmap_protect(), when the mapping isn't changing, we don't need to
perform a superpage demotion, even though the requested change doesn't
cover the entire superpage.
Reviewed by: kib
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D45886
In our products, we need those options to support our features.
Add daemon mode option for mountd, nfsd.
Add skip local host binding option for rpcd.
Add skip local host binding option for mountd.
Reviewed by: rmacklem
Differential Revision: https://reviews.freebsd.org/D45118
For some reason, my tests were fine with this like it was, but CI for
gcc12 and gcc13 is complaining. Revert to the old form until that can be
worked out why the mismatch.
Fixes: 0b82dac337
Sponsored by: Netflix
In sndstat_build_sound4_nvlist(), if we have INVARIANTS or
SND_DIAGNOSTIC enabled, we will hit a lock assertion panic when we call
CHN_GETVOLUME(). Also lock the channel in the sndstat_prepare_pcm() loop
for good measure.
Fixes: bbca3a75bb ("sound: Include sound(4) channel information in sndstat nvlist")
Sponsored by: The FreeBSD Foundation
MFC after: 2 days
Reviewed by: dev_submerge.ch
Differential Revision: https://reviews.freebsd.org/D45898
If the channel list is empty, min_rate and min_channels will be INT_MAX.
Instead, assign them to 0, like we do in sndstat_get_caps().
Sponsored by: The FreeBSD Foundation
MFC after: 2 days
Reviewed by: dev_submerge.ch
Differential Revision: https://reviews.freebsd.org/D45876
The current implementation of sndstat_get_caps() does not work properly
when VCHANs are enabled, as it skips all information about physical
channels, and also assigns the min/max rates and channels to same
values, which is usually not the case. A device either supports any
sample rate within the [feeder_rate_min, feeder_rate_max] range, or
[hw_rate_min, hw_rate_max] range when the device is opened in exclusive
or bitperfect mode. The number of channels can also vary and is not
always the same for both min and max.
Refactor the whole function to resemble the way we handle fetching of
these values in dsp_oss_audioinfo() and dsp_oss_engineinfo().
Sponsored by: The FreeBSD Foundation
MFC after: 2 days
Reviewed by: dev_submerge.ch
Differential Revision: https://reviews.freebsd.org/D45872
Since we allow feeding of any rate within the [feeder_rate_min,
feeder_rate_max] range, report this as the min/max rate as well. Only
exceptions are when we the device is opened in exclusive or bitperfect
mode.
Sponsored by: The FreeBSD Foundation
MFC after: 2 days
Reviewed by: dev_submerge.ch
Differential Revision: https://reviews.freebsd.org/D45862
midistat_lock is used outside midi/midi.c as well, so implement lock,
unlock and lockassert functions in order not to expose the lock in the
header file.
Sponsored by: The FreeBSD Foundation
MFC after: 2 days
Reviewed by: emaste
Differential Revision: https://reviews.freebsd.org/D45857
No reason to have this as a macro.
While here, change the second case to an "else if" as there is no reason
to check it if the open flags are invalid.
Sponsored by: The FreeBSD Foundation
MFC after: 2 days
Reviewed by: dev_submerge.ch, markj, emaste
Differential Revision: https://reviews.freebsd.org/D45776
If we are in simplex mode, make sure we do not open in both directions
(read/write) and also that we do not open in a direction opposite of
what is already opened. For example, if the device is already doing
playback, we cannot open the device for recording at the same time, and
vice-versa.
While here, remove dsp_cdevpriv->simplex as it's no longer needed.
Sponsored by: The FreeBSD Foundation
MFC after: 2 days
Reviewed by: dev_submerge.ch
Differential Revision: https://reviews.freebsd.org/D45835
Remove all special handling for SIMPLEX, since we can just fetch the
channel directly.
While here:
- Get rid of a no-op getchns() call in dsp_ioctl().
- Rename getchns() to dsp_lock_chans(), and relchns() to
dsp_unlock_chans().
- Simplify DSP_FIXUP_ERROR(), as we do not longer assign SD_F_PRIO*
flags to the softc.
Sponsored by: The FreeBSD Foundation
MFC after: 2 days
Reviewed by: dev_submerge.ch
Differential Revision: https://reviews.freebsd.org/D45775
No good reason to have this. It only makes things harder to read.
Sponsored by: The FreeBSD Foundation
MFC after: 2 days
Reviewed by: dev_submerge.ch, markj
Differential Revision: https://reviews.freebsd.org/D45773
This information is also printed to dmesg(8) on attach.
Sponsored by: The FreeBSD Foundation
MFC after: 2 days
Reviewed by: dev_submerge.ch, markj
Differential Revision: https://reviews.freebsd.org/D45771
Opening /dev/sequencer after a clean reboot yields:
lock order reversal: (sleepable after non-sleepable)
1st 0xfffffe004a2c2c08 seqflq (seqflq, sleep mutex) @ /mnt/src/sys/dev/sound/midi/sequencer.c:754
2nd 0xffffffff84197ed8 midistat lock (midistat lock, sx) @ /mnt/src/sys/dev/sound/midi/midi.c:1478
lock order seqflq -> midistat lock attempted at:
0xffffffff811c9029 at witness_checkorder+0x12b9
0xffffffff810f18a7 at _sx_xlock+0xf7
0xffffffff8417f992 at midimapper_open+0x22
0xffffffff84182770 at mseq_open+0xf0
0xffffffff80e3380f at devfs_open+0x30f
0xffffffff81b8b4b7 at VOP_OPEN_APV+0x57
0xffffffff812da1e7 at vn_open_vnode+0x397
0xffffffff812d96b3 at vn_open_cred+0xb23
0xffffffff812c2c6b at openatfp+0x52b
0xffffffff812c2711 at sys_openat+0x81
0xffffffff84110579 at filemon_wrapper_openat+0x19
0xffffffff81a223ae at amd64_syscall+0x39e
0xffffffff819dd0eb at fast_syscall_common+0xf8
Expose midistat_lock to midi/midi.c so that we can acquire the lock from
mseq_open() before we lock seq_lock, and introduce _locked variants of
midimapper_open() and midimapper_fetch_synth().
Sponsored by: The FreeBSD Foundation
MFC after: 2 days
Reviewed by: dev_submerge.ch, emaste
Differential Revision: https://reviews.freebsd.org/D45770
The snd_sb16 driver was removed in 716924cb48 ("Retire snd_sbc ISA
sound card driver").
While here, simplify sample rate assignment a bit.
Sponsored by: The FreeBSD Foundation
MFC after: 2 days
Reviewed by: dev_submerge.ch, markj, emaste
Differential Revision: https://reviews.freebsd.org/D45662
Currently, we are skipping physical channels when servicing
SNDCTL_AUDIOINFO, and VCHANs when servicing SNDCTL_AUDIOINFO_EX.
However, if we call SNDCTL_AUDIOINFO with VCHANs disabled, we'll
eventually skip all channels, resulting in some of oss_audioinfo's
fields containing wrong information (e.g min/max_channels).
Fix this by adding an exception to SNDCTL_AUDIOINFO not to skip physical
channels when VCHANs are disabled.
Sponsored by: The FreeBSD Foundation
MFC after: 2 days
Reviewed by: dev_submerge.ch, emaste
Differential Revision: https://reviews.freebsd.org/D45722
The default VM size may depend on the architecture. In particular,
it is currently larged on riscv64 due to a toolchain issue which
results in bloated binaries.
MFC after: 3 days
Fixes: 59c21ed6e8 "release: Bump default VM size for riscv64 to 6 GB"
Sponsored by: Amazon
The format function printf0 is originally a FreeBSD extension. clang has
adopted it as an alias for printf. Starting with gcc 11, gcc doesn't do
a NULL pointer check for fmtarg. Instead, it has to be tagged with a
nonnull attribute, so this gives us the behavior we want.
For earlier gcc and other cmopilers, define it away so do not get false
positives for NULL pointers for the err*/warn* family of functions.
This also fixes -Wsystem-headers by avoiding print0 entirely. My testing
for 67d1a1cd9e didn't test that case, so I introduced a regression.
All these compilers need to be considered because __printf0like is used
in err.h and stdlib.h. Since it's used in system headers, it has to
work on all the compilers we support on FreeBSD, not just the ones that
can build FreeBSD itself.
__printf0like will likely be deleted in the future, since the proper way
to do this is with _Nullable or _Nonnull, but the compiler support for
those hasn't been completely evaluated.
Noticed by: jhb
Fixes: 67d1a1cd9e
Sponsored by: Netflix
Suggestions by: jhb
Differential Revision: https://reviews.freebsd.org/D45836
Remove very old, deletion of ANSI keywords. Once upon a time, it was
common to want to do this. Then we only did it for non gcc compilers,
then all compilers claimed to be gcc, so we never did it. These days,
it's about useless to keep around since there's no compilers we can test
it with. It's an odd little artifact. Also, the advice in the comment is
wrong: if you define NO_ANSI_KEYWORDS, you can't have progams that use
const, etc as identifiers because they will be deleted. Further, our
header files have the 'bare' ANSI forms of these, so it's a catch 22:
You'd need them deleted for .h files, but not for the code. It's such a
niche case these days that it's best to just remove it.
Sponsored by: Netflix
Reviewed by: brooks
Differential Revision: https://reviews.freebsd.org/D45861
These are no longer used in the base system. Once upon a time they were
used to ease the transition from K&R to ANSI C. These days, we use both
of these keywords in their bare form everywhere, even in our
headers. Any uses of __const or __signed will be converted to their ANSI
meaning in the compiler, but is beyond the scope of cdefs.h's
charter. For pure K&R compilation, with an enforced only use K&R
features and meanings, one needs to define NO_ANSI_KEYWORDS (though even
that support is wobbly at best, being active only for !GCC or
gcc-adjacent compilers which currently appears to be none).
Sponsored by: Netflix
Reviewed by: brooks
Differential Revision: https://reviews.freebsd.org/D45860
Cherry-pick fix:
upstream: when sending ObscureKeystrokeTiming chaff packets, we
can't rely on channel_did_enqueue to tell that there is data to send. This
flag indicates that the channels code enqueued a packet on _this_ ppoll()
iteration, not that data was enqueued in _any_ ppoll() iteration in the
timeslice. ok markus@
OpenBSD-Commit-ID: 009b74fd2769b36b5284a0188ade182f00564136
Obtained from: openssh-portable 146c420d29d0
Reviewed by: gordon
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D45823
In pmap_mask_set_locked(), correctly handle a starting address that is
in the middle of an L3C page. The symptoms arising from this error
included assertion failures in pmap_demote_l3c().
Reported by: andrew
Reviewed by: markj
Fixes: fd6cb031f5 "arm64 pmap: Add ATTR_CONTIGUOUS support [Part 1]"
Differential Revision: https://reviews.freebsd.org/D45851
* Remove a now superfluous FALLTHROUGH hint
* Don't specify "-p" with an empty argument in the tests
Reported by: jhb
MFC after: 1 week
MFC with: edbd489d09
The mbuf flag M_HASFCS was introduced for drivers to indicate the net
stack that packets include FCS (Frame Check Sequence). In principle, to
be efficient, FCS should always be processed by hardware, firmware, or
at last sort the driver. Well, Ethernet specifies that damaged frames
should be discarded, thus only good ones will be passed up to the net
stack, then it makes no senses for the net stack to see FCS just to trim
it.
The last consumer of the flag M_HASFCS has been removed since change [1].
It is time to retire it.
1. 105a4f7b3c ng_atmllc: remove
Reviewed by: kp
MFC after: never
Differential Revision: https://reviews.freebsd.org/D42391
vtblk_poll_request() is used for kernel dumps and for fetching the block
device's identifier string during device probing. In the latter case,
it was not calling bus_dmamap_sync() after completing the I/O, but this
is required in general.
Thus:
- Factor out per-request code from vtblk_queue_completed().
- Use it in vtblk_poll_request() once virtqueue_poll() finishes.
- While here, assert that virtqueue_poll() returns the request that we
expect.
Reported by: KMSAN
Fixes: 782105f7c8 ("vtblk: Use busdma")
Reviewed by: cperciva, imp
Sponsored by: Klara, Inc.
Sponsored by: Juniper Networks, Inc.
Differential Revision: https://reviews.freebsd.org/D45665
ioctl commands such as BIOCSETIF take a struct ifreq and due to
FreeBSD's ioctl implementation copy exactly sizeof(struct ifreq) bytes
in so allocate that much space.
The over-allocaton was harmless, but useless.
Reported by: def
Fixes: e2dc8d789f dhclient: do not add 0.0.0.0 interface alias.
Sponsored by: DARPA, AFRL
Reviewed by: def
Differential Revision: https://reviews.freebsd.org/D45769
Add back, with editing, the comments about branch prediction, when to
use it, etc. Offer stronger opinions about this in style(9). Add in the
convention for FreeBSD that we do only the entire expression in the if
expression. Advise use only when it makes things measurably faster.
Requested by: jhb
Sponsored by: Netflix
Reviewed by: brooks, jhb
Differential Revision: https://reviews.freebsd.org/D45837
Autoconf 2.72 uses '' rather tha `' in comments in config.h, from
autoconf commit 64df9b4523fe ("Autoconf now quotes 'like this' instead
of `like this'").
Switch quoting style now to minimize diffs on the next OpenSSH update
and config.h regen.
Reviewed by: gordon, philip
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D45840
Fixes a wrong rwq->buf_size assignment. The field was assigned 0 upon a
successful call to ibv_init_wq.
Fixes: a687910fc4
Sponsored by: Juniper Networks, Inc.
MFC after: 1 week
Reviewed by: kib
Differential Revision: https://reviews.freebsd.org/D45833
Use a constant input operand instead of a bogus memory reference to tell
the compiler about offsetof(struct tcb, tcb_thread) in the gs segment.
Otherwise gcc complains if we tell it we are reading memory offset 0x8.
Reviewed by: kib
Differential Revision: https://reviews.freebsd.org/D45829
Use a constant input operand instead of a bogus memory reference to tell
the compiler about offsetof(struct tcb, tcb_thread) in the fs segment.
Otherwise gcc complains if we tell it we are reading memory offset 0x10.
Reviewed by: kib
Differential Revision: https://reviews.freebsd.org/D45828
These changes mostly apply to the !__SEG_GS section, which is no longer
the normal compilation path. They're made to be consistent with changes
to i386.
- Add missing cc clobber to __PCPU_ADD (which is currently unused).
- Allow the compiler the opportunity to marginally improve code
generation from __PCPU_PTR by letting it figure out how to do the add
(also removing the addition fixes a missing cc clobber).
- Quiet gcc -Warray-bounds by using constant operands instead of bogus
memory references.
- Remove the struct __s __s temporaries, just cast through the type.
Reviewed by: kib
Differential Revision: https://reviews.freebsd.org/D45827
- Add missing cc clobber to __PCPU_ADD (which is currently unused).
- Allow the compiler the opportunity to marginally improve code
generation from __PCPU_PTR by letting it figure out how to do the add
(also removing the addition fixes a missing cc clobber).
- Quiet gcc -Warray-bounds by using constant operands instead of bogus
memory references.
- Remove the struct __s __s temporaries, just cast through the type.
Reviewed by: kib
Differential Revision: https://reviews.freebsd.org/D45826
Most of these sysctls don't call sbuf_* while holding any locks. Of
the ones that do hold locks, all but one can be fixed to drop the lock
before calling sbuf_*.
Reviewed by: np
Sponsored by: Chelsio Communications
Differential Revision: https://reviews.freebsd.org/D45186
The cloner has the ability to limit the maximum unit. Employ it to do
that rather than roll our own.
No functional change intended.
Reviewed by: kp
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D45767
Some drivers, e.g. if_enc(4), only allow one instance to be created, but
the KPI ifc_attach_cloner() treat zero value of maxunit as not limited,
aka IF_MAXUNIT.
Introduce a new flag IFC_F_LIMITUNIT to indicate that the requested
maxunit is limited and should be respected.
Consumers should use the new flag if there is an intended limit.
Reviewed by: glebius
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D45757