[PATCH 2/2] vhost: validate fds attached to messages
Maxime Coquelin
maxime.coquelin at redhat.com
Thu May 5 16:31:09 CEST 2022
On 4/25/22 14:54, David Marchand wrote:
> Some message handlers do not expect any file descriptor attached as
> ancillary data.
> Provide a common way to enforce this by adding a accepts_fd boolean in
> the message handler structure. When a message handler sets accepts_fd to
> true, it is responsible for calling validate_msg_fds with a right
> expected file descriptor count.
> This will avoid leaking some file descriptor by mistake when adding
> support for new vhost user message types.
>
> Signed-off-by: David Marchand <david.marchand at redhat.com>
> ---
> lib/vhost/vhost_user.c | 145 ++++++++++++-----------------------------
> 1 file changed, 43 insertions(+), 102 deletions(-)
>
Reviewed-by: Maxime Coquelin <maxime.coquelin at redhat.com>
Thanks,
Maxime
More information about the dev
mailing list