libc: Import OpenBSD's inet_net_{ntop,pton}
Our versions of these functions (originally taken from BIND) simply
don't work correctly for AF_INET6. These were removed from BIND itself
quite a while ago, but OpenBSD has made several fixes in the mean time,
so import their code.
Add tests for both functions.
PR: 289198
Reported by: Nico Sonack <nsonack at herrhotzenplotz.de>
MFC after: 1 week
Reviewed by: des
Obtained from: OpenBSD (lib/libc/net)
Sponsored by: https://www.patreon.com/bsdivy
Differential Revision: https://reviews.freebsd.org/D52629
(cherry picked from commit 8f4a0d2f7b96099001dbc51e06114df1a0e6d291)
Makefile: Don't allow install{world,kernel} with pkgbase
Using these targets on a pkgbase system will cause the installed system
to become out of sync with the package database, which is almost certain
to cause issues the next time pkg(8) is used.
To prevent users doing this accidentally, disallow install* if we detect
that FreeBSD-runtime is installed in the target. The check can be
overridden with DESTDIR=/ for users who are sure they want to do this.
MFC after: 3 days
Reviewed by: emaste
Sponsored by: https://www.patreon.com/bsdivy
Differential Revision: https://reviews.freebsd.org/D52879
(cherry picked from commit 74a6bb524e5b9ad654a9acc5da5c195f406717b5)
packages: Update the METALOG when (un)installing the caroot package
There may be other issues here but this change certainly seems to
be necessary.
PR: 290394
Reviewed by: cperciva
Differential Revision: https://reviews.freebsd.org/D53263
nfs: Add support for the NFSv4 archive attribute
The archive attribute (UF_ARCHIVE) is listed as deprecated
in RFC8881. However, the Windows NFSv4.1 client folk disagree
with this and say they need support for it.
This patch adds support for it, in a manner similar to what
is done for UF_SYSTEM and UF_HIDDEN.
MFC after: 2 weeks
pf: fix 'no rdr'
Ensure we always have a non-NULL rule pointer (ctx.rm).
It might have gotten set to NULL by pf_get_translation().
While here also restore the previous rdr behaviour be re-adding the incorrectly
removed 'break' in pf_match_translation_rule.
Approved by: re (cperciva)
PR: 290177
MFC after: 3 days
Sponsored by: Rubicon Communications, LLC ("Netgate")
Differential Revision: https://reviews.freebsd.org/D53191
(cherry picked from commit cb36bfee25b71d1223b8fb1237fcf823d514b50e)
(cherry picked from commit 536b07512c4b931b9d0d3d609c3ac925f55e3ec9)
libc: Add "Z" as TZ designator for strptime.
ISO 8601 allows use of "Z" as the time zone designator. Update the
strptime parser to allow this usage.
While we are at it, update the manpage to reflect that both UTC and Z
are now valid options.
Approved by: re (cperciva)
Reviewed by: des
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D53083
(cherry picked from commit 79e57ea662d92ffcbe7d65854a284aefac6a332d)
(cherry picked from commit 3d368c699b73cc1dff3ca27d29d19666741d9ff8)
imgact_elf: Check note body sizes
In parse_notes we validate that the note name fits within the note
buffer, but we do not do the same for the note data, so there is some
potential for an OOB read in the note handler. Add a bounds check.
Approved by: re (cperciva)
Reported by: Ilja Van Sprundel <ivansprundel at ioactive.com>
Reviewed by: kib, emaste
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D53063
(cherry picked from commit c86af2cc4cd12fb0174843b22d737c3b5b5d55d0)
(cherry picked from commit 09ae918e1f00572f9045283c281cf2d210ece491)
libnv: Fix a length check in nvpair_unpack_string_array()
A string array is represented by a set of nul-terminated strings
concatenated together. For each string, we check to see if there's a
nul terminator at the end, taking care to avoid going past the end of
the buffer. However, the code fails to handle the possibility that
size == 0 at the end of an iteration, leading to underflow.
Fix the length check.
Approved by: re (cperciva)
Reported by: Ilja van Sprundel <ivansprundel at ioactive.com>
Reviewed by: emaste
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D53069
(cherry picked from commit 937693fc9e4ff4045cc674a14902f0d53e84ec98)
(cherry picked from commit c47f9af4771bc7de2ebed4c91628c1f9a7f86a2c)
exec: Check for errors when mapping the shared object
In the non-ASLR case, there is no check for an error from
vm_map_fixed(). Restore it, it was dropped in commit 939f0b6323e0a.
This bug could result in a refcount leak of the object used to map the
VDSO page.
Approved by: re (cperciva)
Reviewed by: kib
Reported by: Ilja Van Sprundel <ivansprundel at ioactive.com>
MFC after: 1 week
Fixes: 939f0b6323e0 ("Implement shared page address randomization")
Differential Revision: https://reviews.freebsd.org/D53065
(cherry picked from commit 7117c86fcb7ebee4483097cefa9b143de8d78ee0)
(cherry picked from commit 6a5f0dc705c4401454d4fcd61e7301b992bfea13)
krb5: Include <features.h> on Linux so __GLIBC__ can be checked
__GLIBC__ is not pre-defined by the toolchain, it comes from features.h,
so we need to make sure that's included by this point.
Fixes: 4dd2b869cd07 ("krb5: Fix -Wint-conversion when bootstrapping on GNU/Linux")
src.opts.mk: Enable LLDB for 32-bit arm
It was previously disabled when we built for older 32-bit arm targets
which lack 64-bit atomics. As we now support armv7 at a minimum there
is no need to disable LLDB.
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D52668
krb5: Fix -Wint-conversion when bootstrapping on GNU/Linux
This shows up in GitHub Actions as a warning, and some compilers can
default to it being an error.
pf: fix 'no rdr'
Ensure we always have a non-NULL rule pointer (ctx.rm).
It might have gotten set to NULL by pf_get_translation().
While here also restore the previous rdr behaviour be re-adding the incorrectly
removed 'break' in pf_match_translation_rule.
PR: 290177
MFC after: 3 days
Sponsored by: Rubicon Communications, LLC ("Netgate")
Differential Revision: https://reviews.freebsd.org/D53191
(cherry picked from commit cb36bfee25b71d1223b8fb1237fcf823d514b50e)
src.conf.5: Regen
after recent MFCs:
9d0b660e6949 ("jemalloc: Fix activating debug on WITHOUT_MALLOC_PRODUCTION")
ac5378d93ce0 ("Add build option for the ia32 loader")
Sponsored by: The FreeBSD Foundation
random: garbage collect the RANDOM_PURE_OCTEON entropy source
It was used for Octeon MIPS and all producers have been removed
from the source tree.
Reviewed by: emaste
Differential Revision: https://reviews.freebsd.org/D53146
Revert "release: Switch back to latest packages for now"
We now have 15.x quarterly package sets for both amd64 and arm64.
This reverts commit dc5aae134a44d18921e179355e9b93a7eff534ed.
Approved by: re (cperciva)
vmimage.subr: Fix when/where we fix up METALOG
We only need to check for unMETALOGed directories and sort the METALOG
file if we're using it, i.e. if we're doing a NO_ROOT build. This
non-NO_ROOT builds by no longer bogusly writing to /METALOG*.
We only need to add databases (spwd.db etc) to METALOG if we're doing
a pkgbase-enabled NO_ROOT build; but we should always do this before
creating the filesystem, not only if we installed extra packages (in
vm_extra_install_packages, where that code was erroneously placed).
This fixes non-cloud VM images, which in 15.0-BETA2 shipped without
password databases.
Approved by: re (cperciva)
Reviewed by: ivy
MFC after: 3 days
Sponsored by: https://www.patreon.com/cperciva
Differential Revision: https://reviews.freebsd.org/D53194
[2 lines not shown]
bsdinstall: jail: Fix DISTMENU items
The menu was incorrectly using the fourth column (distname) instead of
the first (dist) of the MANIFEST.
The actual file name is on the first column of the MANIFEST file.
Remove the .txz part of the name to build the menu options.
Reviewed by: jamie
MFC after: 5 days
Differential Revision: https://reviews.freebsd.org/D53177
release: Add pkg .conf to METALOG on dvd
We're correctly recording all of the packages in the dvd METALOG file,
but if we don't record ./packages/repos/FreeBSD_install_cdrom.conf then
users won't be able to install them very easily.
Reviewed by: markj
Reported by: Lars Tunkrans
MFC after: 3 days
Sponsored by: https://www.patreon.com/cperciva
Differential Revision: https://reviews.freebsd.org/D53199
(cherry picked from commit 2b5c62494df95cdb844b5f6f852412f2178f66dd)