Important
Due to the rising tide of supply chain attacks, we have stopped using
"Trusted" Publishing for our crates.io and PyPi releases. Their
UIs imply that such releases are "more trusted" but as the recent attacks
have shown, they actually grant your code forge's entire infrastructure the
right to release things on your behalf.
It would be nice if crates.io and PyPI supported a proper signing model
where developers control their keys, but that is sadly not the case today.
For PyPI, detached PGP keys in PyPI are basically security theatre
and PEP 480 has stalled; for crates.io there appears to be no
mechanism for signing your releases with a key you control directly!
Breaking
pathrs_inroot_hardlinkandpathrs_inroot_symlinkhave been switched to
using the standard argument order from their respective system calls
(previously the order was swapped, which lead to possible confusion).- Previously compiled programs will continue to work (thanks to symbol
versioning) but rebuilt programs will need to adjust their argument order. - Rust users are not affected by this change.
- For the Go and Python bindings, the wrappers have also had their argument
orders swapped to match the C API and so will also need to be updated when
rebuilding. This is a very important point! Users must ensure that they
use pre-0.2.5bindings with pre-0.2.5libpathrs library installs, and
post-0.2.5bindings with post-0.2.5library installs. Mixing and
matching them will cause bugs (most likely spuriousENOENTerrors). - For the sake of future extensions (and to ease the migration),
pathrs_inroot_hardlinknow accepts both anold_root_fdand
new_root_fd. At the moment, callers must pass the same value to both
arguments (this means the same numeric file descriptor value, not just a
reference to the same underlying file).- The Go and Python bindings for
pathrs_inroot_hardlinkhave not had
their APIs changed, and so they still only permit operating within a
single root.
- The Go and Python bindings for
- Previously compiled programs will continue to work (thanks to symbol
pathrs_inroot_renamealso now accepts both anold_root_fdand
new_root_fd, with the same caveats aspathrs_inroot_hardlinkabove.- The Go and Python bindings for
pathrs_inroot_renamehave not had their
APIs changed, and so they still only permit operating within a single
root.
- The Go and Python bindings for
RenameFlagsis now backed by au64(instead oflibc::c_uint) so that we
can accommodate future extension bits beyond the kernel's current 32-bit ABI.
Rust callers usingRenameFlags::bits()or storing the raw value will need
to adjust their types.- As part of this,
pathrs_inroot_renamenow also takes auint64_t, and
thus the the Go(*Root).Renamewrapper takes auint64as well.
- As part of this,
OpenFlagsis now backed by au64(instead oflibc::c_int), as recent
kernel changes such asOPENAT2_REGULARwill likely start to use some of the
upper flag bits available fromopenat2(2). This has an impact on all C APIs
(and thus Go bindings) that acceptOpenFlagsarguments (we do provide old
symbol versions to ease the transition):pathrs_reopenpathrs_inroot_openpathrs_inroot_creatpathrs_proc_openpathrs_proc_openat
Added
- capi: We now have a new
pathrs_versionAPI that provides runtime version
information, which loosely matches other libraries likelibseccomp. The API
is based on extensible structs, so we can add more information here in the
future. install.shnow supports--disable-staticand--disable-dynamicto limit
what files are installed (their--enable-*inverses are also available for
completeness, but they both are enabled by default).
Fixed
-
Containers often have
/proc/sysovermounted with a read-only mount to avoid
container escapes, this caused theO_PATHresolver to panic because the
hardened procfs lookup for/proc/sys/fs/protected_symlinkswould fail. We
now conservatively assume thatfs.protected_symlinksis enabled if we
cannot access the file for any reason.This also causes attempts to access
/proc/sysfiles usingProcfsHandleto
also fail (by design). In the future we plan to provide some quality-of-life
improvements to permit access in those cases, but at the moment users need to
be aware that those kinds of accesses can fail. -
Root::readlinkandProcfsHandle::readlinkwould previously return
ENOENTif the target path existed but was not a symlink. This occurred
because of a peculiar asymmetry in the kernel APIs forreadlinkat(2), but
users found it confusing and so we now remap the error in that case to
EINVAL(as you would get fromreadlink(2)with a path). This will make it
easier to distinguish the "target path does not exist" and "target path is
not a symlink" cases.
Thanks to the following contributors who made this release possible:
- Aleksa Sarai cyphar@cyphar.com
- Kir Kolyshkin kolyshkin@gmail.com
Signed-off-by: Aleksa Sarai cyphar@cyphar.com