From: "Martin Krastev (VMware)" <martinkrastev768@gmail.com>
To: Rafael Mendonca <rafaelmendsr@gmail.com>,
Zack Rusin <zackr@vmware.com>,
VMware Graphics Reviewers <linux-graphics-maintainer@vmware.com>,
David Airlie <airlied@linux.ie>, Daniel Vetter <daniel@ffwll.ch>,
Martin Krastev <krastevm@vmware.com>
Cc: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] drm/vmwgfx: Fix memory leak in vmw_mksstat_add_ioctl()
Date: Sat, 17 Sep 2022 09:35:23 +0300 [thread overview]
Message-ID: <d9c9e901-a96d-e6ed-497c-a69eede2e36e@gmail.com> (raw)
In-Reply-To: <20220916204751.720716-1-rafaelmendsr@gmail.com>
Thank you for the catch!
Reviewed-by: Martin Krastev <krastevm@vmware.com>
Regards,
Martin
On 16.09.22 г. 23:47 ч., Rafael Mendonca wrote:
> If the copy of the description string from userspace fails, then the page
> for the instance descriptor doesn't get freed before returning -EFAULT,
> which leads to a memleak.
>
> Fixes: 7a7a933edd6c ("drm/vmwgfx: Introduce VMware mks-guest-stats")
> Signed-off-by: Rafael Mendonca <rafaelmendsr@gmail.com>
> ---
> drivers/gpu/drm/vmwgfx/vmwgfx_msg.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_msg.c b/drivers/gpu/drm/vmwgfx/vmwgfx_msg.c
> index 2aceac7856e2..089046fa21be 100644
> --- a/drivers/gpu/drm/vmwgfx/vmwgfx_msg.c
> +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_msg.c
> @@ -1076,6 +1076,7 @@ int vmw_mksstat_add_ioctl(struct drm_device *dev, void *data,
>
> if (desc_len < 0) {
> atomic_set(&dev_priv->mksstat_user_pids[slot], 0);
> + __free_page(page);
> return -EFAULT;
> }
>
prev parent reply other threads:[~2022-09-17 6:35 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-09-16 20:47 [PATCH] drm/vmwgfx: Fix memory leak in vmw_mksstat_add_ioctl() Rafael Mendonca
2022-09-17 6:35 ` Martin Krastev (VMware) [this message]
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=d9c9e901-a96d-e6ed-497c-a69eede2e36e@gmail.com \
--to=martinkrastev768@gmail.com \
--cc=airlied@linux.ie \
--cc=daniel@ffwll.ch \
--cc=dri-devel@lists.freedesktop.org \
--cc=krastevm@vmware.com \
--cc=linux-graphics-maintainer@vmware.com \
--cc=linux-kernel@vger.kernel.org \
--cc=rafaelmendsr@gmail.com \
--cc=zackr@vmware.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