Add boot_setenv
Move is_restricted_var() to libsa/environment.c so it can be leveraged
by boot_setenv called from subr_boot with not truted input.
Also, allow for local tuning via ENV_IS_RESTRICTED_ALLOWED_LIST and
ENV_IS_RESTRICTED_LIST
Sponsored by: Hewlett Packard Enterprise Development LP.
Reviewed by: kevans, imp
Differential Revision: https://reviews.freebsd.org/D56287
[lldb] Support comparing FileSpec against Python strings (#190690)
We got a bug report where someone was iterating over the modules and
wanted to verify that the module name was empty and noticed it didn't
trigger.
```
for module in target.module_iter():
if module.file is None or module.file == "":
# Do something
```
My initial hypothesis was that we were somehow skipping modules, but
upon further investigation, it was the string comparison that was the
culprit. The reporter (reasonably) expected the `file` property to
return a string, but in reality it returns a SBFileSpec.
This could be avoided by explicitly comparing with an empty FileSpec,
but that seems needlessly tedious.
[9 lines not shown]
[SPARC][IAS] Make 64-bit instructions available in 32-bit mode on V9 (#187534)
When the ISA level is V9, 64-bit instruction definitions should be available
even if currently it's not used by any patterns.
This should allow usage of 64-bit instructions, like `sllx`/`srlx`, in inline
assembly snippets in a source file otherwise intended to target V9 processors
running in 32-bit mode, as found in, for example, the Linux kernel.
[lldb][AIX] Enable NativeProcessAIX Manager for lldb-server (#190173)
This PR is in reference to porting LLDB on AIX. Ref discusssions: [llvm
discourse](https://discourse.llvm.org/t/port-lldb-to-ibm-aix/80640) and
https://github.com/llvm/llvm-project/issues/101657.
Complete changes together in this draft:
- https://github.com/llvm/llvm-project/pull/102601
Description:
This change enables proper AIX processes integration with lldb-server,
ensuring correct loading and handling of AIX target architectures.
It also retrieves the target process architecture from the host and
configures NativeProcessAIX accordingly.
stand: Fix zf_open() by providing 'zalloc' and 'zfree' hooks
When Z_SOLO is defined, zlib is built for a standalone environment,
where there is no host memory management, so the caller must provides
the 'zalloc' and 'zfree' hooks. Otherwise, inflateInit2() would return
-2 (Z_STREAM_ERROR).
This fixes the failure of booting into rescue mode because loader failed
to decompress 'initrd.img.gz':
```
zf_open: inflateInit returned -2 : (null)
Unable to load /kernel/initrd.img
```
Add support for POSIX_FADV_DONTNEED
For now make it only evict the specified data from the dbuf cache.
Even though dbuf cache is small, this may still reduce eviction of
more useful data from there, and slightly accelerate ARC evictions
by making the blocks there evictable a bit sooner.
On FreeBSD this also adds support for POSIX_FADV_NOREUSE, since the
kernel translates it into POSIX_FADV_DONTNEED after every read/write.
This is not as efficient as it could be for ZFS, but that is the only
way FreeBSD kernel allows to handle POSIX_FADV_NOREUSE now.
Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Signed-off-by: Alexander Motin <alexander.motin at TrueNAS.com>
Closes #18399
cd9660: Add length checks to Rock Ridge parser
* cd9660_rrip_slink() did not check that the lengths of individual
entries do not exceed the length of the overall record.
* cd9660_rrip_altname() did not check that the length of the record
was at least 5 before subtracting 5 from it.
Note that in both cases, a better solution would be to check the length
of the data before calling the handler, or immediately upon entry of
the handler, but this would require significant refactoring.
MFC after: 1 week
Reported by: Calif.io in collaboration with Claude and Anthropic Research
Reported by: Adam Crosser, Praetorian
Reviewed by: markj
Differential Revision: https://reviews.freebsd.org/D56215
(cherry picked from commit d0afead876076f605c363f03d92304d1bd75be1c)
cd9660: Add length checks to Rock Ridge parser
* cd9660_rrip_slink() did not check that the lengths of individual
entries do not exceed the length of the overall record.
* cd9660_rrip_altname() did not check that the length of the record
was at least 5 before subtracting 5 from it.
Note that in both cases, a better solution would be to check the length
of the data before calling the handler, or immediately upon entry of
the handler, but this would require significant refactoring.
MFC after: 1 week
Reported by: Calif.io in collaboration with Claude and Anthropic Research
Reported by: Adam Crosser, Praetorian
Reviewed by: markj
Differential Revision: https://reviews.freebsd.org/D56215
(cherry picked from commit d0afead876076f605c363f03d92304d1bd75be1c)
pkgbase: Move all of Kyua into the kyua package
Some Kyua directories were improperly tagged as belonging to the tests
package. Move them to the kyua package, which contains all of the
files found in these directories.
PR: 294129
MFC after: 1 week
Reviewed by: ivy, emaste
Differential Revision: https://reviews.freebsd.org/D56159
(cherry picked from commit 40e8afadc393a102f4199228ae2047d3e6c71251)
cd9660: Add length checks to Rock Ridge parser
* cd9660_rrip_slink() did not check that the lengths of individual
entries do not exceed the length of the overall record.
* cd9660_rrip_altname() did not check that the length of the record
was at least 5 before subtracting 5 from it.
Note that in both cases, a better solution would be to check the length
of the data before calling the handler, or immediately upon entry of
the handler, but this would require significant refactoring.
MFC after: 1 week
Reported by: Calif.io in collaboration with Claude and Anthropic Research
Reported by: Adam Crosser, Praetorian
Reviewed by: markj
Differential Revision: https://reviews.freebsd.org/D56215
(cherry picked from commit d0afead876076f605c363f03d92304d1bd75be1c)
pkgbase: Move all of ATF into the atf package
Parts of ATF (including the licence and some of the documentation) were
for some reason part of the tests package instead of the atf package.
Moving them to where they logically belong poses no problem since tests
already depends on atf.
PR: 294129
MFC after: 1 week
Reviewed by: ivy
Differential Revision: https://reviews.freebsd.org/D56158
(cherry picked from commit 0a6dbf51d8ea112a1d164be260004ec795b4368d)
kernel: Be clearer about what ZSTDIO is for
ZSTDIO is not just for core dumps, and it is now required by ZFS, so
move it (and GZIO, which is still just for dumps) to a new “Compression
support” section in GENERIC, and add them both to MINIMAL.
MFC after: 1 week
Reviewed by: imp
Differential Revision: https://reviews.freebsd.org/D55940
(cherry picked from commit 092687a031064dc08ac198648c6393cc50b06cee)
cd9660: Partial style sweep of Rock Ridge code
This mostly just fixes indentation and continuations and adds spaces
after commas and around binary operators and parentheses around return
values, but cd9660_rrip_extref() was so egregiously unreadable I
rewrote it. Note that this was done manually, so I may have missed a
few spots, and I made no attempt to fix over-long lines.
MFC after: 1 week
Reviewed by: markj
Differential Revision: https://reviews.freebsd.org/D55865
(cherry picked from commit e6a77f81d1eb345f6a8c827ecf555b88996c8763)
[mlir][OpenMP] Fix taskloop outlined step handling (#190198)
The outlined taskloop preheader still used the original function's
casted step value when computing the canonical loop trip count. When
lb/ub/step were defined outside the taskloop body, the outlined function
ended up referring to an instruction from another function, which
crashed LLVM IR verification and finalization.
Reload the task step from the outlined task shareds, alongside lb and
ub, and use that value for the trip-count division. Update the MLIR
taskloop checks and add a regression for outer-scope variable bounds.
Fortran reproducer:
```
subroutine test(lb, ub, step)
integer :: i, lb, ub, step
!$omp taskloop
do i=lb,ub,step
[6 lines not shown]
nfs_diskless: Fix handling of nfsuserd case for NFSv4
Commit 8b9775912cbc added support for an NFSv4 mounted
root file system, but only if the NFSv4 configuration
used id numbers in the strings.
This patch adds support for the case where the NFSv4
configuration uses name<-->id mappings via nfsuserd(8)
by priming the mapping cache with just enough entries
so that it works until the nfsuserd(8) is running.
They are listed in nfs_prime_userd[] in
sys/fs/nfs/nfs_commonsubs.c.
The entries in nfs_prime_userd[] are also wired into
the kernel's cache for name<-->id mappings when nfsuserd(8)
starts up. This is necessary, since an upcall to the
nfsuserd(8) daemon for a mapping when looking up the
path to the passwd/group database files (/etc) will
hang the system, due to a vnode lock being held on
[15 lines not shown]
[InstSimplify] Fix Compilation Hang in simplifyExtractValueInst (#190279)
Jump Threading can create self-referential insertvalues which are
allowed by the verifier in unreachable code. These self-referential
insertvalues cause the compilation to hang in simplifyExtractValueInst.
This PR adds a check to break out of the loop if it detects it is a
self-referential insertvalue and adds the reproducer's bitcode as a
test.
Fixes: https://github.com/llvm/llvm-project/issues/187381
[pdb] Store symbol names without null terminators in PublicsStreamTest (#190790)
to catch any bugs where code assumes these names are null terminated.
This would have caught (at least in ASan builds) #163755 and the bug
fixed in #190133.
sound: Make chn_reset() control flow clearer
I think this is cleaner than playing around with return values.
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Reviewed by: markj
Differential Revision: https://reviews.freebsd.org/D56264
sound: Simplify parts of chn_notify()
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Reviewed by: markj
Differential Revision: https://reviews.freebsd.org/D56240