Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 D34AC39A812 for ; Fri, 1 May 2026 14:18:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777645082; cv=none; b=lzOkDg1pL5tNq7ULO/8b39VfZAw6SKXKvSlXbjYfqCvIWmZ08y5FwwlHp8/ZbV51e9zATKSE++VEXer2CRjS80Fqe1O9wQIn51aVFuOQPmHhq9oIqrcqdL0qTC/IFruYrvH8CBUyT30P42nWoG++22D7zE9akBlFqqwEM0+R/cE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777645082; c=relaxed/simple; bh=b/2bYJIXboexTdol47ytrpjwafPWU8Qj4eRRajgjwX0=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=TbYpxXGMakm4vpdQImI5U+/rtIS2BFGaMou3VCyZL3KtFnRwpsqGkZE8ffjDF/7/yU/cBvLRLQfhcIEisstFbEdQIXl6UDnRjVqjaGvGxYmtU+1ylDu5J/8LvbFPem/G3h8Jmiuxdo3DoheHoP+2EvOF5nMbSx1hZuM7MoM1JQE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=v14Vchxh; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="v14Vchxh" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6EF5EC2BCB4; Fri, 1 May 2026 14:18:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1777645082; bh=b/2bYJIXboexTdol47ytrpjwafPWU8Qj4eRRajgjwX0=; h=From:To:Cc:Subject:Date:Reply-To:From; b=v14VchxhzXmtKv/TwEvcOjhX5XcHHtKcCW7fK7VR69JEJi4CUaOZwo6UW+vlc6+fA 0BuV7fNiOM7xct57QQ8eoCGlJeiE82L7dfSZLTU6acB/JAaHRwVUYK+ZeDvTZYudkw xVlODhfGZF1L+HOYv1oudkWcRbg0IAUJg9Rdr5Jo= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2026-31749: comedi: ni_atmio16d: Fix invalid clean-up after failed attach Date: Fri, 1 May 2026 16:15:00 +0200 Message-ID: <2026050142-CVE-2026-31749-e7d2@gregkh> X-Mailer: git-send-email 2.54.0 Reply-To: , Precedence: bulk X-Mailing-List: linux-cve-announce@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=4122; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=9Kgici034ikmnNktNt1Gwu1tFFWTx9nCEov4XqZ8VCk=; b=owGbwMvMwCRo6H6F97bub03G02pJDJlftgbpXhMqm67gFcs4/52YydW7G4Mnvg/Q2TM5dcWJb 1NOPf/Z2BHLwiDIxCArpsjyZRvP0f0VhxS9DG1Pw8xhZQIZwsDFKQATkWtjWNBptqiN+0u5wfVy xpvPv59OlkgMk2aYK2yb81BQ+Hui8fXXTApTDgg9nSiRCgA= X-Developer-Key: i=gregkh@linuxfoundation.org; a=openpgp; fpr=F4B60CC5BF78C2214A313DCB3147D40DDB2DFB29 Content-Transfer-Encoding: 8bit From: Greg Kroah-Hartman Description =========== In the Linux kernel, the following vulnerability has been resolved: comedi: ni_atmio16d: Fix invalid clean-up after failed attach If the driver's COMEDI "attach" handler function (`atmio16d_attach()`) returns an error, the COMEDI core will call the driver's "detach" handler function (`atmio16d_detach()`) to clean up. This calls `reset_atmio16d()` unconditionally, but depending on where the error occurred in the attach handler, the device may not have been sufficiently initialized to call `reset_atmio16d()`. It uses `dev->iobase` as the I/O port base address and `dev->private` as the pointer to the COMEDI device's private data structure. `dev->iobase` may still be set to its initial value of 0, which would result in undesired writes to low I/O port addresses. `dev->private` may still be `NULL`, which would result in null pointer dereferences. Fix `atmio16d_detach()` by checking that `dev->private` is valid (non-null) before calling `reset_atmio16d()`. This implies that `dev->iobase` was set correctly since that is set up before `dev->private`. The Linux kernel CVE team has assigned CVE-2026-31749 to this issue. Affected and fixed versions =========================== Issue introduced in 2.6.30 with commit 2323b276308a5da5774b778f39c7fd94b2a3022a and fixed in 5.10.253 with commit a01dd339ea6ac58b0967a50085622a6017351140 Issue introduced in 2.6.30 with commit 2323b276308a5da5774b778f39c7fd94b2a3022a and fixed in 5.15.203 with commit 933a2d6a95f9bfb203e562c9be1dd990c735535c Issue introduced in 2.6.30 with commit 2323b276308a5da5774b778f39c7fd94b2a3022a and fixed in 6.1.168 with commit 5d8d88c8c0eec230de8f1f60e0920a4337939a88 Issue introduced in 2.6.30 with commit 2323b276308a5da5774b778f39c7fd94b2a3022a and fixed in 6.6.134 with commit f517646e008fe99ca1800601cd011b110f8684ae Issue introduced in 2.6.30 with commit 2323b276308a5da5774b778f39c7fd94b2a3022a and fixed in 6.12.81 with commit 3848ae00b1642e2c98ff8cbfd2d3b38c6f53b5c3 Issue introduced in 2.6.30 with commit 2323b276308a5da5774b778f39c7fd94b2a3022a and fixed in 6.18.22 with commit 43c68a2c7cc35b7c2a83c285cb4ad3d472b8caa2 Issue introduced in 2.6.30 with commit 2323b276308a5da5774b778f39c7fd94b2a3022a and fixed in 6.19.12 with commit d07d97ca4f7fac467cdcf4a012690853958b7e89 Issue introduced in 2.6.30 with commit 2323b276308a5da5774b778f39c7fd94b2a3022a and fixed in 7.0 with commit 101ab946b79ad83b36d5cfd47de587492a80acf0 Please see https://www.kernel.org for a full list of currently supported kernel versions by the kernel community. Unaffected versions might change over time as fixes are backported to older supported kernel versions. The official CVE entry at https://cve.org/CVERecord/?id=CVE-2026-31749 will be updated if fixes are backported, please check that for the most up to date information about this issue. Affected files ============== The file(s) affected by this issue are: drivers/comedi/drivers/ni_atmio16d.c Mitigation ========== The Linux kernel CVE team recommends that you update to the latest stable kernel version for this, and many other bugfixes. Individual changes are never tested alone, but rather are part of a larger kernel release. Cherry-picking individual commits is not recommended or supported by the Linux kernel community at all. If however, updating to the latest release is impossible, the individual changes to resolve this issue can be found at these commits: https://git.kernel.org/stable/c/a01dd339ea6ac58b0967a50085622a6017351140 https://git.kernel.org/stable/c/933a2d6a95f9bfb203e562c9be1dd990c735535c https://git.kernel.org/stable/c/5d8d88c8c0eec230de8f1f60e0920a4337939a88 https://git.kernel.org/stable/c/f517646e008fe99ca1800601cd011b110f8684ae https://git.kernel.org/stable/c/3848ae00b1642e2c98ff8cbfd2d3b38c6f53b5c3 https://git.kernel.org/stable/c/43c68a2c7cc35b7c2a83c285cb4ad3d472b8caa2 https://git.kernel.org/stable/c/d07d97ca4f7fac467cdcf4a012690853958b7e89 https://git.kernel.org/stable/c/101ab946b79ad83b36d5cfd47de587492a80acf0