diff options
| author | Robin Murphy <robin.murphy@arm.com> | 2025-04-25 14:39:28 +0100 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2025-06-19 15:40:12 +0200 |
| commit | 73ca3e3649947a4602f174178e8d94471b2d9482 (patch) | |
| tree | f71eee88b3796d0ce77f59bc0026279f9845ee77 /tools/perf/scripts/python/stackcollapse.py | |
| parent | 873d47114fd5e5a1cad2018843671537cc71ac84 (diff) | |
| download | kernel-73ca3e3649947a4602f174178e8d94471b2d9482.tar.gz | |
bus: fsl_mc: Fix driver_managed_dma check
[ Upstream commit 152f33ee30ee6a7f4c15bedd7529dc5945315547 ]
Since it's not currently safe to take device_lock() in the IOMMU probe
path, that can race against really_probe() setting dev->driver before
attempting to bind. The race itself isn't so bad, since we're only
concerned with dereferencing dev->driver itself anyway, but sadly my
attempt to implement the check with minimal churn leads to a kind of
TOCTOU issue, where dev->driver becomes valid after to_fsl_mc_driver(NULL)
is already computed, and thus the check fails to work as intended.
Will and I both hit this with the platform bus, but the pattern here is
the same, so fix it for correctness too.
Reported-by: Will McVicker <willmcvicker@google.com>
Fixes: bcb81ac6ae3c ("iommu: Get DT/ACPI parsing into the proper probe path")
Signed-off-by: Robin Murphy <robin.murphy@arm.com>
Reviewed-by: Will McVicker <willmcvicker@google.com>
Link: https://lore.kernel.org/r/20250425133929.646493-3-robin.murphy@arm.com
Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'tools/perf/scripts/python/stackcollapse.py')
0 files changed, 0 insertions, 0 deletions
