From: Lennart Poettering Date: Tue, 10 Feb 2026 10:46:58 +0000 (+0100) Subject: bootctl: toughen fd validation in Install() handler X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=10268261a8d530450d4193575c3329af12902c7a;p=thirdparty%2Fsystemd.git bootctl: toughen fd validation in Install() handler Let's also check the fd flags. Just in case. --- diff --git a/src/bootctl/bootctl-install.c b/src/bootctl/bootctl-install.c index 8399a2da721..a25557895bc 100644 --- a/src/bootctl/bootctl-install.c +++ b/src/bootctl/bootctl-install.c @@ -2035,6 +2035,10 @@ int vl_method_install( if (p.context.root_fd < 0) return log_debug_errno(p.context.root_fd, "Failed to acquire root fd from Varlink: %m"); + r = fd_verify_safe_flags_full(p.context.root_fd, O_DIRECTORY); + if (r < 0) + return sd_varlink_error_invalid_parameter_name(link, "rootFileDescriptor"); + r = fd_verify_directory(p.context.root_fd); if (r < 0) return log_debug_errno(r, "Specified file descriptor does not refer to a directory: %m");