[Clang] Accept mixed GNU and standard attributes in namespace scope (#240734)
Parse leading GNU and standard attributes in namespace scope using the
same loop as global declarations. Previously, a standard attribute
following a GNU attribute was rejected with "an attribute list cannot
appear here".
Fixes #240537.
xdr: Fix xdr_string
Forcing maxsize to RPC_MAXDATASIZE breaks code that deliberately uses
XDR with longer strings than permitted by SunRPC.
MFC after: 1 week
Fixes: 6448ec89e739 (" * limit size of buffers to RPC_MAXDATASIZE")
Fixes: e17d7ab869bb ("xdr_string: don't leak strings with xdr_free")
Sponsored by: Klara, Inc.
Sponsored by: NetApp, Inc.
Reviewed by: kevans, brooks
Differential Revision: https://reviews.freebsd.org/D59994
(cherry picked from commit d2018cedb414ef17e77b7fc2fa19fd81328da46b)
xdr: Limit xdr_wrapstring
The previous commit (re)introduced the possibility that a malicious or
corrupt message can cause the receiver to allocate a very large amount
[9 lines not shown]
xdr_string: don't leak strings with xdr_free
Historically (and in a small amount of older software such as OpenAFS),
developers would attempt to free XDR strings with
xdr_free((xdrproc_t)xdr_string, &string)
This resulted in xdr_free calling xdr_string with only two intentional
arguments and whatever was left in the third argument register. If the
register held a sufficently small number, xdr_string would return FALSE
and not free the string (no one checks the return values).
Software should instead free strings with:
xdr_free((xdrproc_t)xdr_wrapstring, &string)
Because buggy software exists in the wild, act as though xdr_wrapstring
was used in the XDR_FREE case and plug these leaks.
[7 lines not shown]
xdr_string: don't leak strings with xdr_free
Historically (and in a small amount of older software such as OpenAFS),
developers would attempt to free XDR strings with
xdr_free((xdrproc_t)xdr_string, &string)
This resulted in xdr_free calling xdr_string with only two intentional
arguments and whatever was left in the third argument register. If the
register held a sufficently small number, xdr_string would return FALSE
and not free the string (no one checks the return values).
Software should instead free strings with:
xdr_free((xdrproc_t)xdr_wrapstring, &string)
Because buggy software exists in the wild, act as though xdr_wrapstring
was used in the XDR_FREE case and plug these leaks.
[7 lines not shown]
xdr: Fix xdr_string
Forcing maxsize to RPC_MAXDATASIZE breaks code that deliberately uses
XDR with longer strings than permitted by SunRPC.
MFC after: 1 week
Fixes: 6448ec89e739 (" * limit size of buffers to RPC_MAXDATASIZE")
Fixes: e17d7ab869bb ("xdr_string: don't leak strings with xdr_free")
Sponsored by: Klara, Inc.
Sponsored by: NetApp, Inc.
Reviewed by: kevans, brooks
Differential Revision: https://reviews.freebsd.org/D59994
(cherry picked from commit d2018cedb414ef17e77b7fc2fa19fd81328da46b)
xdr: Limit xdr_wrapstring
The previous commit (re)introduced the possibility that a malicious or
corrupt message can cause the receiver to allocate a very large amount
[9 lines not shown]
su, login: fix heap over-read in environment export filter
ok_to_export() (su.c) and export() (login.c) read s[n] before
strncmp(s, *pp, n) confirms s is at least n bytes long, where n is
the length of the blocked variable name. A PAM environment entry
shorter than that name over-reads past its heap allocation.
Check strncmp() first; it stops at s's NUL terminator and never
reads past the boundary that guarded the s[n] access.
MFC after: 1 week
Sponsored by: Advanced Micro Devices, Inc.
Signed-off-by: Osvaldo Janeri Filho <ojanerif at amd.com>
Reviewed by: des, markj
Differential Revision: https://reviews.freebsd.org/D61420
[AArch64] Cost narrow two-source shuffles as the widened legal shuffle
Widen the mask of a narrow two-source shuffle to the legal type and cost
that, as is done for length-changing shufflevectors. Keep the narrow
estimate when it is lower, as the legal shuffle can itself scalarize.
[ARM] Diagnose Thumb-2 STR with Rt = PC (#240567)
STR (immediate) T3 and T4 and STR (register) T2 with Rt = PC are
UNPREDICTABLE, but the assembler accepted them, and the disassembler
decoded them and the pre- and post-indexed forms without a warning.
V8's ARM32 port had str.w pc, [sp, #60], and Qualcomm cores trap on it.
Reject them in the assembler, as the pre- and post-indexed forms already
are, and return SoftFail in the disassembler. basic-thumb2-instructions.s
had one such instruction, which goes away.
Assisted-by: Claude Opus 5.5 (Anthropic)
[Clang] [OpenMP] Use raw AST statement as a fallback when transformed statement isn't available for jump check (#234881)
Fixes #230923.
Taking a look at the segfault in a debugger and playing around with the
reproducer, the error happened only when:
- There's a non-empty statement before the nested for-loop (I still have
no clue why this is the case)
- There's an interchange directive present
The segfault was happening in `JumpScopeChecker::BuildScopeInformation`
when processing the statement as an `OMPExecutableDirective`. In case of
an interchange directive being present, the transformation gets
deferred, `getStructuredBlock` returns `nullptr` causing `getBeginLoc`
to segfault.
This PR adds a fallback so if the transformed statement returned by
`getStructuredBlock()` isn't available, the raw AST statement is used
instead.
[2 lines not shown]
*/*: Bump PORTREVISION for postgresql-server dependant ports
All ports depending on postgreql-server require a rebuild after
postgresql-server is upgraded to reflect security fixes.
Security: 1a672925-de93-11f1-9824-6cc21735f730
databases/postgresql1[45678]-*: Update to latest patch releases
Update to 18.7, 17.12, 16.16, 15.20 and 14.25, fixing 53 CVEs and
a large number of other bugs.
A dump/restore is not required, but some indexes may be corrupt and
should be rebuilt with REINDEX after updating:
- btree indexes on bpchar columns declared without a length
(CHAR(n) is not affected)
- GiST indexes using gist_trgm_ops (contrib/pg_trgm)
- GIN indexes and TOAST-table indexes, if corruption is suspected
For 17 and 18, existing incremental backups should not be trusted.
Take a new full backup after updating and base subsequent
incremental backups on that.
Release notes: https://www.postgresql.org/about/news/postgresql-187-1712-1616-1520-1425-and-19-rc-2-released-3442/
Security: 1a672925-de93-11f1-9824-6cc21735f730
tests/net: unskip tests waiting for bpf fixes
These tests pass for more than 200+ runs consecutively.
PR: 292993
MFC after: 3 days
Sponsored by: The FreeBSD Foundation
tpm: crb: Support the ACPI start method
Some AMD firmware TPMs report StartMethod 2 and had no driver. They never
acknowledge CTRL_REQ, so skip the idle and ready requests.
Do not harvest entropy from these TPMs on AMD: on a Ryzen 7 7735HS each
periodic TPM2_GetRandom froze every CPU, for up to 1.2 s (AMD PA-410).
Reviewed by: kbowling
Approved by: kbowling
Differential Revision: https://ron-dev.freebsd.org/FreeBSD/src/pulls/103
[AArch64] Add feature guards to SVE and SME intrinsics
This PR adds streaming/non-streaming feature guards to the SVE and SME
intrinsics. A new verifier pass is added to rejects calls to intrinsics
whose type signature is unavailable for the function's mode and feature
flags.
Some codegen tests needed updating to avoid using types that don't
map to any legal ACLE types.
More as an optional feature; this PR adds a check to Clang's SveEmitter
to ensure that a builtin's type/target maps to a compatible LLVM intrinsic
variant, under the compatible feature flags so that incorrect mappings
are caught during TableGen generation.
I'm happy to split this PR up, but I wasn't sure that was necessarily
going to be more helpful.
A few straggling Debugger -> cpu_Debugger transformations (because sun3
<sys/systm.h> was unconditionally always #define'ing Debugger() on sun3,
but now no longer does).
sysutils/vm-bhyve-devel: Update to the latest commit
This is a -devel port, so it's being shipped to the quarterly branch
for users keen on the latest updates. More cautious users use
sysutils/vm-bhyve instead.
MFH: 2026Q4
(cherry picked from commit a03ca31f5e522b80d2afe234f7f808c5b3b76e1d)
sysutils/vm-bhyve-devel: Update to the latest commit
This is a -devel port, so it's being shipped to the quarterly branch
for users keen on the latest updates. More cautious users use
sysutils/vm-bhyve instead.
MFH: 2026Q4
[CIR] Abstract the 'load' of a vtable pointer into the get_virtual_fn op (#241048)
In anticipation of 'relative' vtables, this abstracts the 'relativeness'
as well as the type of the vtable pointer back into cir.vptr. With this
patch, we've removed all of this down to the LowerToLLVM, which can use
the relative_cxx_abi_vtables lowering flag (see #241040) to eventually
emit this correctly.
At the moment, this is effectively a 'NFC', as everything that actually
uses relative layouts is either already a CIRGen NYI (left in place
until those are implemented), or will be added as an unreachable-NYI
diagnostic in #241040.