Skip to content

Commit

Permalink
bus/driver: dup fds for queued messages
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: David Rheinsberg <[email protected]>
  • Loading branch information
dvdhrm committed Apr 11, 2024
1 parent 38d839c commit 4f646fe
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/bus/driver.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

0 comments on commit 4f646fe

Please sign in to comment.