[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <Y3ifYR9ZuqQN79vb@8bytes.org>
Date: Sat, 19 Nov 2022 10:18:25 +0100
From: Joerg Roedel <joro@...tes.org>
To: Robin Murphy <robin.murphy@....com>
Cc: will@...nel.org, iommu@...ts.linux.dev,
linux-kernel@...r.kernel.org,
Brian Norris <briannorris@...omium.org>
Subject: Re: [PATCH] iommu: Avoid races around device probe
On Fri, Nov 04, 2022 at 07:51:43PM +0000, Robin Murphy wrote:
> We currently have 3 different ways that __iommu_probe_device() may be
> called, but no real guarantee that multiple callers can't tread on each
> other, especially once asynchronous driver probe gets involved. It would
> likely have taken a fair bit of luck to hit this previously, but commit
> 57365a04c921 ("iommu: Move bus setup to IOMMU device registration") ups
> the odds since now it's not just omap-iommu that may trigger multiple
> bus_iommu_probe() calls in parallel if probing asynchronously.
>
> Add a lock to ensure we can't try to double-probe a device, and also
> close some possible race windows to make sure we're truly robust against
> trying to double-initialise a group via two different member devices.
>
> Reported-by: Brian Norris <briannorris@...omium.org>
> Signed-off-by: Robin Murphy <robin.murphy@....com>
> ---
> drivers/iommu/iommu.c | 28 ++++++++++++++++++++++------
> 1 file changed, 22 insertions(+), 6 deletions(-)
Applied, thanks Robin.
Powered by blists - more mailing lists