3 ms·
Interesting, pax-utils-v1.2.5 on Arch Linux 5.10.9-arch1-1: > pspax USER PID PAX MAPS ETYPE NAME CAPS ATTR [1] 3209832
by neop1x 6y ago
Interesting, pax-utils-v1.2.5 on Arch Linux 5.10.9-arch1-1:
> pspax
USER PID PAX MAPS ETYPE NAME CAPS ATTR
[1] 3209832 invalid system call (core dumped) pspax
Stack trace of thread 3209832:
#0 0x00007fbdb92d89ab __socket (libc.so.6 + 0x1019ab)
#1 0x00007fbdb930dce0 open_socket (libc.so.6 + 0x136ce0)
#2 0x00007fbdb930e1de __nscd_get_mapping (libc.so.6 + 0x1371de)
#3 0x00007fbdb930e62f __nscd_get_map_ref (libc.so.6 + 0x13762f)
#4 0x00007fbdb930ac47 nscd_getpw_r (libc.so.6 + 0x133c47)
#5 0x00007fbdb930b0b6 __nscd_getpwuid_r (libc.so.6 + 0x1340b6)
#6 0x00007fbdb92a3895 getpwuid_r@@GLIBC_2.2.5 (libc.so.6 + 0xcc895)
#7 0x00007fbdb92a2eeb getpwuid (libc.so.6 + 0xcbeeb)
#8 0x0000558995732566 n/a (pspax + 0x4566)
#9 0x00007fbdb91ff152 __libc_start_main (libc.so.6 + 0x28152)
#10 0x0000558995732e8e n/a (pspax + 0x4e8e)
Dump of assembler code for function socket:
0x00007fb1d04139a0 <+0>: endbr64
0x00007fb1d04139a4 <+4>: mov $0x29,%eax
0x00007fb1d04139a9 <+9>: syscall
=> 0x00007fb1d04139ab <+11>: cmp $0xfffffffffffff001,%rax
0x00007fb1d04139b1 <+17>: jae 0x7fb1d04139b4 <socket+20>
0x00007fb1d04139b3 <+19>: ret
0x00007fb1d04139b4 <+20>: mov 0xc0495(%rip),%rcx # 0x7fb1d04d3e50
This can be a system library incompatibility though as don't have all system packages up-to-date.
The code compiled from https://github.com/gentoo/pax-utils https://github.com/gentoo/pax-utils runs but displays just = under CAPS for every process.
So I am not sure it is generally usable outside of Gentoo (yet).
- eqvinox 6y agoTook a quick look... can you try this diff? --- pspax.c 2021-02-26 09:46:14.304092510 +0100 +++ pspax.c 2021-02-25 11:25:42.439550015 +0100 @@ -413,7 +413,7 @@ /* this is a non-POSIX function */ caps = NULL; - WRAP_SYSCAP(capgetp(pfd, cap_d)); + WRAP_SYSCAP(cap_d = cap_get_pid(pid)); WRAP_SYSCAP(caps = cap_to_text(cap_d, &length)); if (pwd && strlen(pwd->pw_name) >= 8)
- neop1x 6y agoThe problem was I didn't compile it with pcap support initially (it is not enabled by default). It needs: make USE_CAP=yes Then it showed "=ep" for every process BUT your patch fixed it and now it correctly lists process capabilities. According to man, capgetp() is deprecated and cap_get_pid() should be used instead anyway. EDIT: I can see your patch merged upstream, good work! :)