]> git.ipfire.org Git - thirdparty/systemd.git/commit
core/unit: update bidirectional dependency simultaneously 27746/head
authorYu Watanabe <watanabe.yu+github@gmail.com>
Tue, 23 May 2023 08:49:16 +0000 (17:49 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Fri, 26 May 2023 06:24:09 +0000 (15:24 +0900)
commit831108245eb757f41fe0ebbccf1b42c9dd0ce297
tree65663da1b3536e74a2bbd66ae744c2c2fe80b6b4
parent83123a44989c095f9b7a89841db9917417fc451a
core/unit: update bidirectional dependency simultaneously

Previously, if unit_add_dependency_hashmap() failed, then a
one-directional unit dependency reference might be created, and
triggeres use-after-free. See issue #27742 for more details.

This makes unit dependency always bidirectional, and cleanly revert
partial update on failure.

Fixes #27742.
src/core/unit.c