NAS-145122 / 27.1.0 / Restart winbindd at the end of SMB configuration when the local server SID changes (#20285)
On the first boot after an upgrade, or any boot where the local server
SID stored by Samba differs from the configured one, SMB setup rewrites
the SID and logs that it is restarting winbindd, but the restart was
silently skipped because SMB had not finished configuring yet. winbindd
kept the old SID, so looking up local accounts through it (`wbinfo -n`,
`wbinfo -s`) failed with a domain-not-found error until winbind was
restarted by hand. SMB logins and share access were unaffected, and
Active Directory member servers were repaired by the directory services
health check shortly after boot.
- When the SID changed under a running winbindd, winbindd is now
restarted once SMB configuration finishes, which also restarts smbd. A
boot where the SID is unchanged does nothing new.
- If that restart fails, the error is logged and SMB configuration still
completes, so directory services setup goes on to restart SMB and the
other dependent services.
- On failover, where the restart already took effect, it now happens at
[7 lines not shown]
[lit] Add the system-openbsd feature (#248631)
lit defines a system-* feature for each host OS it knows, but not for
OpenBSD, so tests cannot be marked UNSUPPORTED or XFAIL there. LLDB's
TestCustomShell.test already has "XFAIL: system-openbsd", which never
applies.
Assisted-by: Claude Opus 5.5
[GlobalDCE] A `NULL` slot does not disqualify the vtable from VFE (#239989)
When a vtable contains a `NULL` slot, do not disqualify it from VFE.
There is not a valid function pointer there, so there is no callee to
keep alive.
The code then also needlessly removed the vtable from `VFESafeVTables`.
Again, NULL is not a valid function pointer so this vtable will never be
used to make a virtual call to the function stored in this slot. That is
actually extremely valuable information for VFE.
This change is particularly relevant for Rust, because it stores the
function pointer of a destructor as part of a `[24 x i8]` byte array in
the vtable. This destructor can be `NULL` for some, but not all, members
of a `!type` set. Currently having one `NULL` in the set disqualifies
the whole vtable.
This PR does not depend on
https://github.com/llvm/llvm-project/pull/239993, but together they make
it possible for Rust to eliminate implementations of `drop_in_place`.
This is a destructor that some vtables have, and others set to `NULL`.
[Utils] Consolidate metadata utilities (NFC) (#243671)
Metadata transfer functions are defined in both `Local.cpp` and
`VectorUtils.cpp`. Move these all to `MetadataUtils.cpp` in preparation
for unifying some of the functionality. When someone adds new metadata
it's useful for all the decisions on how it's preserved in the IR to be
in one spot.
AI assisted.
[COFF] Speed up ICF by hashing relocations and propagating over an edge list (#239794)
Ports #233697 from ELF to COFF.
Hash everything that sectionsEqual<true> checks, and record references
to other ICF candidates (relocations, entry thunks, associated children) in
an edge list, and propagate the hashes over the edges for 7 rounds. Each
round saves up to 1 segregate pass.
Also log folded sections in input order, ported from #233345 done on
ELF, so that the /verbose output does not depend on the hash.
Using the chrome.dll reproducer from #229849, the output is
byte-identical, and segregate() passes go from 8 -> 3:
ICF
default threads 987 -> 573 ms
/threads:8 1805 -> 1002 ms
NAS-145364 / 27.1.0 / middleware: strengthen path handling (by anodos325) (#20294)
Paths that an unprivileged user may control are opened with safe_open,
safe_open_raw and safe_makedirs from truenas_os_pyutils, which refuse a
symlink anywhere in the path, and a FIFO, socket or device node before
opening it.
- rsync: create and chown ~/.ssh/known_hosts through symlink-refusing
fds; cap the known_hosts read at 4 MiB
- ssh-keyscan: pass "--" before the host
- user: read authorized_keys with safe_open, capped at 1 MiB; unlink it
through a symlink-free .ssh fd
- filesystem.mkdir: chmod, rmdir and listxattr through fds; compare .ssh
by component
- NFS: refuse export paths that exportfs would rewrite
- nvmet: a FILE namespace must be a symlink-free regular file in a data
pool
- SMB: path_suffix and dataset_naming_schema must stay beneath the share
- filesystem.set_zfs_attributes: callers without FULL_ADMIN are limited
[17 lines not shown]
httpd: pass struct server_request to the request handlers
Make handlers and the response writer take the request
instead of the client.
No functional change.
looks fine claudio@, OK rsadowski@
[clang][Sema] Do not warn about predefined identifiers outside a function in unevaluated operands (#248329)
Clang warns about `__func__`, `__FUNCTION__` and `__PRETTY_FUNCTION__`
outside a function even when the name is in an unevaluated operand,
where it is never used.
glibc's `assert/tst-assert-c++.cc` has this at namespace scope:
```cpp
static_assert(is_void <decltype (assert (""))>::value, "type is void");
```
`assert()` uses `__PRETTY_FUNCTION__`, so the test fails to build with
`-Werror`.
Do not emit `-Wpredefined-identifier-outside-function` in an unevaluated
operand such as `sizeof`, `decltype`, `typeof` or `noexcept`. Do the
same for the Microsoft string literal expansion of `__FUNCTION__` and
friends (`"" __FUNCTION__`). A use that is evaluated still warns.
Assisted-by: Claude Opus 5.5
NAS-145589 / 28.0.0-BETA.1 / Make `test_smb_protocol_base` share per-test, not per-module (#20364)
When we turn on AFP, the old connection doesn't see it, and subsequent
AFP-related tests fail.
[lld][ELF][SPARC] Read the implicit addend of every dynamic relocation (#246806)
getImplicitAddend() only handled R_SPARC_64 and R_SPARC_GLOB_DAT, so
-z rel and --check-dynamic-relocations failed with "internal linker
error: cannot read addend" for R_SPARC_TLS_TPOFF64 and R_SPARC_JMP_SLOT.
Add R_SPARC_RELATIVE and R_SPARC_TLS_TPOFF64, and treat R_SPARC_JMP_SLOT
and R_SPARC_NONE as having no implicit addend, as the other targets do.
Assisted-by: Claude Opus 5.5
py-cloud-init: NetBSD startup scripts
Install the custom NetBSD start scripts into /etc/rc.d.
Added some TODO items.
Patch cloudinit/dmi.py and tools/ds-identify to understand NetBSD
sysctl names as well as OpenBSD sysctl names.
httpd: add struct server_request
Move the request state out of struct client into a new struct
server_request, one allocated per client.
No functional change.
looks fine claudio@, OK rsadowski@
AMDGPU: Model the low 16 bits of bf16 immediates as encoded
Only the low 16 bits of a bf16 immediate are encoded, so an immediate
whose low 16 bits are a floating-point inline constant reads the fp32
inline constant, regardless of the high bits. getImmOperandBits instead
treated it as a literal reading its low 16 bits, so a fold could replace
a register with the immediate in a source reading the low half, which
would read 0.
This is a latent miscompile, but unlikely to be reached since a 32-bit
constant with high bits set is not normally used as a bf16 operand.
Assisted-by: Claude
[flang-rt] Avoid recursion through BeginReadingRecord on the device (#248582)
Commit e2da32dd7802 made ExternalFileUnit::BeginReadingRecord() call
Endfile() after a short direct-access read. In CUDA device code this
closes a call graph cycle:
AdvanceRecord() -> BeginReadingRecord() -> Endfile() -> DoEndfile()
-> AdvanceRecord()
AdvanceRecord() is statically reachable from EndIoStatement(), so nvlink
can no longer compute the stack size of any kernel that performs I/O,
such as a list-directed WRITE ("Stack size for entry function ... cannot
be statically determined"), and such kernels may overflow their stack at
run time.
The device pseudo unit supports only output, so BeginReadingRecord()
never runs there. Under RT_DEVICE_AVOID_RECURSION, replace its body with
a crash, as is already done for child I/O. This also keeps future
changes to the input record handling from adding cycles to device code.
Assisted-by: Cursor