dbus/test
Luca Boccassi 80d523dcc8 DBusCredentials: add support for PID FDs via SO_PEERPIDFD
The new socket option SO_PEERPIDFD allows to pin the process on the
other side of the socket by file descriptor, which closes a race
condition where a PID can be reused before we can pin it manually.
Available since Linux v6.5.

When storing credentials, pin the process by FD from the PID.
When querying the PID, if the PID FD is available, resolve
it from there first if possible.

Ensure the DBusCredentials object only returns the PID FD if it was
obtained by this call, so that we know for sure we can rely on it
being safe against PID reuse attacks.

Signed-off-by: Luca Boccassi <bluca@debian.org>
2023-08-08 12:24:20 +01:00
..
bus Add SPDX license marker for the AFL-2.1 OR GPL-2.0-or-later license 2023-01-04 07:53:44 +00:00
data monitor test: Reproduce dbus/dbus#457 2023-06-06 12:01:02 +01:00
integration tests: Ensure session bus has started before integration test 2022-02-21 18:09:22 +00:00
internals DBusCredentials: add support for PID FDs via SO_PEERPIDFD 2023-08-08 12:24:20 +01:00
name-test test-threads-init: Add a permissive license 2022-10-12 12:08:38 +00:00
use-as-subproject gitlab-ci: build libdbus as subproject 2023-02-07 09:07:32 +01:00
.gitignore .gitignore: Ignore many more generated files 2018-12-14 13:28:50 +00:00
CMakeLists.txt Add test for _dbus_string_skip_blank() 2023-02-08 12:03:19 +00:00
containers.c Disable the Containers interface 2021-12-10 16:48:51 +00:00
corrupt.c test: enable AF_UNIX corrupt test on !unix 2022-07-15 16:26:54 +01:00
dbus-daemon-eavesdrop.c tests: Detach most connections from main loop before closing 2018-08-02 17:16:43 +01:00
dbus-daemon.c Disable the Containers interface 2021-12-10 16:48:51 +00:00
dbus-test-runner Add support for installing most of the modular tests 2011-06-10 18:32:35 +01:00
disable-crash-handling.c Add SPDX license marker for the AFL-2.1 OR GPL-2.0-or-later license 2023-01-04 07:53:44 +00:00
disable-crash-handling.h Add SPDX license marker for the AFL-2.1 OR GPL-2.0-or-later license 2023-01-04 07:53:44 +00:00
fdpass.c gitlab-ci: update FreeBSD CI image to 13.1 2022-09-21 09:01:56 +00:00
glib-tap-test.sh When running TAP tests, filter out trailing \r from Windows .exe 2015-10-29 05:50:27 +01:00
header-fields.c tests: Call dbus_shutdown() 2018-08-02 17:14:39 +01:00
loopback.c dbus-connection: Test built-in filters 2022-10-11 10:50:08 +00:00
Makefile.am Add test for _dbus_string_skip_blank() 2023-02-08 12:03:19 +00:00
manual-authz.c tests: reassure clang that oom() does in fact not return 2015-02-24 11:14:02 +00:00
manual-backtrace.c Add SPDX license marker for the AFL-2.1 OR GPL-2.0-or-later license 2023-01-04 07:53:44 +00:00
manual-dir-iter.c manual-dir-iter: Apply a permissive license 2022-10-12 12:08:38 +00:00
manual-paths.c manual-paths: Apply a permissive license 2022-10-12 12:08:38 +00:00
manual-tcp.c manual-tcp: Add a permissive license 2022-10-12 12:08:38 +00:00
marshal.c test/marshal: Don't leak a message and its marshalled buffer 2018-08-02 17:16:14 +01:00
meson.build Add test for _dbus_string_skip_blank() 2023-02-08 12:03:19 +00:00
message.c dbus-message: Report OOM as OOM, not InvalidArgs 2022-10-11 11:54:21 +00:00
meta_template.test.in Add Meson build system 2022-07-13 20:36:13 +01:00
mkdir-m700.py test: Try to create temporary XDG_RUNTIME_DIR with correct mode 2022-07-13 20:36:13 +01:00
monitor.c monitor test: Reproduce dbus/dbus#457 2023-06-06 12:01:02 +01:00
relay.c test: enable AF_UNIX relay tests on !unix 2022-07-15 16:26:54 +01:00
sd-activation.c test: activation tests for send_destination_prefix 2019-05-14 10:31:13 +02:00
shell-test.c shell-test: Print diagnostics to stderr 2020-04-28 11:50:23 +01:00
spawn-test.c tests: Call dbus_shutdown() 2018-08-02 17:14:39 +01:00
syntax.c test-syntax: Exercise correctly- and incorrectly-nested structs, dicts 2022-10-05 10:24:04 +01:00
tap-test.sh.in Run most tests under the TAP driver, with a simple adaptor for non-TAP tests 2015-04-16 13:06:29 +01:00
test-apparmor-activation.sh Add an integration test for AppArmor mediating activation 2016-11-28 12:11:52 +00:00
test-dbus-daemon-fork.sh test-dbus-daemon-fork: exercise closed stdin, stdout, stderr 2016-08-12 18:21:36 +01:00
test-dbus-launch-eval.sh tests: Don't exercise GetMachineId() or autolaunch if no machine ID 2017-06-08 18:30:39 +01:00
test-dbus-launch-x11.sh tests: Don't exercise GetMachineId() or autolaunch if no machine ID 2017-06-08 18:30:39 +01:00
test-exit.c test-exit: Add a permissive license 2022-10-12 12:08:38 +00:00
test-names.c tests: Call dbus_shutdown() 2018-08-02 17:14:39 +01:00
test-platform-mutex.c Add SPDX license marker for the AFL-2.1 OR GPL-2.0-or-later license 2023-01-04 07:53:44 +00:00
test-privserver.c test-privserver: Exit if DBusLoop cannot be allocated 2022-07-15 13:54:59 +01:00
test-segfault.c test-segfault: Fix build error caused by a null pointer dereference warning 2022-04-21 13:54:23 +01:00
test-service.c test: Replace _dbus_assert_not_reached() 2020-04-20 10:13:07 +01:00
test-shell-service.c test-utils: Separate failable and non-failable functions 2017-12-04 11:52:52 +00:00
test-sleep-forever.c fix warning, use Sleep, not _sleep on windows (cherry picked from commit ea36c743ad60a2dd5c6286571d1a475903519809) 2009-11-30 12:00:14 +01:00
test-utils-glib.c test-utils-glibc.c: Fix -Werror,-Wmissing-noreturn on FreeBSD 2022-08-10 11:18:20 +00:00
test-utils-glib.h test: add test_check_af_unix_works() 2022-07-15 16:26:54 +01:00
test-utils.c test-utils: Don't assume all arrays of tests are zero-terminated 2021-12-15 17:47:32 +00:00
test-utils.h test: Move TAP helpers into dbus-testutils if embedded tests are disabled 2020-04-20 10:13:04 +01:00
thread-blocking.c Add SPDX license marker for the AFL-2.1 OR GPL-2.0-or-later license 2023-01-04 07:53:44 +00:00
uid-permissions.c tests: Detach most connections from main loop before closing 2018-08-02 17:16:43 +01:00