cred: freebsd14_setgroups(): Remove a now-unnecessary local variable
MFC with: e6fbef451dd4 ("cred: Fix a race in the FreeBSD-14-compatible setgroups(2)")
Sponsored by: The FreeBSD Foundation
cred: Fix a race in the FreeBSD-14-compatible setgroups(2)
The freebsd14_setgroups() function would try to modify the effective GID
on the current process' credentials without holding the process lock,
allowing races with other threads concurrently modifying the process
credentials. In the worst case, freebsd14_setgroups() could be
manipulating a 'struct ucred' already freed by another thread (in the
very small window after reading 'p_ucred' without lock but before
modifying the effective GID). Concurrent uses of freebsd14_setgroups()
or setcred() could also lead to non-atomic credentials modifications.
Fix this by making kern_setgroups() take a new boolean indicating
whether the passed array includes the effective GID in its first slot.
When this boolean is true, it internally keeps the effective GID in
a separate variable, pretends that the groups[] array that was passed
actually starts at 'groups + 1', do the usual steps to set the
supplementary groups and new extra ones to set the effective GID along,
without releasing the process lock in between.
[5 lines not shown]
powerpc/radix: fix double page offset in mmu_radix_sync_icache()
mmu_radix_sync_icache() adds the offset of va within its page to the
physical address it gets from mmu_radix_extract_locked(). That address
already includes the offset - the extract routines return the physical
address of the byte, not of the frame - so the offset is counted twice
and __syncicache() is handed frame + 2 * offset.
The hash MMU counterpart, moea64_sync_icache(), has to add the offset
because PVO_PADDR() yields only the frame. Here the addition is wrong.
Fixes: 6f0b2a235a13 ("powerpc/pmap: Add pmap_sync_icache() for radix pmap")
Reviewed by: jhibbits
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D59870
(cherry picked from commit 9d0859637f99160e17b656df153effae3df31f8b)
(cherry picked from commit 107212618921492ffed84d6ea3c9a27c77aaf725)
sys/powerpc/powerpc/elf64_machdep.c: enable ASLR on ELFv2
Turns out that ever since introducing ELFv2 support, it was missing
ASLR, it was only used for ELFv1 processes.
Reviewed by: jhibbits (via IRC #powerpc64)
MFC after: 1 week
(cherry picked from commit 30ed27ff2556c591a1791105d1dfe7464d3f5b80)
(cherry picked from commit edb560a7ccd69440e3bcd3e00ad9b347328f1be3)
powerpc/radix: fix double page offset in mmu_radix_sync_icache()
mmu_radix_sync_icache() adds the offset of va within its page to the
physical address it gets from mmu_radix_extract_locked(). That address
already includes the offset - the extract routines return the physical
address of the byte, not of the frame - so the offset is counted twice
and __syncicache() is handed frame + 2 * offset.
The hash MMU counterpart, moea64_sync_icache(), has to add the offset
because PVO_PADDR() yields only the frame. Here the addition is wrong.
Fixes: 6f0b2a235a13 ("powerpc/pmap: Add pmap_sync_icache() for radix pmap")
Reviewed by: jhibbits
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D59870
(cherry picked from commit 9d0859637f99160e17b656df153effae3df31f8b)
sys/powerpc/powerpc/elf64_machdep.c: enable ASLR on ELFv2
Turns out that ever since introducing ELFv2 support, it was missing
ASLR, it was only used for ELFv1 processes.
Reviewed by: jhibbits (via IRC #powerpc64)
MFC after: 1 week
(cherry picked from commit 30ed27ff2556c591a1791105d1dfe7464d3f5b80)
traceroute6: MFC: implement firewall evasion mode
Merge implementation of "traceroute -e" to traceroute6 for TCP/UDP/SCTP.
(cherry picked from commit f1cfcfb2e51ae5afa8941342ad10f650db8279c5)
me.4: MFC: note that it is a point-to-point interface
Add explicit note that me(4) works as a point-to-point pseudo device.
(cherry picked from commit f69eab727edbab1385e5ffc8b3f6cb5a233f62c0)
traceroute6: MFC: implement firewall evasion mode
Merge implementation of "traceroute -e" to traceroute6 for TCP/UDP/SCTP.
(cherry picked from commit f1cfcfb2e51ae5afa8941342ad10f650db8279c5)
me.4: MFC: note that it is a point-to-point interface
Add explicit note that me(4) works as a point-to-point pseudo device.
(cherry picked from commit f69eab727edbab1385e5ffc8b3f6cb5a233f62c0)
ufs: report a mismatched ".." in ufs_dirrewrite()
When ufs_rename() moves a directory to a new parent and ufs_dirrewrite()
fails to rewrite its ".." entry, it reports "bad dir ... rename: missing
.. entry" whatever the error. ufs_dirrewrite() never finds a missing
"..", though: it fails with EIDRM when the ".." entry names another inode
than the expected one, and otherwise only when the directory block cannot
be read or written. The latter happens for every directory rename in
flight when the device goes away under a forcibly unmounted file system,
and the log then fills with reports of directories that are intact on
disk.
Report the EIDRM case with ufs_dirbad() in ufs_dirrewrite() itself, so
that all of its callers get the same diagnostic, and drop the report
from ufs_rename(). Errors from the lower layers are not reported, as
usual for an I/O initiator.
Reviewed by: kib
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D60137
tests/geom: fix ATF test listing when geom class module is missing
geom_subr.sh serves both legacy TAP tests and ATF tests. It defaults to the
TAP path, so ATF tests must set ATF_TEST=true before sourcing it.
Sponsored by: Netflix
openssl: import 3.5.9
This change adds openssl 3.5.9 from [upstream][1].
The 3.5.9 artifact was been verified via [PGP key][2] and by [SHA256 checksum][3].
3.5.9 is a security patch release, with the highest CVE fixed being ranked High.
More information about the release (from a high level) can be found in
the [release notes][4].
Updated via [`update_openssl.sh`][5] `update_openssl.sh 3.5.9`.
Maintainer note: large test input files under `tests/recipes` were removed as
part of the import in order to pass the pre-receive checker. Please see this
[GitHub Issue][6] for more details.
1: https://github.com/openssl/openssl/releases/download/openssl-3.5.9/openssl-3.5.9.tar.gz
2: https://github.com/openssl/openssl/releases/download/openssl-3.5.9/openssl-3.5.9.tar.gz.asc
[4 lines not shown]
bhyve: rtc_pl031: Fix PeriphID and CellID values
PeriphID and CellID values are determined by macros which take an
index. They currently receive a bus offset which has a stride of 4 bytes.
This causes the ID1-3 registers to report incorrect values.
Scale the offset before passing it to the macro to fix this.
Tested with kvm-unit-tests/arm/pl031.
Signed-off-by: Kajetan Puchalski <kajetan.puchalski at arm.com>
Reviewed by: jrtc27
Fixes: 014d7082a239 ("bhyve: Implement a PL031 RTC on arm64")
MFC after: 1 week
Pull Request: https://github.com/freebsd/freebsd-src/pull/2358
Closes: https://github.com/freebsd/freebsd-src/pull/2358
(cherry picked from commit a554906ea44c26925730a25263e64890d48d2b36)