From nobody Mon Feb 9 21:37:10 2026 Received: from smtp85.ord1d.emailsrvr.com (smtp85.ord1d.emailsrvr.com [184.106.54.85]) (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 0568F35C180 for ; Fri, 30 Jan 2026 17:04:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=184.106.54.85 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769792700; cv=none; b=avW6KtSo7S3GehOcUt67AOqt+0cDf/shuTUrRB+sCDAcfnAgwBpMOKY+E0aALj1ec57okYztExqUelXcRU9gWGfZIMb8zW37usc6N/2g61+ZbrOq4Jq6Lq8+RTnLEJ5pbKi9PFkSDP9TLkGHxlwlg+PNo8N2qzGBR1rO/0Oj7OM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769792700; c=relaxed/simple; bh=ATr+7wcRjGrL5BjEal6Us3/m2dMd4LB45LcgkXU/Pyc=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=iW4yFrytzYlHVEkzvrlLBjCUjscKY+k45P9y6kjDUeeM1uImI4bcAiGqtvgcgaGliyFesPxuQIA1TiKXE561xWC+FqBPGg9cC7HHWzGGi5ATvwrExS5fm7rDEKiqsfVRt+99qOVe3jLhIJ5c4J3LNsOGS3tDj8IthdsSwQLDB/k= 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=xliVSeIp; arc=none smtp.client-ip=184.106.54.85 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="xliVSeIp" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=mev.co.uk; s=20221208-6x11dpa4; t=1769792698; bh=ATr+7wcRjGrL5BjEal6Us3/m2dMd4LB45LcgkXU/Pyc=; h=From:To:Subject:Date:From; b=xliVSeIpskenaTnmZyIALEI9f0hkqi/xM5pz6U29vs2SNnBpvLSXNG4Lr0MB0JP8s GFG6c2GtfSBoVx7XA8YIfhNTkw+KMOaD2s+hN2SMBGDZk1mSCZNR9atxNFVIL2ELPf In5BetXeleiLKOvxlwdKB0W6cFVsgeEkeMqcVzBU= X-Auth-ID: abbotti@mev.co.uk Received: by smtp19.relay.ord1d.emailsrvr.com (Authenticated sender: abbotti-AT-mev.co.uk) with ESMTPSA id 9508C602F0; Fri, 30 Jan 2026 12:04:57 -0500 (EST) From: Ian Abbott To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , Ian Abbott , H Hartley Sweeten Subject: [PATCH 24/46] comedi: fl512: Add sanity checks for I/O base address Date: Fri, 30 Jan 2026 16:47:49 +0000 Message-ID: <20260130170416.49994-25-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-25-1 Content-Type: text/plain; charset="utf-8" The "fl512" driver uses an admin-supplied configuration option (`it->options[0]`) to configure the I/O port base address of an FL512 board. It currently allows any base address to be configured and uses a 16-byte register region. I cannot find any information about this board, but assume it needs to be aligned to a 16-byte boundary. I have no idea about the allowed range, so allow anything in a 32-bit range and add a "FIXME" comment (although most ancient ISA cards only support 10-bit address decoding). Add a sanity check to ensure the device is not configured at an unsupported base address. Signed-off-by: Ian Abbott --- drivers/comedi/drivers/dt282x.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/drivers/comedi/drivers/dt282x.c b/drivers/comedi/drivers/dt282= x.c index 4ae80e6c7266..29832e1f062d 100644 --- a/drivers/comedi/drivers/dt282x.c +++ b/drivers/comedi/drivers/dt282x.c @@ -1064,7 +1064,12 @@ static int dt282x_attach(struct comedi_device *dev, = struct comedi_devconfig *it) struct comedi_subdevice *s; int ret; =20 - ret =3D comedi_request_region(dev, it->options[0], 0x10); + /* + * Although it has only 16 bytes (8 16-bit registers), it needs to + * start on a 32-byte boundary in range 0x200 to 0x3E0. + */ + ret =3D comedi_check_request_region(dev, it->options[0], 0x10, + 0x200, 0x3ff, 32); if (ret) return ret; =20 --=20 2.51.0