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: <20250628142308.903037-1-sashal@kernel.org>
Date: Sat, 28 Jun 2025 10:23:08 -0400
From: Sasha Levin <sashal@...nel.org>
To: maarten.lankhorst@...ux.intel.com,
	mripard@...nel.org,
	tzimmermann@...e.de
Cc: airlied@...il.com,
	simona@...ll.ch,
	dri-devel@...ts.freedesktop.org,
	linux-kernel@...r.kernel.org,
	Sasha Levin <sashal@...nel.org>
Subject: [PATCH] drm/tests: Initialize framebuffer's filp_head in drm_test_framebuffer_free()

The drm_test_framebuffer_free() test creates a framebuffer on the stack
without properly initializing the filp_head list, causing the following
warning when drm_framebuffer_free() checks it:

[  144.996969] drm-kunit-mock-device drm_test_framebuffer_free.drm-kunit-mock-device: [drm] drm_WARN_ON(\!list_empty(&fb->filp_head))
[  144.997097] WARNING: CPU: 0 PID: 2546 at drivers/gpu/drm/drm_framebuffer.c:832 drm_framebuffer_free+0x13f/0x1c0

The test intentionally creates a partially initialized framebuffer
to test an edge case in drm_framebuffer_free(), but it needs to
initialize the filp_head list to avoid triggering the warning on
uninitialized list data.

Initialize the filp_head list in the test to match the behavior of
drm_framebuffer_init().

Fixes: d21942560499 ("drm/tests: Add test for drm_framebuffer_free()")
Signed-off-by: Sasha Levin <sashal@...nel.org>
---
 drivers/gpu/drm/tests/drm_framebuffer_test.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/gpu/drm/tests/drm_framebuffer_test.c b/drivers/gpu/drm/tests/drm_framebuffer_test.c
index 6ea04cc8f3241..81a7f2cfb8ed6 100644
--- a/drivers/gpu/drm/tests/drm_framebuffer_test.c
+++ b/drivers/gpu/drm/tests/drm_framebuffer_test.c
@@ -677,6 +677,7 @@ static void drm_test_framebuffer_free(struct kunit *test)
 	};
 	int id, ret;
 
+	INIT_LIST_HEAD(&fb.filp_head);
 	priv->buffer_freed = false;
 
 	/*
-- 
2.39.5


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ