]> git.ipfire.org Git - thirdparty/systemd.git/commit
sd-bus: store and compare per-module static origin id
authorLuca Boccassi <bluca@debian.org>
Mon, 24 Apr 2023 23:56:06 +0000 (00:56 +0100)
committerLuca Boccassi <bluca@debian.org>
Tue, 25 Apr 2023 11:24:25 +0000 (12:24 +0100)
commitbf876e3f3e7c38635547cd87de7621eb8e3e946c
tree10ccfddfb8614656d59dce0c7a576360653fc4d2
parentbf2d930fa12de997920eef493d9fcce1580c4f44
sd-bus: store and compare per-module static origin id

sd-bus objects use hashmaps, which use module-global state, so it is not safe
to pass a sd-bus object created by a module instance to another module instance
(e.g.: when two libraries static linking sd-bus are pulled in a single process).
Initialize a random per-module origin id and store it in the object, and compare
it when entering a public API, and error out if they don't match, together with
the PID.
28 files changed:
man/sd_bus_add_node_enumerator.xml
man/sd_bus_add_object.xml
man/sd_bus_add_object_manager.xml
man/sd_bus_attach_event.xml
man/sd_bus_close.xml
man/sd_bus_emit_signal.xml
man/sd_bus_enqueue_for_read.xml
man/sd_bus_get_n_queued_read.xml
man/sd_bus_get_name_creds.xml
man/sd_bus_get_name_machine_id.xml
man/sd_bus_is_open.xml
man/sd_bus_list_names.xml
man/sd_bus_negotiate_fds.xml
man/sd_bus_query_sender_creds.xml
man/sd_bus_set_close_on_exit.xml
man/sd_bus_set_connected_signal.xml
man/sd_bus_set_description.xml
man/sd_bus_set_exit_on_disconnect.xml
man/sd_bus_set_sender.xml
man/sd_bus_set_server.xml
man/sd_bus_set_watch_bind.xml
man/sd_bus_slot_set_floating.xml
src/libsystemd/sd-bus/bus-control.c
src/libsystemd/sd-bus/bus-convenience.c
src/libsystemd/sd-bus/bus-internal.h
src/libsystemd/sd-bus/bus-objects.c
src/libsystemd/sd-bus/sd-bus.c
src/libsystemd/sd-bus/test-bus-cleanup.c