FreeBSD/src 138bce7 — usr.sbin/chroot chroot.8 chroot.c

chroot(8): add altroot mode

Reviewed by:    markj
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D60035
DeltaFile
+36-14usr.sbin/chroot/chroot.c
+25-0usr.sbin/chroot/chroot.8
+61-142 files

FreeBSD/src 25f21bb — sys/sys user.h

sys/user.h: make KF_FD_TYPE macros safer

Reviewed by:    markj
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D60035
DeltaFile
+6-6sys/sys/user.h
+6-61 files

FreeBSD/src c97671a — usr.bin/procstat procstat.1 procstat_files.c

procstat(1): teach about altroot

Reviewed by:    markj
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D60035
DeltaFile
+1-1usr.bin/procstat/procstat.1
+2-0usr.bin/procstat/procstat_files.c
+3-12 files

FreeBSD/src face51f — usr.bin/fstat fuser.c fstat.c

fstat(1), fuser(1): teach about altroot

Reviewed by:    markj
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D60035
DeltaFile
+4-1usr.bin/fstat/fuser.1
+4-1usr.bin/fstat/fstat.1
+2-0usr.bin/fstat/fstat.c
+1-0usr.bin/fstat/fuser.c
+11-24 files

FreeBSD/src f92ba77 — lib/libprocstat libprocstat.h libprocstat.c

libprocstat(3): teach about altroot

Reviewed by:    markj
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D60035
DeltaFile
+9-0lib/libprocstat/libprocstat.c
+1-0lib/libprocstat/libprocstat.h
+10-02 files

FreeBSD/src 8cfae68 — sys/kern kern_descrip.c, sys/sys user.h

kinfo: export altroot

Reviewed by:    markj
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D60035
DeltaFile
+7-0sys/kern/kern_descrip.c
+1-0sys/sys/user.h
+8-02 files

FreeBSD/src 29691ec — lib/libsys cap_enter.2

cap_enter.2: document clearing altroot

Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D60035
DeltaFile
+2-0lib/libsys/cap_enter.2
+2-01 files

FreeBSD/src dae40d1 — lib/libsys chroot.2

fchroot.2: document ENOTCAPABLE for O_RESOLVE_BENEATH

Reviewed by:    markj
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D60035
DeltaFile
+9-0lib/libsys/chroot.2
+9-01 files

FreeBSD/src 14016b7 — sys/compat/freebsd32 freebsd32_syscall.h freebsd32_systrace_args.c, sys/kern systrace_args.c

Regen
DeltaFile
+44-0sys/kern/systrace_args.c
+44-0sys/compat/freebsd32/freebsd32_systrace_args.c
+10-0sys/sys/sysproto.h
+3-1sys/sys/syscall.mk
+3-1sys/sys/syscall.h
+3-1sys/compat/freebsd32/freebsd32_syscall.h
+107-36 files not shown
+123-312 files

FreeBSD/src 9757c0c — sys/kern syscalls.master vfs_syscalls.c, sys/sys unistd.h

chaltroot(2) and fchaltroot(2): new syscalls

to change the altroot AKA ABI root for native processes

Reviewed by:    markj
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D60035
DeltaFile
+85-0sys/kern/vfs_syscalls.c
+10-0sys/kern/syscalls.master
+2-0sys/sys/unistd.h
+97-03 files

FreeBSD/src 06ec614 — sys/kern kern_descrip.c

pwd_altroot(9): expand herald comment

Requested and reviewed by:      markj
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D60035
DeltaFile
+5-1sys/kern/kern_descrip.c
+5-11 files

FreeBSD/src 4333964 — sys/kern kern_descrip.c

pwd_altroot(): avoid creating new pwd structure if altroot does not change

Reviewed by:    markj
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D60035
DeltaFile
+13-16sys/kern/kern_descrip.c
+13-161 files

FreeBSD/src 06c455d — sys/compat/linux linux_util.c, sys/kern kern_descrip.c

vfs: guard against altroot pointing to not a directory

Reviewed by:    markj
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D60035
DeltaFile
+7-2sys/compat/linux/linux_util.c
+4-1sys/kern/kern_descrip.c
+1-1sys/sys/filedesc.h
+12-43 files

FreeBSD/src f2ee207 — include unistd.h, lib/libsys Symbol.sys.map

chaltroot(2)/fchaltroot(2): make accessible to userspace

Reviewed by:    markj
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D60035
DeltaFile
+2-0lib/libsys/Symbol.sys.map
+2-0include/unistd.h
+4-02 files

FreeBSD/src e880b7a — sys/security/mac mac_framework.h mac_policy.h, sys/security/mac_stub mac_stub.c

mac(4): add vnode_check_chaltroot

Reviewed by:    markj
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D60035
DeltaFile
+18-0sys/security/mac/mac_vfs.c
+15-0sys/security/mac_test/mac_test.c
+9-0sys/security/mac_stub/mac_stub.c
+3-0sys/security/mac/mac_policy.h
+1-0sys/security/mac/mac_framework.h
+46-05 files

FreeBSD/src 3dac774 — sys/bsm audit_kevents.h, sys/security/audit audit_bsm.c

sys: add AUE_CHALTROOT and AUE_FCHALTROOT

Reviewed by:    markj
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D60035
DeltaFile
+2-0sys/security/audit/audit_bsm.c
+2-0sys/bsm/audit_kevents.h
+4-02 files

FreeBSD/src db5ea29 — sys/kern sys_capability.c

cap_enter(2): clear altroot when entering cap mode.

Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D60035
DeltaFile
+5-0sys/kern/sys_capability.c
+5-01 files

FreeBSD/src 763f6cc — lib/libsys Makefile.sys chroot.2

chroot.2: document chaltroot(2)

Reviewed by:    markj
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D60035
DeltaFile
+111-17lib/libsys/chroot.2
+3-1lib/libsys/Makefile.sys
+114-182 files

FreeBSD/src 151a23f — sys/kern vfs_lookup.c

namei: disallow altroot for beneath lookups

Once namei_setup() has determined that the lookup is strictly relative,
set ni_rootdir to pwd_rdir and mark the lookup as already restarted,
which effectively disables restart on ENOENT.

This is done in namei_setup() and not in NDINIT(), because RBENEATH
might be set after NDINIT() by vn_open_cred() or inherited from
the dirfd in fgetvp_lookup(), and ISRESTARTED is cleared by
NDREINIT()/NDRESET().

Noted by:       markj
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D60035
DeltaFile
+7-0sys/kern/vfs_lookup.c
+7-01 files

FreeBSD/src 2137bad — sys/kern kern_exec.c

exec_new_vmspace(): drop altroot for native processes if setuid

Noted and reviewed by:  markj
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D60035
DeltaFile
+14-0sys/kern/kern_exec.c
+14-01 files

LLVM/project 8292cc5 — llvm/lib/Target/SystemZ/MCTargetDesc SystemZHLASMAsmStreamer.h SystemZHLASMAsmStreamer.cpp, llvm/test/CodeGen/SystemZ zos-ppa2.ll zos-ppa1.ll

[SystemZ][z/OS] Emit printable string data as CE/CA constants in HLASM (#243234)

The HLASM streamer emitted every emitBytes() payload as hex (DC XL),
which made z/OS string data hard to read in the generated assembly.
MCAsmStreamer already distinguishes printable strings from binary data.

Mirror that behavior in SystemZHLASMAsmStreamer::emitBytes(). Each chunk
is classified as follows:

- If it is printable EBCDIC-1047 text (checked after converting it to
ASCII with ConverterEBCDIC::convertToUTF8), emit DC CE'...' using the
converted text.
  - Otherwise, if it is printable ASCII, emit DC CA'...'.
  - Otherwise, fall back to DC XL<n>'...'.

Apostrophes and ampersands inside the quoted text are doubled, as
emitALIAS() already does, so HLASM does not treat them as delimiters or
variable substitutions.


    [17 lines not shown]
DeltaFile
+58-2llvm/lib/Target/SystemZ/MCTargetDesc/SystemZHLASMAsmStreamer.cpp
+22-0llvm/test/CodeGen/SystemZ/zos-hlasm-char-const.ll
+6-12llvm/test/CodeGen/SystemZ/zos-hlasm-dc-xl.ll
+3-3llvm/test/CodeGen/SystemZ/zos-ppa2.ll
+3-3llvm/test/CodeGen/SystemZ/zos-ppa1.ll
+5-0llvm/lib/Target/SystemZ/MCTargetDesc/SystemZHLASMAsmStreamer.h
+97-202 files not shown
+99-228 files

FreeNAS/freenas 8ea61b4 — src/middlewared/middlewared/plugins/container image.py, src/middlewared/middlewared/pytest/unit/plugins/container test_rootfs_filter.py

NAS-144777 / 27.1.0 / Prevent path traversal in container image extraction (by yocalebo) (#20278)

The image pull extracted each tarball member without a filter. A member
name with ../ or a leading slash can write a file outside the image
dataset. Middleware runs as root, so this is a root file write on the
host.

A new filter uses tarfile.tar_filter to reject these members. The
tar_filter also removes the setuid, setgid and sticky bits. A rootfs
needs these bits, so the filter puts the original mode back.

The extraction now also uses numeric_owner. Without it, tarfile gets the
uid and gid from the host user names and not from the image.

Original PR: https://github.com/truenas/middleware/pull/20277

Co-authored-by: Caleb St. John <30729806+yocalebo at users.noreply.github.com>
DeltaFile
+28-0src/middlewared/middlewared/pytest/unit/plugins/container/test_rootfs_filter.py
+8-1src/middlewared/middlewared/plugins/container/image.py
+36-12 files

LLVM/project e20fda9 — flang/lib/Evaluate fold-real.cpp fold-complex.cpp

[flang] Move elementwise fold results instead of copying them (#240581)

The `FoldOperation` overloads for elementwise operations return
`*array`, where `array` is the local `std::optional<Expr<T>>` that
`ApplyElementwise` produced. In C++17, `return *array;` does not move,
so every folded array result (for a named constant, the whole array
`Constant`) is copied once more on the way out.

Return `std::move(*array)` at the 16 sites in `flang/lib/Evaluate`.

Assisted-by: AI
DeltaFile
+9-9flang/lib/Evaluate/fold-implementation.h
+3-3flang/lib/Evaluate/fold-logical.cpp
+2-2flang/lib/Evaluate/fold-character.cpp
+1-1flang/lib/Evaluate/fold-real.cpp
+1-1flang/lib/Evaluate/fold-complex.cpp
+16-165 files

LLVM/project 905d129 — flang/include/flang/Evaluate expression.h

[flang] Make GenericExprWrapper and GenericAssignmentWrapper movable (#240580)

Both wrappers declare a destructor, which suppresses their implicit move
constructor and move assignment. The `std::move` calls in
`SetExprHelper` (`flang/include/flang/Semantics/expression.h`) therefore
fall back to the copy constructor, so every analyzed expression is
deep-copied twice when it is stored into the parse tree. `SetExpr` runs
for every `parser::Expr` node, so a long chain such as `a(1) + a(2) +
... + a(N)` costs time and allocations quadratic in N.

Declare defaulted move operations for both wrappers.

Assisted-by: AI
DeltaFile
+6-0flang/include/flang/Evaluate/expression.h
+6-01 files

FreeNAS/freenas 6184258 — src/middlewared/middlewared/plugins/container query_pull_images.py, src/middlewared/middlewared/pytest/unit/plugins/container test_rootfs_filter.py

NAS-144777 / 28.0.0-BETA.1 / Prevent path traversal in container image extraction (#20277)

The image pull extracted each tarball member without a filter. A member
name with ../ or a leading slash can write a file outside the image
dataset. Middleware runs as root, so this is a root file write on the
host.

A new filter uses tarfile.tar_filter to reject these members. The
tar_filter also removes the setuid, setgid and sticky bits. A rootfs
needs these bits, so the filter puts the original mode back.

The extraction now also uses numeric_owner. Without it, tarfile gets the
uid and gid from the host user names and not from the image.
DeltaFile
+28-0src/middlewared/middlewared/pytest/unit/plugins/container/test_rootfs_filter.py
+8-1src/middlewared/middlewared/plugins/container/query_pull_images.py
+36-12 files

LLVM/project 0359ca0 — clang/lib/CIR/CodeGen CIRGenFunction.h CIRGenStmtOpenMP.cpp, clang/test/CIR/CodeGenOpenMP not-yet-implemented.c target-parallel-for.c

[CIR][OpenMP] Add support for host_eval so that SPMD kernels can be used

This patch adds support for host_eval so that SPMD kernels and in the future
num_threads and other clauses can be implemented correctly.

Assisted-by: Cursor / Claude Sonnet 5 High
DeltaFile
+225-30clang/lib/CIR/CodeGen/CIRGenStmtOpenMP.cpp
+96-0clang/test/CIR/CodeGenOpenMP/target-host-eval.c
+53-33clang/test/CIR/CodeGenOpenMP/target-parallel-for.c
+26-0clang/lib/CIR/CodeGen/CIRGenFunction.h
+9-0clang/test/CIR/CodeGenOpenMP/not-yet-implemented.c
+409-635 files

LLVM/project eab5f43 — clang/include/clang/Basic AttrDocs.td, clang/lib/CodeGen CGStmt.cpp

[BPF] Relocate enumerators in case labels and add -fbpf-no-enum-reloc= (#243338)

This is a follow-up to #232498, which added the preserve_access_index
attribute for enums. It resolves two points from the review.

Switch cases
------------
An enumerator in a case label was not relocated: the case label requires
a constant, so the local value was used and -Wbpf-enum-not-relocated was
reported. Now it is relocated, so `case A:` behaves like
`if (cond == A)`. For example:
```
  enum bpf_func_id { BPF_FUNC_a = 1, BPF_FUNC_b = 4 }
      __attribute__((preserve_access_index));

  int f(int id) {
    switch (id) {
    case 2:
      return 1;

    [107 lines not shown]
DeltaFile
+276-0clang/test/CodeGen/bpf-attr-preserve-access-index-enum-switch.c
+124-13clang/lib/Sema/SemaBPF.cpp
+113-3clang/lib/CodeGen/CGStmt.cpp
+70-0clang/test/Sema/bpf-attr-preserve-access-index-enum-switch.c
+40-7clang/lib/Sema/SemaStmt.cpp
+41-5clang/include/clang/Basic/AttrDocs.td
+664-2811 files not shown
+750-3217 files

LLVM/project 1ed0efd — llvm/lib/Target/Mips MipsISelLowering.cpp MipsFrameLowering.cpp, llvm/test/CodeGen/Mips large-call-frame.mir large-call-frame.ll

[Mips] Use a frame pointer when the call frame isn't reserved (#242006)

If the outgoing call frame is too large to reserve, SP is adjusted
around calls.

Without a frame pointer, locals and spills are addressed from SP. Mips
eliminateFrameIndex() ignores SPAdj (and the scavenger uses SPAdj = 0
for emergency spill slot), so accesses inside a call sequence can use
the wrong address.

Adapt #181302 and #182124 from RISC-V.

- Force a frame pointer when the call frame isn't reserved.
- Compute the max call frame size at the end of ISel, so hasFP() is
known before reserved registers are frozen.
- Compute it when loading MIR too.
- Regenerate tests. Checks in byval.ll were encoding wrong addresses.
DeltaFile
+337-0llvm/test/CodeGen/Mips/large-call-frame.ll
+142-79llvm/test/CodeGen/Mips/cconv/byval.ll
+55-0llvm/test/CodeGen/Mips/large-call-frame.mir
+11-0llvm/lib/Target/Mips/MipsSubtarget.cpp
+6-2llvm/lib/Target/Mips/MipsFrameLowering.cpp
+6-0llvm/lib/Target/Mips/MipsISelLowering.cpp
+557-813 files not shown
+562-839 files

LLVM/project b2f2da5 — mlir/tools/mlir-tblgen DialectGenUtilities.h

forgotten header
DeltaFile
+1-0mlir/tools/mlir-tblgen/DialectGenUtilities.h
+1-01 files

LLVM/project dc9acf1 — polly/lib/CodeGen CodeGeneration.cpp, polly/test/CodeGen/Metadata fallback_vec_annotate_known_false.ll

[Polly] Retain vectorization for fallback loop when RTC is provably false at compile time (#243781)

Polly currently has a guard to not disable vectorization if the runtime
condition is constant False. This expands that to also include
situations where the runtime guard is non-constant, but provably false
at compile time, e.g RTC = (cond1 && cond2 && cond3), and any of them is
false. Currently vectorization is disabled in those cases, causing big
slowdowns.

Fixes #243780

Assisted by Codex (6.1 Sol and 6.1 Astra)
DeltaFile
+77-0polly/test/CodeGen/Metadata/fallback_vec_annotate_known_false.ll
+9-9polly/lib/CodeGen/CodeGeneration.cpp
+86-92 files