GEOM: remove the redundant if statement
g_provider_by_name already skips the leading '/dev/' so these if
statements are redundant. This changes some error messages, but those
aren't parsed. g_concat also calls g_concat_find_disk, but it also skips
/dev/ if present at the start of the string.
Reviewed by: imp, Elliot Mitchell
Pull Request: https://github.com/freebsd/freebsd-src/pull/1793
libc: prevent incorrect %a/%La rounding at full precision
In __hdtoa() and __hldtoa(), rounding is incorrectly applied when
the requested precision exactly matches the number of significant
hexadecimal digits. In this case, the redux adjustment can trigger
an unintended exponent increment and shift the rounding position
left by one bit. This causes the least significant digit to be
rounded incorrectly.
The fix adds a new condition based on MAX_HEX_DIGITS (derived from
MANT_DIG) so that rounding is performed only when precision is
strictly less than the number of significant digits. This avoids
the unintended shift while preserving correct rounding for other
cases.
A new regression test
(printfloat_test:hexadecimal_rounding_offset_eq_exp) covers both
the binary64 (%.13a) and binary128 (%.28La on arm64) cases that
previously fail, ensuring the bug does not regress.
[12 lines not shown]
release: Pass ABI to pkgbase-stage.lua
We then pass ABI from pkgbase-stage.lua to pkg(8); without this,
cross-building releases with PKGBASE enabled fails with
pkg: wrong architecture: ...
pkg: repository FreeBSD-base contains packages with wrong ABI: ...
MFC after: 1 minute
Discussed with: emaste, jrtc27
Sponsored by: https://www.patreon.com/c/cperciva
(cherry picked from commit 340e68fd7c0d62cac1f0876b6475a89df5065db5)
release: Pass ABI to pkgbase-stage.lua
We then pass ABI from pkgbase-stage.lua to pkg(8); without this,
cross-building releases with PKGBASE enabled fails with
pkg: wrong architecture: ...
pkg: repository FreeBSD-base contains packages with wrong ABI: ...
MFC after: 1 minute
Discussed with: emaste, jrtc27
Sponsored by: https://www.patreon.com/c/cperciva
contrib/libxo: fix API header files inclusions in C++ source files
C++ source files need `extern "C"` to disable C++ name mangling.
MFC after: 1 week
Reviewed by: aokblast (previous version), phil, imp (previous version)
Differential Revision: https://reviews.freebsd.org/D47930
(cherry picked from commit 11ace56fa030185025936c795d5cf7c57b266835)
contrib/libxo: fix API header files inclusions in C++ source files
C++ source files need `extern "C"` to disable C++ name mangling.
MFC after: 1 week
Reviewed by: aokblast (previous version), phil, imp (previous version)
Differential Revision: https://reviews.freebsd.org/D47930
(cherry picked from commit 11ace56fa030185025936c795d5cf7c57b266835)
MFC jaildesc: remove file-mode-based access controls
Jail descriptors were given a file-like mode, user, and group, for the
purpose of controlling how the descriptor may be used. This is too far
removed from the file paradigm to make sense. Remove it in favor of a
better access control method to be added, such as Capsicum.
Also add missing code in jaildesc_fill_kinfo.
Reported by: crest at rlwinm.de, kib
MFC after: 3 days
(cherry picked from commit d81b337d690c971d60c731494795ee4b81fb929e)
MFC jaildesc: replace EBADF with EINVAL
Following fd9e09cb, EBADF is not the suitable error code for a non-
jail descriptor passed to jail_set, jail_get, jail_attach_fd, and
jail_remove_fd.
Reported by: kib
(cherry picked from commit 16f600dc30b7bb82429660e540da802a1e3f7449)
jaildesc: remove desc from the sysctl parameter list
Like lastjid, desc should count as a pseudo-parameter. The difference
lies entirely in the security.jail.param sysctls, which list all of
the jail parameters. Since desc opens and returns a file descriptor,
it has no place in such uses as "jls all." Like lastjid, it's still
recognized by the kernel if passed in/out, and hard-coded into libjail
so it can be recognized there.
MFC after: 3 days
libc: fix the _FORTIFY_SOURCE build of getgrouplist(3)
We need <unistd.h> to get our prototype normally, but WARNS in libc is
way too low to surface that.
Additionally, _FORTIFY_SOURCE needs to include <ssp/unistd.h> by way of
<unistd.h> to actually export an implementation of getgrouplist(3). The
version defined in the .c gets named __ssp_real_getgrouplist() and the
actual implementation comes from the redirect stub in <ssp/unistd.h>,
which basically gets optimized away in the built object because our
__builtin_object_size() check is trivially false when we cannot resolve
any object sizes in this translation unit.
This could be argued as a design flaw in _FORTIFY_SOURCE, but we should
grab <unistd.h> for our prototype anyways so let's kick the can down
the road instead of re-thinking it for 15.0.
Reported by: Shawn Webb (HardenedBSD)
Fixes: d3f8ed6066 ("getgrouplist(3): Remove superfluous [...]")
MFC after: 3 days
libc: Have memcmp test what the standard requires
libc's C memcmp currently returns the difference in byte values rather
than just -1/0/1 as the AArch64 assembly implementation, many non-
FreeBSD implementations, and compiler built-in optimizations do.
It is a bug for a user to expect memcmp to return the difference in the
byte values as the compiler is free to inline memcmp() with an
implementation that does not do this. Change the test to validate only
what the standard requires.
PR: 289084
Reviewed by: markj, fuz
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D52502
flua: add posix.unistd.execp
This matches the interface of lposix, although I do wonder why they went
with execp rather than execvp for the function name here.
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D50177
(cherry picked from commit 7080a0c170daf8e4b3f331ec33003b2f8893dc23)
Fix two infinite loops if dmu_prefetch_max set to zero
Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Signed-off-by: Alexander Motin <alexander.motin at TrueNAS.com>
Closes #17692
Closes #17729
release.sh: Pass *PKGBASE* through
It helps to get the variable name right...
Fixes: d4282cfa97d6 ("release.sh: Pass PKGCONF through to make release")
MFC after: 1 minute
Sponsored by: https://www.patreon.com/c/cperciva
pf: fix possible pd->pcksum NULL deref
Ensure that we always populate pcksum, not just for TCP/UDP/SCTP/ICMP.
We may end up using it (through pf_change_ap()) if we're doing NAT, so
ensure it's available even if it's sometimes just a dummy variable.
Reported-by: syzbot+3e73a7cba8cb6cd46f90 at syzkaller.appspotmail.com
MFC after: 1 week
Sponsored by: Rubicon Communications, LLC ("Netgate")
(cherry picked from commit c23eda976a8aad6bbd6c2042fa2ba1f0bc640e19)
ports.7: Fix example of passing variables on the command line
make(1)'s -D flag does not allow for setting the value of the variable.
It just defines the variable and sets its value to 1. In fact, make(1)
treats "=" as just another character in the variable name:
```
$ make -DA=2 -V A # Output is just an empty line.
$ make -DA=2 -V A=2 # Variable "A=2" is defined and set to "1".
1
```
Fixes: d25f7d324a9d ports.7: Document DEBUG_FLAGS and the process of debugging ports
MFC after: 3 days
(cherry picked from commit 9365a328596c9f156deaa15fa018b76b3a6e6b18)
ports.7: Fix example of passing variables on the command line
make(1)'s -D flag does not allow for setting the value of the variable.
It just defines the variable and sets its value to 1. In fact, make(1)
treats "=" as just another character in the variable name:
```
$ make -DA=2 -V A # Output is just an empty line.
$ make -DA=2 -V A=2 # Variable "A=2" is defined and set to "1".
1
```
Fixes: d25f7d324a9d ports.7: Document DEBUG_FLAGS and the process of debugging ports
MFC after: 3 days
(cherry picked from commit 9365a328596c9f156deaa15fa018b76b3a6e6b18)
vfs: denote a bug when dooming vnodes with custom locking primitives
See the added comment.
The entire notion of how vnodes are doomed needs to be reworked, but the
bare minimum would be to have filesystems provide ops for doomed nodes
and keep ->v_data around at least until they are done with it.
vfs cache: update commentary, no code changes
sdt hotpatching was implemented, thus a remark about usefulnes of doing
it was removed.
Apart from that a bunch of expanded/reworded explanations.
Improvement in terms of the quality of the use the English language
was a non-goal and was most likely not achieved.