]> Gentwo Git Trees - linux/.git/commit
iommu/mediatek: fix use-after-free on probe deferral
authorJohan Hovold <johan@kernel.org>
Mon, 20 Oct 2025 04:53:10 +0000 (06:53 +0200)
committerJoerg Roedel <joerg.roedel@amd.com>
Mon, 17 Nov 2025 08:49:43 +0000 (09:49 +0100)
commitde83d4617f9fe059623e97acf7e1e10d209625b5
treed0d42f806838afce8d846eb951dace0f6e8912b7
parentb3f1ee18280363ef17f82b564fc379ceba9ec86f
iommu/mediatek: fix use-after-free on probe deferral

The driver is dropping the references taken to the larb devices during
probe after successful lookup as well as on errors. This can
potentially lead to a use-after-free in case a larb device has not yet
been bound to its driver so that the iommu driver probe defers.

Fix this by keeping the references as expected while the iommu driver is
bound.

Fixes: 26593928564c ("iommu/mediatek: Add error path for loop of mm_dts_parse")
Cc: stable@vger.kernel.org
Cc: Yong Wu <yong.wu@mediatek.com>
Acked-by: Robin Murphy <robin.murphy@arm.com>
Signed-off-by: Johan Hovold <johan@kernel.org>
Reviewed-by: Yong Wu <yong.wu@mediatek.com>
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
drivers/iommu/mtk_iommu.c