[libc] Read passwd records into a growable buffer (#224149)
Switch getpwent, getpwnam, and getpwuid to use DynamicBuffer so that
passwd records of arbitrary length are supported without fixed size
limits.
A single static DynamicBuffer and struct passwd are reused across
getpwent, getpwnam, and getpwuid per POSIX, and endpwent closes the file
stream without freeing the buffer so pointers returned prior to endpwent
remain valid.
The reentrant lookups (getpwnam_r and getpwuid_r) remain non-allocating
and return ERANGE when the caller's buffer is too small.
* Switch non-reentrant pwd lookups and iteration to DynamicBuffer
* Remove fixed 1024-byte buffer limit from pwd_utils
* Keep getpwnam_r and getpwuid_r non-allocating
* Update hermetic unit tests for long passwd records
Assisted-by: Automated tooling, human reviewed.
ice: Enforce VF MAC anti-spoof policy
The SR-IOV schema enables MAC anti-spoofing by default, but the driver
never programs the VSI security section. A VF can therefore transmit
with an arbitrary source address despite the configured policy.
Program ICE_AQ_VSI_SEC_FLAG_ENA_MAC_ANTI_SPOOF when the VF VSI is
created, and replay the policy when the VSI is rebuilt after a PF or
device reset. Fail VF creation or rebuild when firmware cannot install
the security policy so an unprotected VF is never published as active.
Validated on E810 hardware with host-attached and Linux passthrough
VFs. Traffic using the assigned source MAC passed while otherwise
identical forged-source frames were dropped. After a PF reset, assigned
traffic resumed and zero of ten forged frames reached the peer.
An injected MAC anti-spoof update failure left the VF inactive.
Destroying and recreating the SR-IOV configuration restored the policy
and traffic.
[4 lines not shown]
[libcxx][libc] Update LLVM-libc/compiler-rt config (#224160)
The config libc++ uses to build with LLVM-libc uses compiler-rt, but
previously wasn't building the compiler-rt atomic library. This PR
updates the config to tell compiler-rt to build its atomic library.
[ConstantFolding] Fold vector.partial.reduce.add constants (#212112)
This patch adds constant folding support for `llvm.vector.partial.reduce.add`.
The intrinsic leaves the grouping of input elements into result lanes
unspecified. This implementation uses the deterministic grouping
selected by
the generic lowering in `TargetLowering::expandPartialReduceMLA`: input
element `I` is accumulated into result lane `I % NumAccElts`.
Tests cover:
* Constant accumulator and input vectors
* Non-constant accumulator and input operands
* Poison and undef elements
* Different reduction ratios
* Negative values
* Integer wraparound
Fixes #211558
www/nginx-devel: Add NJS_QJS and NJS_XML options
The port pulled quickjs, libxml2 and libxslt unconditionally with NJS
and always built the QuickJS engine. Split this into the NJS_QJS and
NJS_XML options, so that www/nginx, www/nginx-devel and www/freenginx
offer the same set.
Sponsored by: Netzkommune GmbH
[BoundsSafety][NFC] Allow CountAttributedType's count to be filled in later (#223267)
Prepare CountAttributedType so its count expression can be supplied
after the node is created, which the new late-parsed counted_by
mechanism needs: the type is built when the attribute is seen, but its
argument isn't parsed until the enclosing record is complete.
- Drop the TrailingObjects coupled-decl storage in favour of an
ASTContext-allocated array held by the ArrayRef the base class already
has, so the decls can be attached after construction.
- Add CountAttributedType::setCountExpr for in-place completion.
- Add ASTContext::getIncompleteCountAttributedType (count-less, not
uniqued) and completeCountAttributedType. Incomplete nodes are not
registered in ASTContext.Types until completed, so a node abandoned with
a null count is never reachable.
No functional change: getCountAttributedType still builds a
fully-formed, count-carrying type as before.
[9 lines not shown]
[IR] Provide intrinsics for speculative loads (#179642)
Introduce two new intrinsics to enable vectorization of loops with early
exits that have potentially faulting loads.
1. `@llvm.speculative.load` - perform a load that may access memory
beyond the allocated object. It must be used in combination with
`@llvm.can.load.speculatively` to ensure the load is guaranteed to not
trap. The number of accessible bytes must be provided, either as IR value
or via an oracle function.
2. `@llvm.can.load.speculatively` - Returns true if it's safe to
speculatively load a given number of bytes from a pointer. The semantics
are target-dependent. On some targets, this may check that the access
does not cross page boundaries, or stricter checks for example on
AArch64 with MTE, which limits the access size to 16 bytes.
`@llvm.speculative.load` is lowered to a regular load in SelectionDAG
without MODereferenceable.
[15 lines not shown]
[GlobalISel] Drop poison flags by default in combiners (#218306)
GlobalISel TableGen combiners were implicitly copying poison-generating
flags from the root instruction to newly-created instructions. This is
unsafe because the replacement instruction may not preserve the same
`nuw`/`nsw` guarantees.
Drop those flags by default for combiners, while keeping explicit
`MIFlags` preservation intact.
Fixes #210470
[RISCV][P-ext] Support Packed Subvector Join (#224233)
This PR adds support for the Packed Subvector Join intrinsics:
- `__riscv_pjoin2_i8x8`
- `__riscv_pjoin2_u8x8`
- `__riscv_pjoin2_i16x4`
- `__riscv_pjoin2_u16x4`
ice: Add malformed virtchnl injection points
Extend the optional ice(4) failure injection facility with semantic
corruption points for queue configuration, RSS keys and tables, and
interrupt mappings.
Each point mutates an otherwise valid request after the common
virtchnl length check. This exercises the PF semantic validators with a
real VF while preserving the normal wire format and mailbox path.
The queue point selects unaligned Tx or Rx bases, an unaligned or
unrepresentable receive buffer, an invalid frame size, duplicate queue
IDs, or a bad VSI. The RSS points select short advertised data or an
out-of-range LUT entry. The interrupt point selects an invalid ITR,
traffic on vector zero, duplicate vectors, or a bad VSI.
The points remain absent unless the kernel is built with
options DRIVER_FAILPOINTS and retain the existing PF and VF selectors.
[3 lines not shown]
ice: Validate VF virtchnl configuration
Virtchnl requests originate in guest-controlled VFs. The existing PF
implementation checked message shape but allowed several hardware-facing
values through without complete semantic validation.
Require the exact RSS key and LUT sizes advertised to the VF, validate
every LUT entry, and pass only the validated LUT length to firmware. A
short LUT previously caused the AdminQ command to read beyond the
received request.
Validate queue ring bases, descriptor counts, receive buffer units,
maximum frame sizes, and per-VSI consistency before disabling or
changing any queue. This also prevents the 32-bit receive ring length
from being truncated through a 16-bit validation helper.
Advertise the PF frame-size limit in VF resources. Leaving max_mtu
zero causes Linux iavf to request a 16382-byte frame, beyond the
9728-byte limit enforced by this driver.
[20 lines not shown]
man: Link enic.4 to if_enic.4
For consistency, create a symbolic link from enic.4 to also if_enic.4
Reviewed by: ziaee, #manpages
Differential Revision: https://reviews.freebsd.org/D59755
MFC after: 3 days
[CIR] Report errorNYI for function signatures involving atomic types (#221371)
CIR currently has no way to represent atomic types. In most cases this
has no meaningful effect, but it can lead to incorrect argument and
return type classification during calling convention lowering. This
change adds a diagnostic when we are processing function signatures with
atomic types.
Assisted-by: Cursor / Grok 4.6
[flang][OpenACC] Attach a source location to the skipped-directive warning (#224348)
Follow-up to #223579.
Fix the source location of "compiler directive ignored: it appears
between loop levels of a collapsed or tiled loop nest" warning. Harden
`flang/test/Lower/OpenACC/acc-loop-collapse-directive-between-loops.f90`
test.
Assisted-by: AI
NAS-143860 / 27.0.0-BETA.1 / Restart the S3 service when the license changes (#19781)
The S3 daemon asks truenas.entitlements.check for S3_VERSIONING and
S3_AUDIT once, before it registers a bucket, and holds the answer for
the life of the process. A reload re-reads its files and not the license
-- by design, so every registration-consumed fact arrives the same way,
a restart. Nothing performed that restart: no system.post_license_update
subscriber reached the service, and the license reconcile pass carried
no S3 delegate.
So a revoked versioning entitlement went on minting versions until
someone restarted the service by hand, and -- the direction that reaches
a customer -- a granted one left every object-lock bucket the daemon had
excluded at start answering 503 after the license that would serve it
was installed.
Register a RESTART delegate for the service, ordered after the user
delegate since the credentials file the restart renders resolves every
access key through NSS. It runs only while the service is up: RESTART
[4 lines not shown]
[CIR] Implement musttail cleanup handling (#224169)
A musttail call can occur within a cleanup scope if (and only if) the
cleanup is a lifetime end marker or a stack restore. These can be safely
omitted by a direct return such as is needed for a tail call.
This change adds error checking to verify that only these cleanups are
on the EH stack when a musttail call is encountered and updates the CFG
flattening pass to add special handling that avoids routing musttail
call returns through the cleanup handler.
Assisted-by: Cursor / claude-opus-5
WebAssembly: Partially clean up subtarget construction (#224307)
There should be just one getSubtargetImpl(Function&) override like every
other target, but this is relying on the global subtarget. Remove the
argumentless form since it's unnecessary.
WebAssemblyCoalesceFeaturesAndStripAtomics doesn't really need to
construct a full new subtarget for its purpose and can directly take the global
subtarget feature bits. This pass is also doing quite a lot of other bad things,
like mutating the TargetMachine.
Co-authored-by: Claude (Claude-Opus-4.8) <noreply at anthropic.com>