public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Fiona Ebner <f.ebner@proxmox.com>
To: Dominik Csapak <d.csapak@proxmox.com>, pve-devel@lists.proxmox.com
Subject: Re: [PATCH qemu-server] fix #7654: prevent use after free
Date: Tue, 2 Jun 2026 13:39:05 +0200	[thread overview]
Message-ID: <ab2a156d-283b-4b25-928b-9cdab7cfece2@proxmox.com> (raw)
In-Reply-To: <20260601121654.2421101-1-d.csapak@proxmox.com>

Am 01.06.26 um 2:16 PM schrieb Dominik Csapak:
> to prevent a use after free on a client struct, instead of freeing it
> inline in 'cleanup_client', only set a boolean flag 'pending_free'
> and free it in the main 'handle_client' function.
> 
> the call graphs look like this:
> 
> handle_client
> `-> cleanup_client
> `-> handle_qmp_handshake
>     `-> cleanup_client
>     `-> send_qmp_cmd
>         `-> cleanup_client
> `-> handle_qmp_event
>     `-> terminate_check

Nit: there's an additional `-> send_qmp_cmd here (terminate_check() does
not call cleanup_client() directly).

>         `-> cleanup_client
> `-> handle_qmp_return
>     `-> terminate_check

Nit: same here

>         `-> cleanup_client
> 
> In addition, if we cleanup a 'vzdump' client, the corresponding vm wll

s/vm wll/VM client will/

> be looked up and 'terminate_check' will be called for it. If that
> resulted in a cleanup, we have to free that immediately.
> 
> cleanup_client will not be called in other paths, so handling the
> freeing in handle_client should suffice.
> 
> Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>

Reviewed-by: Fiona Ebner <f.ebner@proxmox.com>

Thanks!




  reply	other threads:[~2026-06-02 11:39 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-01 12:16 [PATCH qemu-server] fix #7654: prevent use after free Dominik Csapak
2026-06-02 11:39 ` Fiona Ebner [this message]
2026-06-02 12:17 ` superseded: " Dominik Csapak

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ab2a156d-283b-4b25-928b-9cdab7cfece2@proxmox.com \
    --to=f.ebner@proxmox.com \
    --cc=d.csapak@proxmox.com \
    --cc=pve-devel@lists.proxmox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal