diff options
author | Andrew G. Morgan <morgan@kernel.org> | 2019-11-30 18:33:42 -0800 |
---|---|---|
committer | Andrew G. Morgan <morgan@kernel.org> | 2019-12-06 23:06:47 -0800 |
commit | b2b267ef1c83f1f3d3105a4bb84f8bebbc130dec (patch) | |
tree | d0be8e0daca097a3911006b9eb85fcf4d2607182 /libcap/libcap.h | |
parent | e9f55d90e482f680504487be6b3afb80865691d6 (diff) | |
download | libcap-b2b267ef1c83f1f3d3105a4bb84f8bebbc130dec.tar.gz |
Add support to libcap for overriding system call functions.
Note, this override only supports the system calls that
libcap uses to change kernel state associated with the
current process. This is primarily intended to permit the
user to use libpsx to force all pthreads to mirror capability
and other security relevant state.
Use a weak function definition feature of libpsx share_psx_syscall()
to transparently arrange for libcap to so force itself to use the
psx_syscall() abstraction when linked against -lpsx. This has the
effect of using linker magic to make libcap transparently observe
POSIX semantics for security state setting operations. That is, when
linked as follows:
gcc .... -lcap -lpsx -lpthread -Wl,-wrap,pthread_create
all pthreads maintain a common security state with respect to the
libcap API.
This also adds full capability setting support to the Go package
libcap/cap via a libcap/psx package which uses cgo+libpsx syscalls
that share capabilities over all pthreads including those of the
Go runtime.
Finally, if Go supports syscall.PosixSyscall() etc. then provide
a non-psx mechanism for libcap/cap to "just work" in all Go code.
Signed-off-by: Andrew G. Morgan <morgan@kernel.org>
Diffstat (limited to 'libcap/libcap.h')
-rw-r--r-- | libcap/libcap.h | 1 |
1 files changed, 0 insertions, 1 deletions
diff --git a/libcap/libcap.h b/libcap/libcap.h index 0156a92..b79159b 100644 --- a/libcap/libcap.h +++ b/libcap/libcap.h @@ -187,7 +187,6 @@ extern char *_libcap_strdup(const char *text); */ extern int capget(cap_user_header_t header, cap_user_data_t data); -extern int capset(cap_user_header_t header, const cap_user_data_t data); extern int capgetp(pid_t pid, cap_t cap_d); extern int capsetp(pid_t pid, cap_t cap_d); |