This adds `__riscv` (curiously, gcc does not define `__riscv__`) psx
compilation support.
https://bugzilla.kernel.org/show_bug.cgi?id=219687
Also, add explicit __x86_64__ compilation support. It was working
implicitly, but change to be consistent.
Signed-off-by: Andrew G. Morgan <morgan@kernel.org>
kill(2) is declared in signal.h, however previously this header was not
included. It happened to work on glibc, where sys/wait.h includes
signal.h, this is however not required behavior in the POSIX standard:
> Inclusion of the <sys/wait.h> header may also make visible all symbols
> from <signal.h> and <sys/resource.h>.
Signed-off-by: Andrew G. Morgan <morgan@kernel.org>
The code was using `hval` when it should have used `mix`. I've removed
`hval` from the code now. This fixes this bug:
https://bugzilla.kernel.org/show_bug.cgi?id=219752
Signed-off-by: Andrew G. Morgan <morgan@kernel.org>
The previous commit fixed a bug with the config parsing in pam_cap.
This is a test that we don't regress against that fix.
Signed-off-by: Andrew G. Morgan <morgan@kernel.org>
The current configuration parsing does not actually skip user names
that do not start with @, but instead treats the name as a group
name for further parsing, which can result in matching unexpected
capability sets and may trigger potential security issues. Only
names starting with @ should be parsed as group names.
Signed-off-by: Tianjia Zhang <tianjia.zhang@linux.alibaba.com>
Signed-off-by: Andrew G. Morgan <morgan@kernel.org>
This bug, reported by David Runge, identifies another regression
vs. libpsx-2.71:
https://bugzilla.kernel.org/show_bug.cgi?id=219687
A regression of the LWP threading support reintroduced an old bug
in the libpsx-2.72 rewrite, specifically this bug:
https://github.com/golang/go/issues/42494
This present change includes x86_64, i386 and arm* (32-bit and 64-bit)
support. I've tested each of these with debian OSes, some running via QEMU.
Before releasing 2.74, I plan to extend the testing to all of the targets
supported by Debian (see https://wiki.debian.org/DebianInstaller/Qemu).
Signed-off-by: Andrew G. Morgan <morgan@kernel.org>
As a workaround for the golang bug: 70630, specifically comment
70630#issuecomment-2513491664 provide an alias for the package.
Perhaps, at some point, that bug or the one it is duped into will
be fixed, and we can remove this workaround.
Signed-off-by: Andrew G. Morgan <morgan@kernel.org>
These were reported by Carlos Rodriguez-Fernandez with respect
to some analysis performed on the Fedora libcap-2.71 package.
Signed-off-by: Andrew G. Morgan <morgan@kernel.org>
On relatively new architectures (for example ARM64, RISC-V, and
LoongArch), the kernel does not have a getdents syscall. Use getdents64
instead to fix the build on them.
The getdents64 syscall was added in Linux 2.4 and I don't think we
should still support older kernels today.
Signed-off-by: Xi Ruoyao <xry111@xry111.site>
Signed-off-by: Andrew G. Morgan <morgan@kernel.org>
Still trying to coax some go.dev documentation into providing runnable
examples. Iterating with a single simple one.
Signed-off-by: Andrew G. Morgan <morgan@kernel.org>
How this is relevant to the PSX code (since its 2.72 refactor) is the
subject of:
https://bugzilla.kernel.org/show_bug.cgi?id=219478
Since we've decided to not fully support earlier versions of Go by
working around this bug any longer, modify the test to not test for
this bug.
Signed-off-by: Andrew G. Morgan <morgan@kernel.org>
This addresses the following bug:
https://bugzilla.kernel.org/show_bug.cgi?id=219456
insofar as it eliminates the need for -wrap=pthread_create
linkage. Mostly, code that uses -lpsx functions can simply
link with -lpsx now. However, for legacy reasons the library
still works when linked wrapped or with the new content of
the libpsx.pc file:
-Wl,--no-as-needed -Wl,--whole-archive -lpsx -Wl,--no-whole-archive -Wl,--as-needed -lpthread
These last options are required for getting -lcap to act at a
consistent process level and not a thread level.
Signed-off-by: Andrew G. Morgan <morgan@kernel.org>
The refactoring of libpsx to operate at a LWP level and not
the pthread level has caused an old Go issue to reappear.
Details:
https://bugzilla.kernel.org/show_bug.cgi?id=219478
Signed-off-by: Andrew G. Morgan <morgan@kernel.org>
Trying to find a path for not needing linker wrapping.
This feels like a step in the right direction, but doesn't
allow removal of the -wrap linkage yet.
Signed-off-by: Andrew G. Morgan <morgan@kernel.org>
The refactored libpsx code does not operate at the pthread
abstraction. We still need the --wrap linkage to force
libpsx to be linked into the binary if the binary makes
no explicit calls to libpsx functions. But we should no
longer need it in cases where the code calls psx_syscall[36]().
This is a step towards addressing:
https://bugzilla.kernel.org/show_bug.cgi?id=219456
Signed-off-by: Andrew G. Morgan <morgan@kernel.org>
These may seem excessive, but:
- 3 are for Go module version naming automation
- 1 is for kernel.org automation purposes
- 1 is for legacy consistency tagging
- 1 moving forward "official" tagging (packagers can use this one)
I've back-signed all of the libcap-2.xy releases with the "official" key:
$ gpg --fingerprint 0D23D34C577B08C4082CFD76430C5CFF993116B1
pub ed25519 2024-10-26 [SC]
0D23 D34C 577B 08C4 082C FD76 430C 5CFF 9931 16B1
uid [ultimate] Andrew G. Morgan (2024+ libcap signing key) <morgan@kernel.org>
sub cv25519 2024-10-26 [E]
Since the legacy tag uses a no longer considered secure technology,
I'll likely stop using it around libcap-2.75 when the new key has
gained more history and trust.
Signed-off-by: Andrew G. Morgan <morgan@kernel.org>
Trying to coax some go.dev documentation into providing runnable
examples. Starting with a single simple one.
Signed-off-by: Andrew G. Morgan <morgan@kernel.org>
Starting with libcap-2.71 the following key is considered
the load bearing one on tags sig-libcap-2.xy:
0D23D34C577B08C4082CFD76430C5CFF993116B1
We'll back tag all of the libcap-2.* releases with the
corresponding signed tag.
Further, starting with libcap-2.72, we'll transition all of
the Go package tags (*v1.2.xy) to be signed with this key.
Signed-off-by: Andrew G. Morgan <morgan@kernel.org>
This demonstrates libpsx-2.72+ is now compatibile with the
std::thread variety of C++ threading under Linux.
This completes support for:
https://bugzilla.kernel.org/show_bug.cgi?id=218607
Signed-off-by: Andrew G. Morgan <morgan@kernel.org>
Discussion and explanation of what is up here is in:
https://bugzilla.kernel.org/show_bug.cgi?id=219169
This gets the Go cap package to parity with the recent changes to
libcap. This change will be live in cap/v1.2.71.
Signed-off-by: Andrew G. Morgan <morgan@kernel.org>