From 4f646fe934b71110c56255d109e281af85629282 Mon Sep 17 00:00:00 2001 From: David Rheinsberg Date: Thu, 11 Apr 2024 11:37:33 +0200 Subject: [PATCH] bus/driver: dup fds for queued messages Duplicate all FDs attached to a message when queuing it for sending. Messages can be queued for arbitrary times, so we cannot rely on borrowed FDs to be available for long enough. Reported-by: Camron Carter Signed-off-by: David Rheinsberg --- src/bus/driver.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/bus/driver.c b/src/bus/driver.c index f3b01587..23767299 100644 --- a/src/bus/driver.c +++ b/src/bus/driver.c @@ -524,7 +524,7 @@ static int driver_send_reply_with_fds(Peer *peer, CDVar *var, uint32_t serial, i data = NULL; if (n_fds > 0) { - r = fdlist_new_with_fds(&message->fds, fds, n_fds); + r = fdlist_new_dup_fds(&message->fds, fds, n_fds); if (r) return error_fold(r); }