From nobody Mon Feb 9 21:37:28 2026 Received: from smtp84.ord1d.emailsrvr.com (smtp84.ord1d.emailsrvr.com [184.106.54.84]) (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 5295535FF4C for ; Fri, 30 Jan 2026 17:05:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=184.106.54.84 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769792705; cv=none; b=UzM347t4CJ/rYTRb6u9ZyzL32IhTLCgkad0LtQ5OW3zC5jll0pYcAk5ekMypbhpb6KIkOLo+iOrK4Wrk0CjDxmhGSYDZf+/klv5Q4IVRhmxJOMc+nr9Legu78rhC+UOIqjomVOv9mprqALlWrS8DLa30Ng3AY96HmvDq7QChn64= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769792705; c=relaxed/simple; bh=7eauUzvIwpLCLqUmh7dyF6lbv5FWjS6Wk5t+smd8IVE=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Q00Z6ryJAE2jaVJt9rJH2OraFYJIado3a1ZUCRv67c7BrDbu5NgM2+eUdYmRmWvgX92JHCBZS7H1hwth1Zr35WYXx/jXXKOQiWcODGMfpWmnOy+uR/vTpBQd/dOMzi2VFbrt2oz2ThAlCrMTPJlkk+Cc61ffdV4hAoSdjX6dQwc= 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=GOKTuJT4; arc=none smtp.client-ip=184.106.54.84 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="GOKTuJT4" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=mev.co.uk; s=20221208-6x11dpa4; t=1769792703; bh=7eauUzvIwpLCLqUmh7dyF6lbv5FWjS6Wk5t+smd8IVE=; h=From:To:Subject:Date:From; b=GOKTuJT4rqQDyV5KBqAacieIjF9k2sLB58He72wCLeVUmfxw8S02WO2+Pu/t8PXsZ YyqkyI/LLkLBSaumvaFqSf4wqC95tZ1jTwniD1effQy2NIAd9nB+LusEh26INx8Yz5 djNmbM8fl5hQWXXL6J8IBiIQXSBOCT2j1pzcEJG4= X-Auth-ID: abbotti@mev.co.uk Received: by smtp19.relay.ord1d.emailsrvr.com (Authenticated sender: abbotti-AT-mev.co.uk) with ESMTPSA id B2B8A601DE; Fri, 30 Jan 2026 12:05:02 -0500 (EST) From: Ian Abbott To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , Ian Abbott , H Hartley Sweeten Subject: [PATCH 29/46] comedi: ni_atmio: Add sanity checks for I/O base address Date: Fri, 30 Jan 2026 16:47:54 +0000 Message-ID: <20260130170416.49994-30-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-30-1 Content-Type: text/plain; charset="utf-8" The "ni_atmio" driver uses an admin-supplied configuration option (`it->options[0]`) to configure the I/O port base address of an AT E Series board. Or, if the option value is zero, it can search ISA PNP devices to look for a compatible board. If the base address is configured manually, it currently allows any base address to be configured but the hardware only supports base addresses (configured by a configuration utility and stored in nonvolatile memory) in the range 0x20 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/ni_atmio.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/comedi/drivers/ni_atmio.c b/drivers/comedi/drivers/ni_= atmio.c index b4e759e5703f..7bc336333ace 100644 --- a/drivers/comedi/drivers/ni_atmio.c +++ b/drivers/comedi/drivers/ni_atmio.c @@ -311,7 +311,8 @@ static int ni_atmio_attach(struct comedi_device *dev, comedi_set_hw_dev(dev, &isapnp_dev->dev); } =20 - ret =3D comedi_request_region(dev, iobase, 0x20); + ret =3D comedi_check_request_region(dev, iobase, 0x20, + 0x20, 0xffff, 32); if (ret) return ret; =20 --=20 2.51.0