From nobody Tue Feb 10 10:54:07 2026 Received: from smtp82.ord1d.emailsrvr.com (smtp82.ord1d.emailsrvr.com [184.106.54.82]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 629B6387344 for ; Fri, 30 Jan 2026 17:05:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=184.106.54.82 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769792718; cv=none; b=PpwVK3XHlKDzg/0TGaqHugCx+mEJX0QTIj9xcShdth5lYhhougRdqLVSeKXrEeE6ZzeJfV41Rh9KHKMDUYBpLPeytt3VVb2oIwGLZcQxG2FqMthRJqG9n5ZmlldVRJAym3dXeFJpEqM7NRkI3PR+8CN5q/W+JkcLCB3NOy5EN3k= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769792718; c=relaxed/simple; bh=cdikeM5G6zKz4vSECkwd3maYKjw7IEEUUM+25PzmvAU=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=ecP2x4i63TzBCQ7XD/Z9vTxhbMIjgqf0HToG89loCBWSG3nnTCCH1r3maWxMmJJvYjPym/EwNYU09dCN+Eae8fIY9dpM/Xf1Vmuvh7Poh2FJzXSAZDNUpUVzANfckD+IAD/QZZtX3BIafGsK3QcYOGvKziWQ0taj7LwM+BtaqRE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=mev.co.uk; spf=pass smtp.mailfrom=mev.co.uk; dkim=pass (1024-bit key) header.d=mev.co.uk header.i=@mev.co.uk header.b=u/gTf0nc; arc=none smtp.client-ip=184.106.54.82 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=mev.co.uk Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=mev.co.uk Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=mev.co.uk header.i=@mev.co.uk header.b="u/gTf0nc" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=mev.co.uk; s=20221208-6x11dpa4; t=1769792716; bh=cdikeM5G6zKz4vSECkwd3maYKjw7IEEUUM+25PzmvAU=; h=From:To:Subject:Date:From; b=u/gTf0ncS5ZN5BE+m8Kp3wUSTP+rnYN6rDhzR7aoqoJtDIgmqVhL8aQvsfJ2Ri+a7 QDEFyiyu63aiEkLs2mjXP1imynZBAcf65BMMP0bBRNXXarC8R574XAqxY6A0Xwea+m BWwWp6ApTkrbsbKItAbBxffcFFbjx27ZD3+XIelA= X-Auth-ID: abbotti@mev.co.uk Received: by smtp19.relay.ord1d.emailsrvr.com (Authenticated sender: abbotti-AT-mev.co.uk) with ESMTPSA id 0BD97601DE; Fri, 30 Jan 2026 12:05:15 -0500 (EST) From: Ian Abbott To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , Ian Abbott , H Hartley Sweeten Subject: [PATCH 42/46] comedi: pcmmio: Add sanity checks for I/O base address Date: Fri, 30 Jan 2026 16:48:07 +0000 Message-ID: <20260130170416.49994-43-abbotti@mev.co.uk> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20260130170416.49994-1-abbotti@mev.co.uk> References: <20260130170416.49994-1-abbotti@mev.co.uk> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Classification-ID: 429d5722-7f90-4557-8586-08913fa85e9e-43-1 Content-Type: text/plain; charset="utf-8" The "pcmmio" driver uses an admin-supplied configuration option (`it->options[0]`) to configure the I/O port base address of a PCM-MIO board. It currently allows any base address to be configured but the hardware only supports base addresses (configured by on-board jumpers) in the range 0 to 0xFFE0 on 32-byte boundaries. Add a sanity check to ensure the device is not configured at an unsupported base address. Signed-off-by: Ian Abbott --- drivers/comedi/drivers/pcmmio.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/comedi/drivers/pcmmio.c b/drivers/comedi/drivers/pcmmi= o.c index c2402239d551..d38202c8a12b 100644 --- a/drivers/comedi/drivers/pcmmio.c +++ b/drivers/comedi/drivers/pcmmio.c @@ -667,7 +667,8 @@ static int pcmmio_attach(struct comedi_device *dev, str= uct comedi_devconfig *it) struct comedi_subdevice *s; int ret; =20 - ret =3D comedi_request_region(dev, it->options[0], 32); + ret =3D comedi_check_request_region(dev, it->options[0], 32, + 0, 0xffff, 32); if (ret) return ret; =20 --=20 2.51.0