Received: by 2002:a05:6a10:c604:0:0:0:0 with SMTP id y4csp3872414pxt; Tue, 10 Aug 2021 13:28:17 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzUzJv6B2DEYhfXlUmYO5tLW+16xFbzrzuTvirhW3E5w7A5b4ZQr5gh3ivWOySBvozhmtri X-Received: by 2002:a02:c6b8:: with SMTP id o24mr29721095jan.108.1628627297477; Tue, 10 Aug 2021 13:28:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1628627297; cv=none; d=google.com; s=arc-20160816; b=DNEndUJSi94g7n41uh/pERCk6iGl77SgrUfbssQfKhv2GtzZd3zsMTu/Owe6OhDPm4 toE9XeHsZ9IcRTOCGOCWf5RE+qbqkVxJzNxBDR8hFqqm1o3kpulyNPFJrhXROvGpj6P/ vQD19cWkafEcP1AO+871hKweFTv7CPnQ1MPvgJ+I58IaxPtMGYZvgWaJ30Bt2WNj8R8g iHAv8x0Htrzw1pp7s1MibhXhfULj2gYZFllA4jBni0hoBVoWhixN2BPC6zcjhhrBmFUP bdGO5eTsayIg482aKqYYq5h4d8rpBAkeIp03xyGNMNFOizlBah2ED2rq3huFqQjelgOu Tdfw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=DUrbaWOkdlj4uMY0OyaRXT33J3dF+9jtBkOCAEQJPoI=; b=eF763cmHsfPyvqU326A3oFQqj2No1mOYz1norPLDb16p1OrGB9fn9F5s5C7gRhtgS+ mL5D/+9LLNMoP/4129Q3JGu0/oHY/pGmESQ+chfDQ+V8D+xcwcJsjFtIf40blUgXfOvW 0bJHRBy7S9ZFks3XcKb9VxoDehyXreZMKLGDvUaz3GmoR8WF/3fnvlYA4yg+Zgc9Yqlk xNkBtAgbnFzxFNINKC3BvL0w23mWuvyX+YC2sKKK/trTA+hRziNBCt2NOwnVMTwMBVNc 7Q9ZCqZl5yvN7CVkbXY6Zzf6DQStUQjbulqFSld6WGF3zGc8zAyOxETYGryl27YX+pco G0HQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=OVyzkRR7; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id f21si2303871iow.30.2021.08.10.13.28.05; Tue, 10 Aug 2021 13:28:17 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=OVyzkRR7; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233128AbhHJU00 (ORCPT + 99 others); Tue, 10 Aug 2021 16:26:26 -0400 Received: from mail.kernel.org ([198.145.29.99]:39116 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229764AbhHJU0Z (ORCPT ); Tue, 10 Aug 2021 16:26:25 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 910E960F13; Tue, 10 Aug 2021 20:26:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1628627163; bh=M/gnx8A37cYi/RDawoflYj+z3IDmvAjd8upAEDz9esk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=OVyzkRR7dz1I8A71AVZ9lXDMwcNEDyYltsZvLNHAn5xLieb1pReRv8tfvyyQUtnlF 4QRuZgxcF0uh6tHCwZVzksts4/YIbTqwgVZk3bFw1EwldWBCSUUucfTVxXxQz/4VQR 7xCbkYhHydV4j0hP5zgKze1qJb8QS0CWXkXuTQZpLFwbwNvhVThq/NQAmFdci+Gh3h CIqjEcgam7ufabC88dgvI2UU55vTU/rp/jTI/mbM2Kw+5pINWfuX2crRXk+MAOHUg4 diT3vHlTWh7zbsacTTJJsj/WUpclce2rfFgKa4hyMFe08BkXYr1CLf/PdBfI4Riq9T +vSnHZGuZJAHw== From: Will Deacon To: robin.murphy@arm.com, vdumpa@nvidia.com, Ashish Mhetre Cc: catalin.marinas@arm.com, kernel-team@android.com, Will Deacon , iommu@lists.linux-foundation.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: Re: [Patch V3 0/2] iommu/arm-smmu: Fix races in iommu domain/group creation Date: Tue, 10 Aug 2021 21:25:54 +0100 Message-Id: <162861955924.3590382.10228157894867875931.b4-ty@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <1628570641-9127-1-git-send-email-amhetre@nvidia.com> References: <1628570641-9127-1-git-send-email-amhetre@nvidia.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 10 Aug 2021 10:13:59 +0530, Ashish Mhetre wrote: > When two devices with same SID are getting probed concurrently through > iommu_probe_device(), the iommu_group and iommu_domain are allocated more > than once because they are not protected for concurrency. This is leading > to context faults when one device is accessing IOVA from other device. > Fix this by protecting iommu_domain and iommu_group creation with mutexes. > > Changes in v3: > * Updated commit messages. > * Added Signed-off-by in patch 2. > > [...] Applied to will (for-joerg/arm-smmu/updates), thanks! [1/2] iommu: Fix race condition during default domain allocation https://git.kernel.org/will/c/211ff31b3d33 [2/2] iommu/arm-smmu: Fix race condition during iommu_group creation https://git.kernel.org/will/c/b1a1347912a7 Cheers, -- Will https://fixes.arm64.dev https://next.arm64.dev https://will.arm64.dev