From nobody Mon Feb 9 21:37:19 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 333CA34B19A for ; Fri, 30 Jan 2026 17:11:50 +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=1769793111; cv=none; b=ofcGCyz0X7URytwlcHE0/qM164x1sNcpPBjZV65gLvZUeCGETMIuumkk84i/783drMtkRP1kH0QUg2bO3WpNrVtLhqfIFhptUxjqlQAETTP2JnbKmDVu+YGn8MPTfINisftwAG/+JwtUJzRNevGqz5SBJPvKNs5X/hOKUSHMeGg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769793111; c=relaxed/simple; bh=Xy1g3sCF37/uNg+TTdbBO4S6LEPcQJQ9G06ORx0YQsA=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=AqNteBVsXBMOfbBD6IhiI1AT79W4mz/0JqgVKmYXMyCdj7xpVxXutfV0gq61bwTIleNXvTm+aGDxDfkPtY7KLqvQFbFpGYMtcH76D8HFQWw5XdNm5q8FWwse6gKW4VIEQjHUprIAQDwMXc9nBIhnUmv7GkImDkkf9z39+FV/wuk= 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=cYEK4+uR; 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="cYEK4+uR" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=mev.co.uk; s=20221208-6x11dpa4; t=1769792683; bh=Xy1g3sCF37/uNg+TTdbBO4S6LEPcQJQ9G06ORx0YQsA=; h=From:To:Subject:Date:From; b=cYEK4+uRe44amaCbFV/EdG9/FP75281qIUL7ig0AligkRa9eHz88NF2qFZwmh1Fa/ U2YURfwnbM969ecV2b7Itf1tnfzrk4RqBOegOjLT5IRoY7bGk2fUqOClu9MESg9LEG xIg+1dOcjntNcjjmnfex32tpy7KjDrm9QlfRnekY= X-Auth-ID: abbotti@mev.co.uk Received: by smtp19.relay.ord1d.emailsrvr.com (Authenticated sender: abbotti-AT-mev.co.uk) with ESMTPSA id 96BD2602FD; Fri, 30 Jan 2026 12:04:42 -0500 (EST) From: Ian Abbott To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , Ian Abbott , H Hartley Sweeten Subject: [PATCH 12/46] comedi: das08_isa: Add sanity checks for I/O base address Date: Fri, 30 Jan 2026 16:47:37 +0000 Message-ID: <20260130170416.49994-13-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-13-1 Content-Type: text/plain; charset="utf-8" The "das08_isa" driver uses an admin-supplied configuration option (`it->options[0]`) to configure the I/O port base address of a supported board in the DAS08 family. It currently allows any base address to be configured but the hardware only supports base addresses (configured by an on-board DIP switch) in the range 0 to 0x3f0 on 16-byte boundaries. (Technically, the DIP switches allow 8-byte boundaries, but I do not think that is advisable given that the boards decode an 16-byte address range.) Add a sanity check to ensure the device is not configured at an unsupported base address. Signed-off-by: Ian Abbott --- drivers/comedi/drivers/das08_isa.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/comedi/drivers/das08_isa.c b/drivers/comedi/drivers/da= s08_isa.c index 3d43b77cc9f4..1b022dc10b78 100644 --- a/drivers/comedi/drivers/das08_isa.c +++ b/drivers/comedi/drivers/das08_isa.c @@ -167,7 +167,8 @@ static int das08_isa_attach(struct comedi_device *dev, if (!devpriv) return -ENOMEM; =20 - ret =3D comedi_request_region(dev, it->options[0], board->iosize); + ret =3D comedi_check_request_region(dev, it->options[0], board->iosize, + 0, 0x3ff, board->iosize); if (ret) return ret; =20 --=20 2.51.0