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 E3FFB13E40F for ; Mon, 24 Jun 2024 13:57:25 +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=1719237446; cv=none; b=gpdn8bBRS/ftv30Zeqwwf05maRy3OprMwZF4YkmtSoGHv8Rqbcax8SzK/suBlNck9vXwi5RCf5FTAFwX8SSqcacOcUEh8s3AyFBbJCjhNaRgE0K1S+R8GZQk8oZdke2AGY5pEhLkA5unh25WWeuUBu57UmIJ0HBSK8SxkDK44Ug= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719237446; c=relaxed/simple; bh=BVQ5E/qnZ+M3u+eERtD0aQsHcaI2pzwUGXDWvDrrMhc=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=ALOl3RKoK2lqLIhaYKcGB75z6L6h5D029ml/WYdR0mQmBxwwWAhK8S82qhwrw+P+b2N3cXRxqrva/53zkLyXNQU2qyH+YsciHELWjpbPBTy+2FUkh0WuQYcFg3ywWCpguv+wcX96ez2JlTgoikYVhUYKMGe3xvJZ038D2uixlAQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=A0j5Fo0j; 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="A0j5Fo0j" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 601D4C2BBFC; Mon, 24 Jun 2024 13:57:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1719237445; bh=BVQ5E/qnZ+M3u+eERtD0aQsHcaI2pzwUGXDWvDrrMhc=; h=From:To:Cc:Subject:Date:Reply-to:From; b=A0j5Fo0jz09GiRb7MqmpaaGxQ2U9aA3UjQQbLcHRRvyyFmlFlrKWgRdUnyv0lEp0T kIfqep0bvhZj1HTGHqwEkr2Z6hBxj0oO0P+mzbOvDvHtiZv+mm759Q5RlN9hrBqUfu xjqM/EtnB4jVi78+1EJaPSBvB+yv20qDk5geAx9U= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2024-36479: fpga: bridge: add owner module and take its refcount Date: Mon, 24 Jun 2024 15:57:03 +0200 Message-ID: <2024062459-CVE-2024-36479-ef6c@gregkh> X-Mailer: git-send-email 2.45.2 Precedence: bulk X-Mailing-List: linux-cve-announce@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Reply-to: , X-Developer-Signature: v=1; a=openpgp-sha256; l=3078; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=BVQ5E/qnZ+M3u+eERtD0aQsHcaI2pzwUGXDWvDrrMhc=; b=owGbwMvMwCRo6H6F97bub03G02pJDGmV1do3+Xeqnr57LmLCjbjm8Pf8Td+0l7aECGX2XPtvN E9GXbalI5aFQZCJQVZMkeXLNp6j+ysOKXoZ2p6GmcPKBDKEgYtTACbi9IdhrmDqB287uS/L7658 kVbVx1TEkWk3iWHB8fVHLQ7vK9K337s5hzGN7+Aj5xtBAA== X-Developer-Key: i=gregkh@linuxfoundation.org; a=openpgp; fpr=F4B60CC5BF78C2214A313DCB3147D40DDB2DFB29 Content-Transfer-Encoding: 8bit Description =========== In the Linux kernel, the following vulnerability has been resolved: fpga: bridge: add owner module and take its refcount The current implementation of the fpga bridge assumes that the low-level module registers a driver for the parent device and uses its owner pointer to take the module's refcount. This approach is problematic since it can lead to a null pointer dereference while attempting to get the bridge if the parent device does not have a driver. To address this problem, add a module owner pointer to the fpga_bridge struct and use it to take the module's refcount. Modify the function for registering a bridge to take an additional owner module parameter and rename it to avoid conflicts. Use the old function name for a helper macro that automatically sets the module that registers the bridge as the owner. This ensures compatibility with existing low-level control modules and reduces the chances of registering a bridge without setting the owner. Also, update the documentation to keep it consistent with the new interface for registering an fpga bridge. Other changes: opportunistically move put_device() from __fpga_bridge_get() to fpga_bridge_get() and of_fpga_bridge_get() to improve code clarity since the bridge device is taken in these functions. The Linux kernel CVE team has assigned CVE-2024-36479 to this issue. Affected and fixed versions =========================== Issue introduced in 4.10 with commit 21aeda950c5f and fixed in 6.6.33 with commit d7c4081c54a1 Issue introduced in 4.10 with commit 21aeda950c5f and fixed in 6.9.4 with commit 6896b6b2e2d9 Issue introduced in 4.10 with commit 21aeda950c5f and fixed in 6.10-rc1 with commit 1da11f822042 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-2024-36479 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: Documentation/driver-api/fpga/fpga-bridge.rst drivers/fpga/fpga-bridge.c include/linux/fpga/fpga-bridge.h 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/d7c4081c54a1d4068de9440957303a76f9e5c95b https://git.kernel.org/stable/c/6896b6b2e2d9ec4e1b0acb4c1698a75a4b34d125 https://git.kernel.org/stable/c/1da11f822042eb6ef4b6064dc048f157a7852529