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>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20251213223850.GA419250@ravnborg.org>
Date: Sat, 13 Dec 2025 23:38:50 +0100
From: Sam Ravnborg <sam@...nborg.org>
To: Swaraj Gaikwad <swarajgaikwad1925@...il.com>
Cc: Helge Deller <deller@....de>, Andrew Morton <akpm@...ux-foundation.org>,
	Hans Verkuil <hverkuil+cisco@...nel.org>,
	Nicolas Dufresne <nicolas.dufresne@...labora.com>,
	Frank Li <Frank.Li@....com>, Zi Yan <ziy@...dia.com>,
	Donet Tom <donettom@...ux.ibm.com>, Yann Dirson <ydirson@...e.fr>,
	Konrad Dybcio <konrad.dybcio@....qualcomm.com>,
	Vivek Kasireddy <vivek.kasireddy@...el.com>,
	Qianfeng Rong <rongqianfeng@...o.com>, Kees Cook <kees@...nel.org>,
	"open list:FRAMEBUFFER LAYER" <linux-fbdev@...r.kernel.org>,
	"open list:FRAMEBUFFER LAYER" <dri-devel@...ts.freedesktop.org>,
	open list <linux-kernel@...r.kernel.org>, skhan@...uxfoundation.org,
	david.hunter.linux@...il.com
Subject: Re: [PATCH v2] fbdev: arkfb: Request legacy VGA I/O region

Hi Swaraj,

On Sat, Dec 13, 2025 at 08:22:34PM +0000, Swaraj Gaikwad wrote:
> The arkfb driver uses the legacy VGA I/O range (0x3c0+) but does not
> request it. This can cause conflicts with other drivers that try to
> reserve these ports.
> 
> Fix this by using devm_request_region() during the probe function.
> This ensures the region is properly reserved and automatically released
> on driver detach.
> 
> v1: https://lore.kernel.org/lkml/20251213154937.104301-1-swarajgaikwad1925@gmail.com/
> Signed-off-by: Swaraj Gaikwad <swarajgaikwad1925@...il.com>
> ---
> v2:
>  - Use resource_size(&vga_res) instead of hardcoded 64 * 1024.
>  - (Feedback from Kees Cook)
> 
> Compile-tested only on x86_64.
> 
>  drivers/video/fbdev/arkfb.c | 6 ++++++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/drivers/video/fbdev/arkfb.c b/drivers/video/fbdev/arkfb.c
> index ec084323115f..24e4c20d1a32 100644
> --- a/drivers/video/fbdev/arkfb.c
> +++ b/drivers/video/fbdev/arkfb.c
> @@ -1018,6 +1018,12 @@ static int ark_pci_probe(struct pci_dev *dev, const struct pci_device_id *id)
> 
>  	pcibios_bus_to_resource(dev->bus, &vga_res, &bus_reg);
> 
> +	if (!devm_request_region(&dev->dev, vga_res.start, resource_size(&vga_res), "arkfb-vga")) {
> +		dev_err(info->device, "cannot reserve legacy VGA ports\n");
> +		rc = -EBUSY;
> +		goto err_find_mode;
> +	}
> +
>  	par->state.vgabase = (void __iomem *) (unsigned long) vga_res.start;

Any explanation why devm_request_region() is the right choice here?
As per the line above vga_res.start is iomem, and I had expected to see
devm_request_mem_region() used.
I looked only briefly, so I may be wrong.

	Sam

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ