]> git.ipfire.org Git - thirdparty/systemd.git/commit
homed: Release(): fix assertion failure
authorAdrian Vovk <adrianvovk@gmail.com>
Thu, 21 Mar 2024 23:28:38 +0000 (19:28 -0400)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Thu, 28 Mar 2024 04:35:37 +0000 (13:35 +0900)
commit1eba24dac443eae187a9e02c5c8e7f6036e091d5
treeb5fd50b076bb0ce8e7adc4564964bc7668473553
parented358516937780b524a2cfa833427da3df1bc87f
homed: Release(): fix assertion failure

This fixes a race condition crash in homed that would happen in the
following sequence of events:

1. Client 1 takes a ref on the home area
2. Client 1 calls some method via dbus
3. Client 2 calls Release()

In homed, the Release() would check if a ref is still held (in this
case: yes it is) and returns an error. Except that is done through a
code-path that asserts that no operations are ongoing. In this case,
it's valid to have an ongoing operation, and so the assertion fails
causing homed to crash.
src/home/homed-home.c
src/home/meson.build
src/home/test-homed-regression-31896.c [new file with mode: 0644]
test/units/testsuite-46.sh