From nobody Tue Feb 10 17:08:17 2026 Received: from smtp87.ord1d.emailsrvr.com (smtp87.ord1d.emailsrvr.com [184.106.54.87]) (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 9154635C1AB for ; Fri, 30 Jan 2026 17:04:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=184.106.54.87 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769792694; cv=none; b=pAEx56HS35VsYK8pwGeV/lmz/JgJ+RrkegqANd91L+8XIcDxlJQ7RewO662AWhW1+/4D6SwGZSDoZiQ5yepm8EamL3r802kg5Zfh9imtTkSRlrGDcYuXklUHm8yp2BtX6skYIEfeVk2fj7zuAMfqtKrgohxpcHikP0gmOhT1Mwo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769792694; c=relaxed/simple; bh=ehsO/fBZqwhcWv1pHjue2U0VAYvAea8gEGk0chey+BU=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=tAEvRjaH55THvfTEh3XA/x2iymFln2EemD6YGnxUaqpgxDuQ2194K7pL5eA0Q/XJipbSGV6xzff2wzDneymLhkkV33V0TL5r/4SllHeFzl1sVB2QOdLXj87AXhniXXDWNyVIUDY2myYh2iDeWzc1HOcntv+EGzME41MJRN3Av0k= 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=LIVgWqtc; arc=none smtp.client-ip=184.106.54.87 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="LIVgWqtc" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=mev.co.uk; s=20221208-6x11dpa4; t=1769792692; bh=ehsO/fBZqwhcWv1pHjue2U0VAYvAea8gEGk0chey+BU=; h=From:To:Subject:Date:From; b=LIVgWqtcjZewJ/Rh7LvkffZEeJdqakJp743CvUf+Ia18qb3efIWucFEMAyaMglk6d U5CxfThB4CnIqoPowJttOul/MV4JxNiOdVhr2jBw3A+5j5xNLwE6YwGS0lKVOLaGYQ ru+TcSAHoH7TVHWrSeOvtXgT+8pY+ZkOE+vHXlL8= X-Auth-ID: abbotti@mev.co.uk Received: by smtp19.relay.ord1d.emailsrvr.com (Authenticated sender: abbotti-AT-mev.co.uk) with ESMTPSA id 492E8602FA; Fri, 30 Jan 2026 12:04:50 -0500 (EST) From: Ian Abbott To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , Ian Abbott , H Hartley Sweeten Subject: [PATCH 20/46] comedi: dt2811: Add sanity checks for I/O base address Date: Fri, 30 Jan 2026 16:47:45 +0000 Message-ID: <20260130170416.49994-21-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-21-1 Content-Type: text/plain; charset="utf-8" The "dt2811" driver uses an admin-supplied configuration option (`it->options[0]`) to configure the I/O port base address of a supported board in the DT2811 family. It currently allows any base address to be configured but the hardware only supports base addresses (configured by on-board jumpers) in the range 0x200 to 0x3f8 on 8-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/dt2811.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/comedi/drivers/dt2811.c b/drivers/comedi/drivers/dt281= 1.c index dbb9f38da289..bcc4b5ef48e8 100644 --- a/drivers/comedi/drivers/dt2811.c +++ b/drivers/comedi/drivers/dt2811.c @@ -556,7 +556,8 @@ static int dt2811_attach(struct comedi_device *dev, str= uct comedi_devconfig *it) if (!devpriv) return -ENOMEM; =20 - ret =3D comedi_request_region(dev, it->options[0], 0x8); + ret =3D comedi_check_request_region(dev, it->options[0], 0x8, + 0x200, 0x3ff, 8); if (ret) return ret; =20 --=20 2.51.0