]> git.ipfire.org Git - thirdparty/systemd.git/commit
pid1: fix segv triggered by status query (#26279)
authorRobin Humble <plaguedbypenguins@gmail.com>
Wed, 1 Feb 2023 12:36:48 +0000 (23:36 +1100)
committerGitHub <noreply@github.com>
Wed, 1 Feb 2023 12:36:48 +0000 (21:36 +0900)
commit19cfda9fc3c60de21a362ebb56bcb9f4a9855e85
tree2714f5264a6feba6f7009beea0aba7cd003b8a21
parente4c7b5f5173d92cfc5378c75fa3ab7ef0252f32b
pid1: fix segv triggered by status query (#26279)

If any query makes it to the end of install_info_follow() then I think symlink_target is set to NULL.
If that is followed by -EXDEV from unit_file_load_or_readlink(), then that causes basename(NULL)
which segfaults pid 1.

This is triggered by eg. "systemctl status crond" in RHEL9 if

/etc/systemd/system/crond.service
  -> /ram/etc/systemd/system/crond.service
  -> /usr/lib/systemd/system/.crond.service.blah.blah
  -> /usr/lib/systemd/system/crond.service
src/shared/install.c