]> git.ipfire.org Git - thirdparty/systemd.git/commit - man/sd_event_wait.xml
sd-event: store and compare per-module static origin id 27347/head
authorLuca Boccassi <bluca@debian.org>
Tue, 25 Apr 2023 00:46:22 +0000 (01:46 +0100)
committerLuca Boccassi <bluca@debian.org>
Tue, 25 Apr 2023 11:24:25 +0000 (12:24 +0100)
commit2eeff0f4f1af40eb0c22d869c50eb364e2a5d489
treef597ff1036eedf1023ff3a1ed538a5e7c5e2f5ae
parente046719b749ebba5d44d92c7e0a9fb207d545ff7
sd-event: store and compare per-module static origin id

sd-event objects use hashmaps, which use module-global state, so it is not safe
to pass a sd-event object created by a module instance to another module instance
(e.g.: when two libraries static linking sd-event 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.
23 files changed:
man/sd_event_add_child.xml
man/sd_event_add_defer.xml
man/sd_event_add_inotify.xml
man/sd_event_add_io.xml
man/sd_event_add_memory_pressure.xml
man/sd_event_add_signal.xml
man/sd_event_add_time.xml
man/sd_event_exit.xml
man/sd_event_get_fd.xml
man/sd_event_now.xml
man/sd_event_run.xml
man/sd_event_set_signal_exit.xml
man/sd_event_set_watchdog.xml
man/sd_event_source_get_pending.xml
man/sd_event_source_set_description.xml
man/sd_event_source_set_enabled.xml
man/sd_event_source_set_floating.xml
man/sd_event_source_set_prepare.xml
man/sd_event_source_set_priority.xml
man/sd_event_source_set_ratelimit.xml
man/sd_event_wait.xml
src/libsystemd/sd-event/sd-event.c
src/libsystemd/sd-event/test-event.c