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: <20251120180233.763975-1-hsukrut3@gmail.com>
Date: Thu, 20 Nov 2025 23:32:27 +0530
From: Sukrut Heroorkar <hsukrut3@...il.com>
To: Helge Deller <deller@....de>,
	Sukrut Heroorkar <hsukrut3@...il.com>,
	linux-fbdev@...r.kernel.org (open list:FRAMEBUFFER LAYER),
	dri-devel@...ts.freedesktop.org (open list:FRAMEBUFFER LAYER),
	linux-kernel@...r.kernel.org (open list)
Cc: shuah@...nel.org,
	david.hunter.linux@...il.com
Subject: [RFC/RFT PATCH] fbdev: q40fb: request memory region

The q40fb driver uses a fixed physical address but never reserves
the corresponding I/O region. Reserve the range  as suggested in
Documentation/gpu/todo.rst ("Request memory regions in all fbdev drivers").

If the memory cannot be reserved, fail probe with -EBUSY to avoid
conflicting with another user of the same address.

Signed-off-by: Sukrut Heroorkar <hsukrut3@...il.com>
---
Testing: This patch is sent as RFT since Q40 hardware is unavilable and  
QEMU does not emulated a Q40 platform. The change is therefore compile-tested
only.

 drivers/video/fbdev/q40fb.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/drivers/video/fbdev/q40fb.c b/drivers/video/fbdev/q40fb.c
index 1ff8fa176124..7b5c31745041 100644
--- a/drivers/video/fbdev/q40fb.c
+++ b/drivers/video/fbdev/q40fb.c
@@ -101,6 +101,13 @@ static int q40fb_probe(struct platform_device *dev)
 	info->par = NULL;
 	info->screen_base = (char *) q40fb_fix.smem_start;
 
+	if (!request_mem_region(q40fb_fix.smem_start, q40fb_fix.smem_len,
+				"q40fb")) {
+		dev_err(&dev->dev, "cannot reserve video memory at 0x%lx\n",
+			q40fb_fix.smem_start);
+		return -EBUSY;
+	}
+
 	if (fb_alloc_cmap(&info->cmap, 256, 0) < 0) {
 		framebuffer_release(info);
 		return -ENOMEM;
-- 
2.43.0


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ