From: Zbigniew Jędrzejewski-Szmek Date: Wed, 17 Sep 2025 12:14:58 +0000 (+0200) Subject: fd-util: fix path_is_root_at() when dealing with detached mounts (#38636) X-Git-Tag: v259-rc1~574 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=08d8224c0a41aa9abe0a0e19fd4ff81700140548;p=thirdparty%2Fsystemd.git fd-util: fix path_is_root_at() when dealing with detached mounts (#38636) path_is_root_at() is supposed to detect if the inode referenced by the specified fd is the "root inode". For that it checks if the inode and its parent are the same inode and the same mount. Traditionally this check was correct. But these days we actually have detached mounts (i.e. those returned by fsmount() and related calls), whose root inode also behaves like that. Our uses for path_is_root_at() use the function to detect if an absolute path would be identical to a relative path based on the specified fd (sepifically: chaseat()), which goes really wrong if used on a detached mount. hence, let's adjust the function a bit, and let's go by path to "/" to check if the referenced inode is the actual root inode in our chroot. --- 08d8224c0a41aa9abe0a0e19fd4ff81700140548