lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Message-ID: <20251110154812.85766-1-nihaal@cse.iitm.ac.in>
Date: Mon, 10 Nov 2025 21:18:09 +0530
From: Abdun Nihaal <nihaal@....iitm.ac.in>
To: zack.rusin@...adcom.com
Cc: Abdun Nihaal <nihaal@....iitm.ac.in>,
	bcm-kernel-feedback-list@...adcom.com,
	maarten.lankhorst@...ux.intel.com,
	mripard@...nel.org,
	tzimmermann@...e.de,
	airlied@...il.com,
	simona@...ll.ch,
	dri-devel@...ts.freedesktop.org,
	linux-kernel@...r.kernel.org
Subject: [PATCH] drm/vmwgfx: Fix potential memory leak in vmw_fifo_create()

The memory allocated for fifo and fifo->static_buffer is not freed on
one of the error paths. Fix that by freeing them.

Fixes: c451af78f301 ("drm/vmwgfx: Fail to initialize on broken configs")
Signed-off-by: Abdun Nihaal <nihaal@....iitm.ac.in>
---
Compile tested only. Found using static analysis.

 drivers/gpu/drm/vmwgfx/vmwgfx_cmd.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_cmd.c b/drivers/gpu/drm/vmwgfx/vmwgfx_cmd.c
index 8fe02131a6c4..a9fbdfd3a718 100644
--- a/drivers/gpu/drm/vmwgfx/vmwgfx_cmd.c
+++ b/drivers/gpu/drm/vmwgfx/vmwgfx_cmd.c
@@ -150,6 +150,8 @@ struct vmw_fifo_state *vmw_fifo_create(struct vmw_private *dev_priv)
 	if (unlikely(min >= max)) {
 		drm_warn(&dev_priv->drm,
 			 "FIFO memory is not usable. Driver failed to initialize.");
+		vfree(fifo->static_buffer);
+		kfree(fifo);
 		return ERR_PTR(-ENXIO);
 	}
 
-- 
2.43.0


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ