]> git.ipfire.org Git - thirdparty/systemd.git/commit
machine: fix use-after-free in Rename() DBus method 32907/head
authorYu Watanabe <watanabe.yu+github@gmail.com>
Fri, 17 May 2024 21:14:50 +0000 (06:14 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Sun, 19 May 2024 16:03:14 +0000 (01:03 +0900)
commit3b1b2d4e3d544c593399e914fd1c3a5f61d7e827
treee91eb50fc38f882f8993d6de81e702b028dfbe1c
parentc6aeb9b596749b263145346c7fa2c6bf7fbd3867
machine: fix use-after-free in Rename() DBus method

Fixes a bug introduced by 1ddb263d21099ae42195c2bc382bdf72a7f24f82.

Note, this requires the previous two commits, and cannot backport without them.

Note, before the previous commit, the use-after-free could be triggered
only by Rename() DBus method, and could not by RenameImage(), as we did not
cache Image object when RenameImage() method is called. And machinectl
always uses RenameImage(). Hence, the issue could be triggered only when
Rename() DBus method is explicitly called by e.g. busctl.

With the previous commit, the Image object passed to the function is
always cached. Hence, the issue could be triggered even with machinectl
command, and this fix is important.
src/machine/image-dbus.c